Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

Commit

Permalink
updated notification turn on screen
Browse files Browse the repository at this point in the history
  • Loading branch information
XJIOP committed Jan 20, 2023
1 parent fec5817 commit ffcffab
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion app/src/main/java/org/xjiop/oxygenaodmod/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
}

INTERVAL = value;
preference.setSummary(newValue.toString() + " " + getString(R.string.sec));
preference.setSummary(newValue + " " + getString(R.string.sec));

Helper.showDialogFragment(mContext, MessageDialog.newInstance(getString(R.string.attention), getString(R.string.interval_info)));

Expand Down Expand Up @@ -467,6 +467,7 @@ else if(requestCode == NOTIFICATION_RESULT) {

public void turnOnScreen() {
if (isResumed()) {
findPreference("reset_when_screen_turn_on").setEnabled(!TURN_ON_SCREEN);
findPreference("show_notification_counter").setEnabled(!TURN_ON_SCREEN);
findPreference("color").setEnabled(!TURN_ON_SCREEN);
findPreference("icon").setEnabled(!TURN_ON_SCREEN);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public void recountNotifications() {
NOTIFICATION_COUNT = 0;
INDICATOR_COUNT = 0;

if (!RESET_WHEN_SCREEN_TURN_ON) {
if (!RESET_WHEN_SCREEN_TURN_ON || TURN_ON_SCREEN) {
for (StatusBarNotification sbn : getActiveNotifications()) {
newNotification(sbn);
}
Expand Down
12 changes: 6 additions & 6 deletions app/src/main/res/xml/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@
app:iconSpaceReserved="false" />

<CheckBoxPreference
android:title="@string/reset_when_screen_turn_on"
android:key="reset_when_screen_turn_on"
android:defaultValue="true"
android:title="@string/turn_on_screen"
android:key="turn_on_screen"
android:defaultValue="false"
android:summary="@string/instead_notifications"
android:dependency="indicator"
app:iconSpaceReserved="false" />

<CheckBoxPreference
android:title="@string/turn_on_screen"
android:key="turn_on_screen"
android:title="@string/reset_when_screen_turn_on"
android:key="reset_when_screen_turn_on"
android:defaultValue="false"
android:summary="@string/instead_notifications"
android:dependency="indicator"
app:iconSpaceReserved="false" />

Expand Down

0 comments on commit ffcffab

Please sign in to comment.