mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Minor changes
This commit is contained in:
parent
5aa538bbe8
commit
d5590c9cdd
1 changed files with 3 additions and 8 deletions
|
|
@ -463,8 +463,6 @@ public class CategorizationFragment extends Fragment {
|
||||||
@Override
|
@Override
|
||||||
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
||||||
if (event.getAction() == KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) {
|
if (event.getAction() == KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) {
|
||||||
// handle back button's click listener
|
|
||||||
Toast.makeText(getActivity(), "Back press", Toast.LENGTH_SHORT).show();
|
|
||||||
backButtonDialog();
|
backButtonDialog();
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -478,17 +476,14 @@ public class CategorizationFragment extends Fragment {
|
||||||
private void backButtonDialog() {
|
private void backButtonDialog() {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||||
|
|
||||||
builder.setMessage("Are you sure you want to leave? The image will not have any categories saved.")
|
builder.setMessage("Are you sure you want to go back? The image will not have any categories saved.")
|
||||||
.setTitle("Warning");
|
.setTitle("Warning");
|
||||||
|
builder.setPositiveButton("No", new DialogInterface.OnClickListener() {
|
||||||
builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
// User clicked OK button
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
|
builder.setNegativeButton("Yes", new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
// User cancelled the dialog
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue