Added navigation to account from expand/read hint

pull/196/head
M66B 5 years ago
parent eca0eca88c
commit 2751b5cd30

@ -22,6 +22,7 @@ package eu.faircode.email;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
@ -40,6 +41,7 @@ import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
@ -47,6 +49,7 @@ import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.SwitchCompat;
import androidx.lifecycle.Lifecycle;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.preference.PreferenceManager;
import java.util.ArrayList;
@ -74,6 +77,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
private SwitchCompat swExpandAll;
private SwitchCompat swExpandOne;
private SwitchCompat swAutoClose;
private TextView tvAutoSeenHint;
private Spinner spOnClose;
private Spinner spUndoTimeout;
private SwitchCompat swCollapseMultiple;
@ -124,6 +128,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
swExpandAll = view.findViewById(R.id.swExpandAll);
swExpandOne = view.findViewById(R.id.swExpandOne);
swCollapseMultiple = view.findViewById(R.id.swCollapseMultiple);
tvAutoSeenHint = view.findViewById(R.id.tvAutoSeenHint);
swAutoClose = view.findViewById(R.id.swAutoClose);
spOnClose = view.findViewById(R.id.spOnClose);
spUndoTimeout = view.findViewById(R.id.spUndoTimeout);
@ -310,6 +315,14 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
}
});
tvAutoSeenHint.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(v.getContext());
lbm.sendBroadcast(new Intent(ActivitySetup.ACTION_VIEW_ACCOUNTS));
}
});
swAutoClose.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {

@ -356,29 +356,31 @@
app:layout_constraintTop_toBottomOf="@id/swExpandAll"
app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvAutoSeenHint"
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swCollapseMultiple"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginEnd="48dp"
android:text="@string/title_advanced_autoseen_hint"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
android:text="@string/title_advanced_collapse_multiple"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swExpandOne" />
app:layout_constraintTop_toBottomOf="@id/swExpandOne"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swCollapseMultiple"
<eu.faircode.email.FixedTextView
android:id="@+id/tvAutoSeenHint"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_collapse_multiple"
android:layout_marginEnd="12dp"
android:drawableEnd="@drawable/twotone_settings_24"
android:drawablePadding="6dp"
android:text="@string/title_advanced_autoseen_hint"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvAutoSeenHint"
app:switchPadding="12dp" />
app:layout_constraintTop_toBottomOf="@id/swCollapseMultiple" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swAutoClose"
@ -389,7 +391,7 @@
android:text="@string/title_advanced_autoclose"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swCollapseMultiple"
app:layout_constraintTop_toBottomOf="@id/tvAutoSeenHint"
app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView

@ -609,7 +609,7 @@
<string name="title_advanced_language_detection_hint">Language detection support depends on the device manufacturer</string>
<string name="title_advanced_autoexpand_hint">Automatically open message when there is just one message or just one unread message in a conversation</string>
<string name="title_advanced_autoseen_hint">Automatically marking messages read on expanding can be disabled in the individual account settings</string>
<string name="title_advanced_autoseen_hint">Automatically marking messages as read on expanding can be disabled in the advanced account settings of each account</string>
<string name="title_advanced_autoclose_hint">Automatically close conversations when all messages are archived, sent or trashed</string>
<string name="title_advanced_sender_hint">Most providers do not allow modified sender addresses</string>
<string name="title_advanced_bcc_hint">The address won\'t be shown, but will be added on sending</string>

Loading…
Cancel
Save