Added misc/advanced card

pull/207/head
M66B 3 years ago
parent 08f8ad4d15
commit f741ff886b

@ -697,6 +697,21 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
swProtocol.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("protocol", checked).apply();
if (checked)
prefs.edit()
.putLong("protocol_since", new Date().getTime())
.putInt("log_level", android.util.Log.INFO)
.apply();
else
EntityLog.clear(compoundButton.getContext());
}
});
swLogInfo.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -1004,17 +1019,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
swProtocol.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("protocol", checked).apply();
if (checked)
prefs.edit().putLong("protocol_since", new Date().getTime()).apply();
else
EntityLog.clear(compoundButton.getContext());
}
});
swUndoManager.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {

@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M19,3H5C3.9,3 3,3.9 3,5v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2V5C21,3.9 20.1,3 19,3zM7.68,14.98H6V9h1.71c1.28,0 1.71,1.03 1.71,1.71l0,2.56C9.42,13.95 9,14.98 7.68,14.98zM12.38,11.46v1.07h-1.18v1.39h1.93v1.07h-2.25c-0.4,0.01 -0.74,-0.31 -0.75,-0.71V9.75c-0.01,-0.4 0.31,-0.74 0.71,-0.75h2.28l0,1.07h-1.92v1.39H12.38zM16.88,14.23c-0.48,1.11 -1.33,0.89 -1.71,0L13.77,9h1.18l1.07,4.11L17.09,9h1.18L16.88,14.23z"/>
<path
android:fillColor="@android:color/white"
android:pathData="M7.77,10.12H7.14v3.77h0.63c0.14,0 0.28,-0.05 0.42,-0.16c0.14,-0.1 0.21,-0.26 0.21,-0.47v-2.52c0,-0.21 -0.07,-0.37 -0.21,-0.47C8.05,10.17 7.91,10.12 7.77,10.12z"/>
</vector>

@ -533,15 +533,55 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvCleanupHint" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpUpdates"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="swUpdates,swWeekly" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/cardAdvanced"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="3dp"
android:layout_marginTop="12dp"
app:cardBackgroundColor="?attr/colorCardBackground"
app:cardCornerRadius="6dp"
app:cardElevation="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cardGeneral">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="6dp"
android:paddingVertical="12dp">
<eu.faircode.email.FixedTextView
android:id="@+id/tvCaptionAdvanced"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/title_setup_advanced"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swProtocol"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:drawableStart="@drawable/twotone_list_alt_24"
android:drawablePadding="6dp"
android:text="@string/title_advanced_protocol"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvLastCleanup"
app:layout_constraintTop_toBottomOf="@id/tvCaptionAdvanced"
app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView
@ -562,6 +602,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:drawableStart="@drawable/twotone_bug_report_24"
android:drawablePadding="6dp"
android:text="@string/title_advanced_log_info"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@ -573,6 +615,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:drawableStart="@drawable/twotone_logo_dev_24"
android:drawablePadding="6dp"
android:text="@string/title_advanced_debug"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@ -652,12 +696,6 @@
app:layout_constraintTop_toBottomOf="@id/swTest4"
app:switchPadding="12dp" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpUpdates"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="swUpdates,swWeekly" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpTest"
android:layout_width="0dp"
@ -678,7 +716,7 @@
app:cardElevation="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cardGeneral">
app:layout_constraintTop_toBottomOf="@id/cardAdvanced">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"

Loading…
Cancel
Save