Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/news-android.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfabienli <fab@lisiecki.fr>2021-06-11 17:28:36 +0300
committerfabienli <fab@lisiecki.fr>2021-06-16 13:49:12 +0300
commitb72f15f110f9f426c300c640ad1edff36633e667 (patch)
tree6258e094bab8a0045103a7d9e6a803b896c5666a /News-Android-App/src/main/java
parent4117c76ca5e1fae75f262cc9a61ad8ec6e1546cd (diff)
dark and light theme for save icons
Signed-off-by: fabienli <fab@lisiecki.fr>
Diffstat (limited to 'News-Android-App/src/main/java')
-rw-r--r--News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/SyncIntervalSelectorActivity.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/SyncIntervalSelectorActivity.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/SyncIntervalSelectorActivity.java
index 0ba46494..7a7a74e3 100644
--- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/SyncIntervalSelectorActivity.java
+++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/SyncIntervalSelectorActivity.java
@@ -31,6 +31,7 @@ public class SyncIntervalSelectorActivity extends AppCompatActivity {
private String[] items_values;
protected ActivitySyncIntervalSelectorBinding binding;
protected @Inject SharedPreferences mPrefs;
+ private Integer btn_save;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -56,14 +57,41 @@ public class SyncIntervalSelectorActivity extends AppCompatActivity {
}
}
+ private int getBtn_save_normal_holo() {
+ if (btn_save == null) {
+ if (ThemeChooser.getSelectedTheme().equals(ThemeChooser.THEME.LIGHT)) {
+ btn_save = R.drawable.ic_action_save_light;
+ } else {
+ btn_save = R.drawable.ic_action_save_dark; // dark
+ }
+ }
+ return btn_save;
+ }
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.sync_interval_selector, menu);
+
+
+ MenuItem btnSave = (MenuItem) menu.getItem(0);
+ if (btnSave != null) {
+ //btnSave.setIcon(getBtn_save_normal_holo());
+ //btnSave.setIcon(ContextCompat.getDrawable(this, getBtn_save_normal_holo()));
+ }
+
return true;
}
+ @Override
+ public boolean onPrepareOptionsMenu(Menu menu) {
+ MenuItem btnSave = (MenuItem) menu.getItem(0);
+ if (btnSave != null) {
+ btnSave.setIcon(getBtn_save_normal_holo());
+ }
+ return super.onPrepareOptionsMenu(menu);
+ }
+
public static final int SYNC_DEFAULT_INTERVAL = 15;
public static void setAccountSyncInterval(Context context, SharedPreferences mPrefs) {