1.4.0103 更换图标,G10P 标签MTK11改为G104,G10P标签为G10P

This commit is contained in:
2024-01-04 11:39:25 +08:00
parent 1bf394241c
commit 913270821c
36 changed files with 503 additions and 90 deletions

View File

@@ -37,25 +37,13 @@ public class EyeProtectionActivity extends BaseActivity {
@Override
public void initView() {
ButterKnife.bind(this);
int nightDisplay = Settings.Secure.getInt(getContentResolver(), Settings.Secure.NIGHT_DISPLAY_ACTIVATED, 0);
if (nightDisplay == 1) {
toggleButton1.setToggleOn();
} else {
toggleButton1.setToggleOff();
}
toggleButton1.setOnToggleChanged(new ToggleButton.OnToggleChanged() {
@Override
public void onToggle(boolean on) {
Settings.Secure.putInt(getContentResolver(), Settings.Secure.NIGHT_DISPLAY_ACTIVATED, on ? 1 : 0);
}
});
int accessibilityDisplay = Settings.Secure.getInt(getContentResolver(), Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED, 0);
if (accessibilityDisplay == 1) {
toggleButton2.setToggleOn();
} else {
toggleButton2.setToggleOff();
}
toggleButton2.setOnToggleChanged(new ToggleButton.OnToggleChanged() {
@Override
public void onToggle(boolean on) {
@@ -96,4 +84,22 @@ public class EyeProtectionActivity extends BaseActivity {
public void initData() {
}
@Override
protected void onResume() {
super.onResume();
int nightDisplay = Settings.Secure.getInt(getContentResolver(), Settings.Secure.NIGHT_DISPLAY_ACTIVATED, 0);
if (nightDisplay == 1) {
toggleButton1.setToggleOn();
} else {
toggleButton1.setToggleOff();
}
int accessibilityDisplay = Settings.Secure.getInt(getContentResolver(), Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED, 0);
if (accessibilityDisplay == 1) {
toggleButton2.setToggleOn();
} else {
toggleButton2.setToggleOff();
}
}
}