- // Get the database IDs for the bookmarks.
- int selectedBookmarkDatabaseId = (int) selectedBookmarksLongArray[0];
- int firstBookmarkDatabaseId = (int) bookmarksListView.getItemIdAtPosition(0);
- // bookmarksListView is 0 indexed.
- int lastBookmarkDatabaseId = (int) bookmarksListView.getItemIdAtPosition(bookmarksListView.getCount() - 1);
-
- // Disable `moveBookmarkUpMenuItem` if the selected bookmark is at the top of the ListView.
- if (selectedBookmarkDatabaseId == firstBookmarkDatabaseId) {
- moveBookmarkUpMenuItem.setEnabled(false);
- moveBookmarkUpMenuItem.setIcon(R.drawable.move_up_disabled);
- } else { // Otherwise enable `moveBookmarkUpMenuItem`.
- moveBookmarkUpMenuItem.setEnabled(true);
-
- // Set the icon according to the theme.
- if (MainWebViewActivity.darkTheme) {
- moveBookmarkUpMenuItem.setIcon(R.drawable.move_up_enabled_dark);
- } else {
- moveBookmarkUpMenuItem.setIcon(R.drawable.move_up_enabled_light);
- }
- }
-
- // Disable `moveBookmarkDownMenuItem` if the selected bookmark is at the bottom of the ListView.
- if (selectedBookmarkDatabaseId == lastBookmarkDatabaseId) {
- moveBookmarkDownMenuItem.setEnabled(false);
- moveBookmarkDownMenuItem.setIcon(R.drawable.move_down_disabled);
- } else { // Otherwise enable `moveBookmarkDownMenuItem`.
- moveBookmarkDownMenuItem.setEnabled(true);
-
- // Set the icon according to the theme.
- if (MainWebViewActivity.darkTheme) {
- moveBookmarkDownMenuItem.setIcon(R.drawable.move_down_enabled_dark);
- } else {
- moveBookmarkDownMenuItem.setIcon(R.drawable.move_down_enabled_light);
+ // Update the enabled status of the move icons.
+ updateMoveIcons();
+ } else { // More than one bookmark is selected.
+ // List the number of selected bookmarks according to the language.
+ if (getString(R.string.android_asset_path).equals("ru")) { // The Russian translation is used.
+ // Convert the number of selected bookmarks to a string.
+ String numberOfSelectedBookmarksString = String.valueOf(numberOfSelectedBookmarks);
+
+ // Russian follows rule #7 at <https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals>.
+ if (numberOfSelectedBookmarksString.endsWith("1") && !numberOfSelectedBookmarksString.equals("11")) { // Ends in 1.
+ mode.setSubtitle(numberOfSelectedBookmarks + " " + getString(R.string.selected_russian_ends_in_1));
+ } else if ((numberOfSelectedBookmarksString.endsWith("2") || numberOfSelectedBookmarksString.endsWith("3") || numberOfSelectedBookmarksString.endsWith("4")) &&
+ !numberOfSelectedBookmarksString.equals("12") && !numberOfSelectedBookmarksString.equals("13") && !numberOfSelectedBookmarksString.equals("14")) { // Ends in 2-4.
+ mode.setSubtitle(numberOfSelectedBookmarks + " " + getString(R.string.selected_russian_ends_in_2));
+ } else { // Everything else.
+ mode.setSubtitle(numberOfSelectedBookmarks + " " + getString(R.string.selected_russian_everything_else));