mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-28 03:46:00 +01:00
Optimize getting theme ID
This commit is contained in:
@@ -71,6 +71,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
abstract class ActivityBase extends AppCompatActivity implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
private int themeId;
|
||||
private Context originalContext;
|
||||
private boolean visible;
|
||||
private boolean contacts;
|
||||
@@ -107,7 +108,8 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
||||
|
||||
if (!this.getClass().equals(ActivityMain.class)) {
|
||||
setTheme(FragmentDialogTheme.getTheme(this));
|
||||
themeId = FragmentDialogTheme.getTheme(this);
|
||||
setTheme(themeId);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
boolean dark = Helper.isDarkTheme(this);
|
||||
@@ -379,6 +381,10 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
||||
}
|
||||
}
|
||||
|
||||
public int getThemeId() {
|
||||
return this.themeId;
|
||||
}
|
||||
|
||||
public String getRequestKey() {
|
||||
return this.getClass().getName() + ":activity";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user