Skip to content

Commit

Permalink
Merge pull request #32 from Minime998/author-information
Browse files Browse the repository at this point in the history
  • Loading branch information
Minime998 authored Dec 4, 2024
2 parents 3e2ffc5 + 8d5c0bc commit f5fb49d
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
22 changes: 22 additions & 0 deletions app/src/main/java/com/example/camlingo/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
package com.example.camlingo;

import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;

import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.cardview.widget.CardView;

import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
Expand Down Expand Up @@ -123,6 +127,24 @@ public boolean onOptionsItemSelected(MenuItem item) {
return true;
}

if (id == R.id.about) {
// Handle about action
AlertDialog.Builder customDialogBuilder = new AlertDialog.Builder(this);
View customView = getLayoutInflater().inflate(R.layout.about_author_dialog, null);
customDialogBuilder.setView(customView);
customDialogBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// Dismiss the dialog
dialog.dismiss();
}
});
AlertDialog aboutDialog = customDialogBuilder.create();
aboutDialog.show();

return true;
}

return super.onOptionsItemSelected(item);
}

Expand Down
50 changes: 50 additions & 0 deletions app/src/main/res/layout/about_author_dialog.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">

<TextView
android:id="@+id/authors"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Authors:" />

<!-- TextView for Author 1 -->
<TextView
android:id="@+id/author1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Noah Fedosoff " />

<!-- TextView for Author 2 -->
<TextView
android:id="@+id/author2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sicheng Yu" />

<!-- TextView for Author 3 -->
<TextView
android:id="@+id/author3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hamza Tariq" />

<!-- TextView for Author 4 -->
<TextView
android:id="@+id/author4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Frank Obedi" />

<!-- TextView for Author 5 -->
<TextView
android:id="@+id/author5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Kiran Persaud" />

</LinearLayout>
6 changes: 6 additions & 0 deletions app/src/main/res/menu/toolbar_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<item
android:id="@+id/about"
android:title="About Author"
app:showAsAction="never"
android:visible="true" />

<item
android:title="Settings"
android:id="@+id/settings"
Expand Down

0 comments on commit f5fb49d

Please sign in to comment.