mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-26 17:57:16 +00:00
Clear badge count
This commit is contained in:
parent
d002f5bc21
commit
1244ee472d
1 changed files with 7 additions and 0 deletions
|
@ -51,6 +51,8 @@ import androidx.constraintlayout.widget.Group;
|
||||||
import androidx.lifecycle.Lifecycle;
|
import androidx.lifecycle.Lifecycle;
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
|
import me.leolin.shortcutbadger.ShortcutBadger;
|
||||||
|
|
||||||
import static android.app.Activity.RESULT_OK;
|
import static android.app.Activity.RESULT_OK;
|
||||||
|
|
||||||
public class FragmentOptionsNotifications extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener {
|
public class FragmentOptionsNotifications extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||||
|
@ -331,6 +333,11 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||||
prefs.edit().putBoolean("badge", checked).apply();
|
prefs.edit().putBoolean("badge", checked).apply();
|
||||||
|
try {
|
||||||
|
ShortcutBadger.removeCount(compoundButton.getContext());
|
||||||
|
} catch (Throwable ex) {
|
||||||
|
Log.w(ex);
|
||||||
|
}
|
||||||
ServiceSynchronize.restart(compoundButton.getContext());
|
ServiceSynchronize.restart(compoundButton.getContext());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue