mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-05 00:23:09 +02:00
Moved biometrics notify options
This commit is contained in:
@@ -47,7 +47,6 @@ import androidx.preference.PreferenceManager;
|
||||
public class FragmentOptionsMisc extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
private SwitchCompat swDoubleBack;
|
||||
private Spinner spBiometricsTimeout;
|
||||
private SwitchCompat swBiometricsNotify;
|
||||
private SwitchCompat swEnglish;
|
||||
private SwitchCompat swWatchdog;
|
||||
private SwitchCompat swUpdates;
|
||||
@@ -63,7 +62,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
private Group grpDebug;
|
||||
|
||||
private final static String[] RESET_OPTIONS = new String[]{
|
||||
"double_back", "biometrics_timeout", "biometrics_notify", "english", "watchdog", "updates", "crash_reports", "debug"
|
||||
"double_back", "biometrics_timeout", "english", "watchdog", "updates", "crash_reports", "debug"
|
||||
};
|
||||
|
||||
private final static String[] RESET_QUESTIONS = new String[]{
|
||||
@@ -82,7 +81,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
|
||||
swDoubleBack = view.findViewById(R.id.swDoubleBack);
|
||||
spBiometricsTimeout = view.findViewById(R.id.spBiometricsTimeout);
|
||||
swBiometricsNotify = view.findViewById(R.id.swBiometricsNotify);
|
||||
swEnglish = view.findViewById(R.id.swEnglish);
|
||||
swWatchdog = view.findViewById(R.id.swWatchdog);
|
||||
swUpdates = view.findViewById(R.id.swUpdates);
|
||||
@@ -123,13 +121,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
}
|
||||
});
|
||||
|
||||
swBiometricsNotify.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("biometrics_notify", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
swEnglish.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
@@ -273,8 +264,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
break;
|
||||
}
|
||||
|
||||
swBiometricsNotify.setChecked(prefs.getBoolean("biometrics_notify", false));
|
||||
|
||||
swEnglish.setChecked(prefs.getBoolean("english", false));
|
||||
swWatchdog.setChecked(prefs.getBoolean("watchdog", true));
|
||||
swUpdates.setChecked(prefs.getBoolean("updates", true));
|
||||
|
||||
@@ -59,6 +59,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
|
||||
private CheckBox cbNotifyActionFlag;
|
||||
private CheckBox cbNotifyActionSeen;
|
||||
private TextView tvNotifyActionsPro;
|
||||
private SwitchCompat swBiometricsNotify;
|
||||
private Button btnManage;
|
||||
private TextView tvManageHint;
|
||||
private ImageButton ibManage;
|
||||
@@ -69,7 +70,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
|
||||
|
||||
private final static String[] RESET_OPTIONS = new String[]{
|
||||
"badge", "unseen_ignored",
|
||||
"notify_preview", "notify_trash", "notify_archive", "notify_reply", "notify_flag", "notify_seen",
|
||||
"notify_preview", "notify_trash", "notify_archive", "notify_reply", "notify_flag", "notify_seen", "biometrics_notify",
|
||||
"light", "sound"
|
||||
};
|
||||
|
||||
@@ -92,6 +93,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
|
||||
cbNotifyActionFlag = view.findViewById(R.id.cbNotifyActionFlag);
|
||||
cbNotifyActionSeen = view.findViewById(R.id.cbNotifyActionSeen);
|
||||
tvNotifyActionsPro = view.findViewById(R.id.tvNotifyActionsPro);
|
||||
swBiometricsNotify = view.findViewById(R.id.swBiometricsNotify);
|
||||
btnManage = view.findViewById(R.id.btnManage);
|
||||
tvManageHint = view.findViewById(R.id.tvManageHint);
|
||||
ibManage = view.findViewById(R.id.ibManage);
|
||||
@@ -167,6 +169,13 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
|
||||
|
||||
Helper.linkPro(tvNotifyActionsPro);
|
||||
|
||||
swBiometricsNotify.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("biometrics_notify", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
final Intent manage = getIntentNotifications(getContext());
|
||||
btnManage.setVisibility(manage.resolveActivity(pm) == null ? View.GONE : View.VISIBLE);
|
||||
btnManage.setOnClickListener(new View.OnClickListener() {
|
||||
@@ -273,6 +282,8 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
|
||||
cbNotifyActionFlag.setEnabled(pro);
|
||||
cbNotifyActionSeen.setEnabled(pro);
|
||||
|
||||
swBiometricsNotify.setChecked(prefs.getBoolean("biometrics_notify", false));
|
||||
|
||||
swLight.setChecked(prefs.getBoolean("light", false));
|
||||
|
||||
grpNotification.setVisibility(Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.O ? View.VISIBLE : View.GONE);
|
||||
|
||||
@@ -52,17 +52,6 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvBiometricsTimeout" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swBiometricsNotify"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/title_advanced_biometrics_notify"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/spBiometricsTimeout"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swEnglish"
|
||||
android:layout_width="0dp"
|
||||
@@ -71,7 +60,7 @@
|
||||
android:text="@string/title_advanced_english"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/swBiometricsNotify"
|
||||
app:layout_constraintTop_toBottomOf="@id/spBiometricsTimeout"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -160,6 +160,17 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvNotifyActionsHint" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swBiometricsNotify"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/title_advanced_biometrics_notify"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvNotifyActionsPro"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnManage"
|
||||
style="?android:attr/buttonStyleSmall"
|
||||
@@ -170,7 +181,7 @@
|
||||
android:minHeight="0dp"
|
||||
android:text="@string/title_setup_notifications"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvNotifyActionsPro" />
|
||||
app:layout_constraintTop_toBottomOf="@id/swBiometricsNotify" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvManageHint"
|
||||
|
||||
@@ -273,6 +273,7 @@
|
||||
<string name="title_advanced_notify_action_reply">Reply</string>
|
||||
<string name="title_advanced_notify_action_flag">Star</string>
|
||||
<string name="title_advanced_notify_action_seen">Read</string>
|
||||
<string name="title_advanced_biometrics_notify">Show notification content when using biometric authentication</string>
|
||||
<string name="title_advanced_light">Use notification light</string>
|
||||
<string name="title_advanced_sound">Select notification sound</string>
|
||||
|
||||
@@ -282,7 +283,6 @@
|
||||
|
||||
<string name="title_advanced_double_back">Double \'back\' to exit</string>
|
||||
<string name="title_advanced_biometrics_timeout">Biometric authentication timeout</string>
|
||||
<string name="title_advanced_biometrics_notify">Show notification content when using biometric authentication</string>
|
||||
<string name="title_advanced_english">Force English language</string>
|
||||
<string name="title_advanced_watchdog">Periodically check if FairEmail is still active</string>
|
||||
<string name="title_advanced_updates">Check for updates</string>
|
||||
|
||||
Reference in New Issue
Block a user