Fix small theme config issue
This commit is contained in:
parent
e6afbf2ec0
commit
017fbf267b
@ -110,11 +110,6 @@ public class MainActivity extends BaseActivity
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getSubscribedTopics() {
|
|
||||||
return new int[] {Topic.RELOAD_ACTIVITY};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPublish(int topic, Object[] result) {
|
public void onPublish(int topic, Object[] result) {
|
||||||
recreate();
|
recreate();
|
||||||
|
@ -43,11 +43,11 @@ public abstract class FlavorActivity extends AppCompatActivity implements Topic.
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
Topic.subscribe(this);
|
Topic.subscribe(this);
|
||||||
if (Data.isDarkTheme && getDarkTheme() != -1) {
|
if (Data.isDarkTheme && getDarkTheme() != -1) {
|
||||||
setTheme(getDarkTheme());
|
setTheme(getDarkTheme());
|
||||||
}
|
}
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -222,7 +222,7 @@ public class SettingsFragment extends PreferenceFragmentCompat
|
|||||||
setSummary();
|
setSummary();
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case Const.Key.DARK_THEME:
|
case Const.Key.DARK_THEME:
|
||||||
Topic.publish(false, Topic.RELOAD_ACTIVITY);
|
requireActivity().recreate();
|
||||||
break;
|
break;
|
||||||
case Const.Key.COREONLY:
|
case Const.Key.COREONLY:
|
||||||
if (prefs.getBoolean(key, false)) {
|
if (prefs.getBoolean(key, false)) {
|
||||||
@ -254,7 +254,7 @@ public class SettingsFragment extends PreferenceFragmentCompat
|
|||||||
break;
|
break;
|
||||||
case Const.Key.LOCALE:
|
case Const.Key.LOCALE:
|
||||||
LocaleManager.setLocale(mm);
|
LocaleManager.setLocale(mm);
|
||||||
Topic.publish(false, Topic.RELOAD_ACTIVITY);
|
requireActivity().recreate();
|
||||||
break;
|
break;
|
||||||
case Const.Key.UPDATE_CHANNEL:
|
case Const.Key.UPDATE_CHANNEL:
|
||||||
case Const.Key.CUSTOM_CHANNEL:
|
case Const.Key.CUSTOM_CHANNEL:
|
||||||
|
@ -12,20 +12,19 @@ import androidx.annotation.IntDef;
|
|||||||
public class Topic {
|
public class Topic {
|
||||||
|
|
||||||
public static final int MAGISK_HIDE_DONE = 0;
|
public static final int MAGISK_HIDE_DONE = 0;
|
||||||
public static final int RELOAD_ACTIVITY = 1;
|
public static final int MODULE_LOAD_DONE = 1;
|
||||||
public static final int MODULE_LOAD_DONE = 2;
|
public static final int REPO_LOAD_DONE = 2;
|
||||||
public static final int REPO_LOAD_DONE = 3;
|
public static final int UPDATE_CHECK_DONE = 3;
|
||||||
public static final int UPDATE_CHECK_DONE = 4;
|
public static final int SNET_CHECK_DONE = 4;
|
||||||
public static final int SNET_CHECK_DONE = 5;
|
public static final int LOCALE_FETCH_DONE = 5;
|
||||||
public static final int LOCALE_FETCH_DONE = 6;
|
|
||||||
|
|
||||||
@IntDef({MAGISK_HIDE_DONE, RELOAD_ACTIVITY, MODULE_LOAD_DONE, REPO_LOAD_DONE,
|
@IntDef({MAGISK_HIDE_DONE, MODULE_LOAD_DONE, REPO_LOAD_DONE,
|
||||||
UPDATE_CHECK_DONE, SNET_CHECK_DONE, LOCALE_FETCH_DONE})
|
UPDATE_CHECK_DONE, SNET_CHECK_DONE, LOCALE_FETCH_DONE})
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
public @interface TopicID {}
|
public @interface TopicID {}
|
||||||
|
|
||||||
// We will not dynamically add topics, so use arrays instead of hash tables
|
// We will not dynamically add topics, so use arrays instead of hash tables
|
||||||
private static Store[] topicList = new Store[7];
|
private static Store[] topicList = new Store[6];
|
||||||
|
|
||||||
public static void subscribe(Subscriber sub, @TopicID int... topics) {
|
public static void subscribe(Subscriber sub, @TopicID int... topics) {
|
||||||
for (int topic : topics) {
|
for (int topic : topics) {
|
||||||
|
Loading…
Reference in New Issue
Block a user