use of org.wikipedia.history.SearchActionModeCallback in project apps-android-wikipedia by wikimedia.
the class ReadingListsFragment method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch(item.getItemId()) {
case R.id.menu_search_lists:
((AppCompatActivity) requireActivity()).startSupportActionMode(searchActionModeCallback);
return true;
case R.id.menu_sort:
bottomSheetPresenter.show(getChildFragmentManager(), SortReadingListsDialog.newInstance(Prefs.getReadingListSortMode(ReadingList.SORT_BY_NAME_ASC)));
return true;
case R.id.create_list:
String title = getString(R.string.reading_list_name_sample);
List<String> existingTitles = new ArrayList<>();
for (ReadingList tempList : readingLists) {
existingTitles.add(tempList.title());
}
ReadingListTitleDialog.readingListTitleDialog(requireContext(), title, "", existingTitles, (text, description) -> {
ReadingListDbHelper.instance().createList(text, description);
updateLists();
}).show();
return true;
case R.id.refresh:
refreshSync();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
Aggregations