mirror of https://github.com/M66B/FairEmail.git
parent
0d828ce2ab
commit
b5c3108be8
|
@ -20,7 +20,6 @@ package eu.faircode.email;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
@ -33,7 +32,6 @@ import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.annotation.RequiresApi;
|
import androidx.annotation.RequiresApi;
|
||||||
import androidx.appcompat.widget.AppCompatEditText;
|
import androidx.appcompat.widget.AppCompatEditText;
|
||||||
import androidx.preference.PreferenceManager;
|
|
||||||
|
|
||||||
public class FixedEditText extends AppCompatEditText {
|
public class FixedEditText extends AppCompatEditText {
|
||||||
public FixedEditText(@NonNull Context context) {
|
public FixedEditText(@NonNull Context context) {
|
||||||
|
@ -276,8 +274,6 @@ public class FixedEditText extends AppCompatEditText {
|
||||||
@Override
|
@Override
|
||||||
public ActionMode startActionMode(ActionMode.Callback callback) {
|
public ActionMode startActionMode(ActionMode.Callback callback) {
|
||||||
try {
|
try {
|
||||||
if (skipActionMode())
|
|
||||||
return null;
|
|
||||||
return super.startActionMode(callback);
|
return super.startActionMode(callback);
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
Log.e(ex);
|
Log.e(ex);
|
||||||
|
@ -289,8 +285,6 @@ public class FixedEditText extends AppCompatEditText {
|
||||||
public ActionMode startActionMode(ActionMode.Callback callback, int type) {
|
public ActionMode startActionMode(ActionMode.Callback callback, int type) {
|
||||||
try {
|
try {
|
||||||
// callback class: android.widget.Editor$TextActionModeCallback
|
// callback class: android.widget.Editor$TextActionModeCallback
|
||||||
if (skipActionMode())
|
|
||||||
return null;
|
|
||||||
return super.startActionMode(callback, type);
|
return super.startActionMode(callback, type);
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
Log.e(ex);
|
Log.e(ex);
|
||||||
|
@ -298,20 +292,6 @@ public class FixedEditText extends AppCompatEditText {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean skipActionMode() {
|
|
||||||
try {
|
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
||||||
if (!prefs.contains("skip_action_mode")) {
|
|
||||||
if ("fuxi_eea".equals(Build.PRODUCT) && Build.VERSION.SDK_INT == Build.VERSION_CODES.TIRAMISU)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return prefs.getBoolean("skip_action_mode", false);
|
|
||||||
} catch (Throwable ex) {
|
|
||||||
Log.e(ex);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||||
|
|
|
@ -240,7 +240,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||||
private SwitchCompat swDupMsgId;
|
private SwitchCompat swDupMsgId;
|
||||||
private SwitchCompat swThreadByRef;
|
private SwitchCompat swThreadByRef;
|
||||||
private SwitchCompat swMdn;
|
private SwitchCompat swMdn;
|
||||||
private SwitchCompat swSkipActionMode;
|
|
||||||
private EditText etKeywords;
|
private EditText etKeywords;
|
||||||
private SwitchCompat swTestIab;
|
private SwitchCompat swTestIab;
|
||||||
private Button btnImportProviders;
|
private Button btnImportProviders;
|
||||||
|
@ -303,8 +302,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||||
"max_backoff_power", "logarithmic_backoff",
|
"max_backoff_power", "logarithmic_backoff",
|
||||||
"exact_alarms",
|
"exact_alarms",
|
||||||
"native_dkim", "native_arc", "native_arc_whitelist",
|
"native_dkim", "native_arc", "native_arc_whitelist",
|
||||||
"infra", "tld_flags", "dup_msgids", "thread_byref", "mdn", "skip_action_mode",
|
"infra", "tld_flags", "dup_msgids", "thread_byref", "mdn", "global_keywords", "test_iab"
|
||||||
"global_keywords", "test_iab"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
private final static String[] RESET_QUESTIONS = new String[]{
|
private final static String[] RESET_QUESTIONS = new String[]{
|
||||||
|
@ -493,7 +491,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||||
swDupMsgId = view.findViewById(R.id.swDupMsgId);
|
swDupMsgId = view.findViewById(R.id.swDupMsgId);
|
||||||
swThreadByRef = view.findViewById(R.id.swThreadByRef);
|
swThreadByRef = view.findViewById(R.id.swThreadByRef);
|
||||||
swMdn = view.findViewById(R.id.swMdn);
|
swMdn = view.findViewById(R.id.swMdn);
|
||||||
swSkipActionMode = view.findViewById(R.id.swSkipActionMode);
|
|
||||||
etKeywords = view.findViewById(R.id.etKeywords);
|
etKeywords = view.findViewById(R.id.etKeywords);
|
||||||
swTestIab = view.findViewById(R.id.swTestIab);
|
swTestIab = view.findViewById(R.id.swTestIab);
|
||||||
btnImportProviders = view.findViewById(R.id.btnImportProviders);
|
btnImportProviders = view.findViewById(R.id.btnImportProviders);
|
||||||
|
@ -1860,13 +1857,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
swSkipActionMode.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
||||||
@Override
|
|
||||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
|
||||||
prefs.edit().putBoolean("skip_action_mode", checked).apply();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
etKeywords.addTextChangedListener(new TextWatcher() {
|
etKeywords.addTextChangedListener(new TextWatcher() {
|
||||||
@Override
|
@Override
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
@ -2613,7 +2603,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||||
swDupMsgId.setChecked(prefs.getBoolean("dup_msgids", false));
|
swDupMsgId.setChecked(prefs.getBoolean("dup_msgids", false));
|
||||||
swThreadByRef.setChecked(prefs.getBoolean("thread_byref", true));
|
swThreadByRef.setChecked(prefs.getBoolean("thread_byref", true));
|
||||||
swMdn.setChecked(prefs.getBoolean("mdn", swExperiments.isChecked()));
|
swMdn.setChecked(prefs.getBoolean("mdn", swExperiments.isChecked()));
|
||||||
swSkipActionMode.setChecked(prefs.getBoolean("skip_action_mode", false));
|
|
||||||
etKeywords.setText(prefs.getString("global_keywords", null));
|
etKeywords.setText(prefs.getString("global_keywords", null));
|
||||||
swTestIab.setChecked(prefs.getBoolean("test_iab", false));
|
swTestIab.setChecked(prefs.getBoolean("test_iab", false));
|
||||||
|
|
||||||
|
|
|
@ -2283,17 +2283,6 @@
|
||||||
app:layout_constraintTop_toBottomOf="@id/swThreadByRef"
|
app:layout_constraintTop_toBottomOf="@id/swThreadByRef"
|
||||||
app:switchPadding="12dp" />
|
app:switchPadding="12dp" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.SwitchCompat
|
|
||||||
android:id="@+id/swSkipActionMode"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="12dp"
|
|
||||||
android:text="@string/title_advanced_skip_action_mode"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/swMdn"
|
|
||||||
app:switchPadding="12dp" />
|
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/etKeywords"
|
android:id="@+id/etKeywords"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
@ -2304,7 +2293,7 @@
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/swSkipActionMode" />
|
app:layout_constraintTop_toBottomOf="@id/swMdn" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvKeywordsHint"
|
android:id="@+id/tvKeywordsHint"
|
||||||
|
|
|
@ -902,7 +902,6 @@
|
||||||
<string name="title_advanced_dup_msgid" translatable="false">Duplicates by message ID</string>
|
<string name="title_advanced_dup_msgid" translatable="false">Duplicates by message ID</string>
|
||||||
<string name="title_advanced_thread_by_ref" translatable="false">Thread by common reference</string>
|
<string name="title_advanced_thread_by_ref" translatable="false">Thread by common reference</string>
|
||||||
<string name="title_advanced_mdn" translatable="false">Process MDNs</string>
|
<string name="title_advanced_mdn" translatable="false">Process MDNs</string>
|
||||||
<string name="title_advanced_skip_action_mode" translatable="false">Skip action mode</string>
|
|
||||||
<string name="title_advanced_global_keywords" translatable="false">Global keywords</string>
|
<string name="title_advanced_global_keywords" translatable="false">Global keywords</string>
|
||||||
<string name="title_advanced_test_iab" translatable="false">Test IAB</string>
|
<string name="title_advanced_test_iab" translatable="false">Test IAB</string>
|
||||||
<string name="title_advanced_import_providers" translatable="false">Import providers</string>
|
<string name="title_advanced_import_providers" translatable="false">Import providers</string>
|
||||||
|
|
Loading…
Reference in New Issue