Android SDK中的LocalNightMode回调是否可用,说明已成功设置?

时间:2019-02-26 19:16:24

标签: android callback android-theme

我已经通过以下方式在我的应用中设置LocalNightMode。

但是除此之外,我需要知道何时成功设置LocalNightMode。我需要使用App中的LocalNightMode更改来刷新特定的用户界面。

public void changeDayNightMode(boolean change) {
    if (change) {
        getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_YES);
        Preferences
                .getInstance(CustomApplication.getInstance()).setNightMode(true);
    } else {
        getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_NO);
        Preferences
                .getInstance(CustomApplication.getInstance()).setNightMode(false);
    }
}

是否存在这种情况下的回叫或解决方法?

在手动设置LocalNight之后,我会在延迟一段时间后触发一个事件吗?

0 个答案:

没有答案