This commit is contained in:
Ishan09811 2024-02-13 18:41:37 +05:30 committed by GitHub
parent 84f1ee2c16
commit 135ee77c6e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,6 +4,7 @@ import android.os.Bundle;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.preference.SwitchPreference; import androidx.preference.SwitchPreference;
import com.google.android.material.color.DynamicColors;
import com.panda3ds.pandroid.R; import com.panda3ds.pandroid.R;
import com.panda3ds.pandroid.app.BaseActivity; import com.panda3ds.pandroid.app.BaseActivity;
@ -37,6 +38,10 @@ public class AppearancePreferences extends BasePreferenceFragment {
private void refresh() { private void refresh() {
((SwitchPreference) findPreference("dynamic_colors")).setChecked(GlobalConfig.get(GlobalConfig.KEY_DYNAMIC_COLORS)); ((SwitchPreference) findPreference("dynamic_colors")).setChecked(GlobalConfig.get(GlobalConfig.KEY_DYNAMIC_COLORS));
if (!DynamicColors.isDynamicColorAvailable(this)) {
((SwitchPreference) findPreference("dynamic_colors")).setEnabled(false);
}
} }
} }