Always group notifications

This commit is contained in:
M66B
2019-06-27 08:00:36 +02:00
parent 9b1514e2f0
commit 2925312631
4 changed files with 52 additions and 83 deletions

View File

@@ -49,7 +49,6 @@ import androidx.preference.PreferenceManager;
import static android.app.Activity.RESULT_OK;
public class FragmentOptionsNotifications extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener {
private SwitchCompat swNotifyGroup;
private SwitchCompat swNotifyPreview;
private CheckBox cbNotifyActionTrash;
private CheckBox cbNotifyActionArchive;
@@ -64,7 +63,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
private Group grpNotification;
private final static String[] RESET_OPTIONS = new String[]{
"notify_group", "notify_preview", "notify_trash", "notify_archive", "notify_reply", "notify_flag", "notify_seen", "light", "sound"
"notify_preview", "notify_trash", "notify_archive", "notify_reply", "notify_flag", "notify_seen", "light", "sound"
};
@Override
@@ -77,7 +76,6 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
// Get controls
swNotifyGroup = view.findViewById(R.id.swNotifyGroup);
swNotifyPreview = view.findViewById(R.id.swNotifyPreview);
cbNotifyActionTrash = view.findViewById(R.id.cbNotifyActionTrash);
cbNotifyActionArchive = view.findViewById(R.id.cbNotifyActionArchive);
@@ -98,13 +96,6 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
PackageManager pm = getContext().getPackageManager();
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
swNotifyGroup.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("notify_group", checked).apply();
}
});
swNotifyPreview.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -233,8 +224,6 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
boolean pro = Helper.isPro(getContext());
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
swNotifyGroup.setChecked(prefs.getBoolean("notify_group", true));
swNotifyGroup.setVisibility(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N ? View.VISIBLE : View.GONE);
swNotifyPreview.setChecked(prefs.getBoolean("notify_preview", true));
cbNotifyActionTrash.setChecked(prefs.getBoolean("notify_trash", true));