Added doze info button

This commit is contained in:
M66B 2021-09-23 22:25:13 +02:00
parent 6c2d5a8c15
commit 495e090ba5
3 changed files with 36 additions and 1 deletions

15
FAQ.md
View File

@ -313,6 +313,7 @@ Fonts, sizes, colors, etc should be material design whenever possible.
* [(172) How can I import contacts?](#user-content-faq172)
* [(173) What is the difference between Play store / GitHub / F-Droid version?](#user-content-faq173)
* [(174) Is auto discovery supported?](#user-content-faq174)
* [(175) Why should battery optimizations be disabled?](#user-content-faq175)
[I have another question.](#user-content-get-support)
@ -3922,6 +3923,20 @@ There is no auto discovery for POP3.
<br />
<a name="faq175"></a>
**(175) Why should battery optimizations be disabled?**
If battery optimizations ([Doze mode](https://developer.android.com/training/monitoring-device-state/doze-standby)) are enabled,
Android might stop the app, which will result in not sending and receiving messages anymore.
It shouldn't be necessary to disable battery optimizations for Android version 11 or earlier,
but unfortunately modifications by manufacturers often [require it anyway](https://dontkillmyapp.com/).
For Android 12 or later, battery optimizations need to be disabled to receive push messages
due to [strict foreground restrictions](https://developer.android.com/about/versions/12/foreground-services).
If battery optimizations are enabled, the app will periodically check for messages.
<br />
<h2><a name="get-support"></a>Get support</h2>

View File

@ -94,6 +94,7 @@ public class FragmentSetup extends FragmentBase {
private TextView tvDozeDone;
private Button btnDoze;
private TextView tvDoze12;
private ImageButton ibDoze;
private Button btnInexactAlarms;
private Button btnBackgroundRestricted;
@ -160,6 +161,7 @@ public class FragmentSetup extends FragmentBase {
tvDozeDone = view.findViewById(R.id.tvDozeDone);
btnDoze = view.findViewById(R.id.btnDoze);
tvDoze12 = view.findViewById(R.id.tvDoze12);
ibDoze = view.findViewById(R.id.ibDoze);
btnInexactAlarms = view.findViewById(R.id.btnInexactAlarms);
btnBackgroundRestricted = view.findViewById(R.id.btnBackgroundRestricted);
@ -448,6 +450,13 @@ public class FragmentSetup extends FragmentBase {
}
});
ibDoze.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Helper.viewFAQ(v.getContext(), 175, true);
}
});
tvStamina.setPaintFlags(tvStamina.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
tvStamina.setOnClickListener(new View.OnClickListener() {
@Override

View File

@ -715,6 +715,17 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDozeHint" />
<ImageButton
android:id="@+id/ibDoze"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:contentDescription="@string/title_info"
android:tooltipText="@string/title_info"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDoze12"
app:srcCompat="@drawable/twotone_info_24" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvInexactAlarms"
android:layout_width="wrap_content"
@ -725,7 +736,7 @@
android:textColor="?attr/colorWarning"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDoze12" />
app:layout_constraintTop_toBottomOf="@id/ibDoze" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvInexactAlarmsWarning"