X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Factivities%2FBookmarksDatabaseViewActivity.java;h=91afa6d64120a2d15d1bbba2b53083b4e7ae22bc;hp=483b769f42dbf7de71b761c70961372c71fb110f;hb=1b27ac6f2b7c046945fc97e2aff9adbde8a152ce;hpb=484f0b0f0143c53a4722cee3a31e714df0c8c49a diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksDatabaseViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksDatabaseViewActivity.java index 483b769f..91afa6d6 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksDatabaseViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksDatabaseViewActivity.java @@ -1,20 +1,20 @@ /* - * Copyright © 2016-2021 Soren Stoutner . + * Copyright © 2016-2022 Soren Stoutner . * - * This file is part of Privacy Browser . + * This file is part of Privacy Browser Android . * - * Privacy Browser is free software: you can redistribute it and/or modify + * Privacy Browser Android is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * Privacy Browser is distributed in the hope that it will be useful, + * Privacy Browser Android is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Privacy Browser. If not, see . + * along with Privacy Browser Android. If not, see . */ package com.stoutner.privacybrowser.activities; @@ -613,19 +613,12 @@ public class BookmarksDatabaseViewActivity extends AppCompatActivity implements // Inflate the menu. getMenuInflater().inflate(R.menu.bookmarks_databaseview_options_menu, menu); - // Get the current theme status. - int currentThemeStatus = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK; - // Get a handle for the sort menu item. MenuItem sortMenuItem = menu.findItem(R.id.sort); // Change the sort menu item icon if the listview is sorted by display order, which restores the state after a restart. if (sortByDisplayOrder) { - if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) { - sortMenuItem.setIcon(R.drawable.sort_selected_day); - } else { - sortMenuItem.setIcon(R.drawable.sort_selected_night); - } + sortMenuItem.setIcon(R.drawable.sort_selected); } // Success. @@ -648,27 +641,16 @@ public class BookmarksDatabaseViewActivity extends AppCompatActivity implements // Get a handle for the bookmarks list view. ListView bookmarksListView = findViewById(R.id.bookmarks_databaseview_listview); - // Get the current theme status. - int currentThemeStatus = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK; - // Update the icon and display a snackbar. if (sortByDisplayOrder) { // Sort by display order. - // Update the icon according to the theme. - if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) { - menuItem.setIcon(R.drawable.sort_selected_day); - } else { - menuItem.setIcon(R.drawable.sort_selected_night); - } + // Update the icon. + menuItem.setIcon(R.drawable.sort_selected); // Display a Snackbar indicating the current sort type. Snackbar.make(bookmarksListView, R.string.sorted_by_display_order, Snackbar.LENGTH_SHORT).show(); } else { // Sort by database id. - // Update the icon according to the theme. - if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) { - menuItem.setIcon(R.drawable.sort_day); - } else { - menuItem.setIcon(R.drawable.sort_night); - } + // Update the icon. + menuItem.setIcon(R.drawable.sort); // Display a Snackbar indicating the current sort type. Snackbar.make(bookmarksListView, R.string.sorted_by_database_id, Snackbar.LENGTH_SHORT).show();