mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
Merge remote-tracking branch 'refs/remotes/commons-app/master'
This commit is contained in:
commit
ee16ee7e97
1 changed files with 5 additions and 6 deletions
|
|
@ -76,6 +76,8 @@ public class CategorizationFragment extends Fragment {
|
||||||
|
|
||||||
protected HashMap<String, ArrayList<String>> categoriesCache;
|
protected HashMap<String, ArrayList<String>> categoriesCache;
|
||||||
|
|
||||||
|
private ArrayList<String> selectedCategories = new ArrayList<String>();
|
||||||
|
|
||||||
// LHS guarantees ordered insertions, allowing for prioritized method A results
|
// LHS guarantees ordered insertions, allowing for prioritized method A results
|
||||||
private final Set<String> results = new LinkedHashSet<String>();
|
private final Set<String> results = new LinkedHashSet<String>();
|
||||||
PrefixUpdater prefixUpdaterSub;
|
PrefixUpdater prefixUpdaterSub;
|
||||||
|
|
@ -584,7 +586,7 @@ public class CategorizationFragment extends Fragment {
|
||||||
public boolean onOptionsItemSelected(MenuItem menuItem) {
|
public boolean onOptionsItemSelected(MenuItem menuItem) {
|
||||||
switch(menuItem.getItemId()) {
|
switch(menuItem.getItemId()) {
|
||||||
case R.id.menu_save_categories:
|
case R.id.menu_save_categories:
|
||||||
ArrayList<String> selectedCategories = new ArrayList<String>();
|
|
||||||
int numberSelected = 0;
|
int numberSelected = 0;
|
||||||
|
|
||||||
for(CategoryItem item: categoriesAdapter.getItems()) {
|
for(CategoryItem item: categoriesAdapter.getItems()) {
|
||||||
|
|
@ -594,9 +596,6 @@ public class CategorizationFragment extends Fragment {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Need to reassign to a final variable to use in inner class
|
|
||||||
final ArrayList<String> finalCategories = selectedCategories;
|
|
||||||
|
|
||||||
//If no categories selected, display warning to user
|
//If no categories selected, display warning to user
|
||||||
if (numberSelected == 0) {
|
if (numberSelected == 0) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||||
|
|
@ -612,7 +611,7 @@ public class CategorizationFragment extends Fragment {
|
||||||
builder.setNegativeButton("Yes, submit", new DialogInterface.OnClickListener() {
|
builder.setNegativeButton("Yes, submit", new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
//Proceed to submission
|
//Proceed to submission
|
||||||
onCategoriesSaveHandler.onCategoriesSave(finalCategories);
|
onCategoriesSaveHandler.onCategoriesSave(selectedCategories);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -621,7 +620,7 @@ public class CategorizationFragment extends Fragment {
|
||||||
dialog.show();
|
dialog.show();
|
||||||
} else {
|
} else {
|
||||||
//Proceed to submission
|
//Proceed to submission
|
||||||
onCategoriesSaveHandler.onCategoriesSave(finalCategories);
|
onCategoriesSaveHandler.onCategoriesSave(selectedCategories);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue