Refactoring

pull/207/head
M66B 3 years ago
parent 3d38ea79ca
commit 47e6c6a575

@ -117,8 +117,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private ImageButton ibChannelUpdated;
private SwitchCompat swCheckWeekly;
private SwitchCompat swChangelog;
private SwitchCompat swExperiments;
private TextView tvExperimentsHint;
private SwitchCompat swCrashReports;
private TextView tvUuid;
private Button btnReset;
@ -127,6 +125,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private TextView tvLastCleanup;
private CardView cardAdvanced;
private SwitchCompat swExperiments;
private TextView tvExperimentsHint;
private SwitchCompat swProtocol;
private SwitchCompat swLogInfo;
private SwitchCompat swDebug;
@ -206,8 +206,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"classification", "class_min_probability", "class_min_difference",
"language", "deepl_enabled", "watchdog",
"updates", "weekly", "show_changelog",
"experiments", "crash_reports", "cleanup_attachments",
"protocol", "log_level", "debug", "leak_canary", "test1", "test2", "test3", "test4", "test5",
"crash_reports", "cleanup_attachments",
"experiments", "protocol", "log_level", "debug", "leak_canary", "test1", "test2", "test3", "test4", "test5",
"work_manager", // "external_storage",
"query_threads", "wal", "sqlite_checkpoints", "sqlite_analyze", "sqlite_cache",
"chunk_size", "thread_range", "undo_manager", "webview_legacy", "browser_zoom",
@ -286,8 +286,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
ibChannelUpdated = view.findViewById(R.id.ibChannelUpdated);
swCheckWeekly = view.findViewById(R.id.swWeekly);
swChangelog = view.findViewById(R.id.swChangelog);
swExperiments = view.findViewById(R.id.swExperiments);
tvExperimentsHint = view.findViewById(R.id.tvExperimentsHint);
swCrashReports = view.findViewById(R.id.swCrashReports);
tvUuid = view.findViewById(R.id.tvUuid);
btnReset = view.findViewById(R.id.btnReset);
@ -296,6 +294,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
tvLastCleanup = view.findViewById(R.id.tvLastCleanup);
cardAdvanced = view.findViewById(R.id.cardAdvanced);
swExperiments = view.findViewById(R.id.swExperiments);
tvExperimentsHint = view.findViewById(R.id.tvExperimentsHint);
swProtocol = view.findViewById(R.id.swProtocol);
swLogInfo = view.findViewById(R.id.swLogInfo);
swDebug = view.findViewById(R.id.swDebug);
@ -645,21 +645,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
tvExperimentsHint.setPaintFlags(tvExperimentsHint.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
tvExperimentsHint.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Helper.viewFAQ(v.getContext(), 125);
}
});
swExperiments.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("experiments", checked).apply();
}
});
swCrashReports.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -692,6 +677,21 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
tvExperimentsHint.setPaintFlags(tvExperimentsHint.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
tvExperimentsHint.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Helper.viewFAQ(v.getContext(), 125);
}
});
swExperiments.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("experiments", checked).apply();
}
});
swProtocol.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -706,7 +706,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
swLogInfo.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {

@ -402,31 +402,6 @@
app:layout_constraintTop_toBottomOf="@id/swWeekly"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swExperiments"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_experiments"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swChangelog"
app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvExperimentsHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:drawableEnd="@drawable/twotone_open_in_new_12"
android:drawablePadding="6dp"
android:drawableTint="?android:attr/textColorLink"
android:text="@string/title_advanced_experiments_hint"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorLink"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swExperiments" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swCrashReports"
android:layout_width="0dp"
@ -435,7 +410,7 @@
android:text="@string/title_advanced_crash_reports"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvExperimentsHint"
app:layout_constraintTop_toBottomOf="@id/swChangelog"
app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView
@ -560,6 +535,31 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swExperiments"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_experiments"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvCaptionAdvanced"
app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvExperimentsHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:drawableEnd="@drawable/twotone_open_in_new_12"
android:drawablePadding="6dp"
android:drawableTint="?android:attr/textColorLink"
android:text="@string/title_advanced_experiments_hint"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorLink"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swExperiments" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swProtocol"
android:layout_width="0dp"
@ -570,7 +570,7 @@
android:text="@string/title_advanced_protocol"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvCaptionAdvanced"
app:layout_constraintTop_toBottomOf="@id/tvExperimentsHint"
app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView

Loading…
Cancel
Save