mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
Added debug card
This commit is contained in:
parent
784e9f5846
commit
3245dce63b
3 changed files with 44 additions and 24 deletions
|
@ -53,6 +53,7 @@ import androidx.annotation.NonNull;
|
|||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
|
@ -131,7 +132,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|||
private Button btnFiles;
|
||||
|
||||
private Group grpUpdates;
|
||||
private Group grpDebug;
|
||||
private CardView cardDebug;
|
||||
|
||||
private NumberFormat NF = NumberFormat.getNumberInstance();
|
||||
|
||||
|
@ -237,7 +238,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|||
btnFiles = view.findViewById(R.id.btnFiles);
|
||||
|
||||
grpUpdates = view.findViewById(R.id.grpUpdates);
|
||||
grpDebug = view.findViewById(R.id.grpDebug);
|
||||
cardDebug = view.findViewById(R.id.cardDebug);
|
||||
|
||||
setOptions();
|
||||
|
||||
|
@ -509,7 +510,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("debug", checked).apply();
|
||||
grpDebug.setVisibility(checked || BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
|
||||
cardDebug.setVisibility(checked || BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -981,7 +982,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|||
|
||||
tvFingerprint.setText(Helper.getFingerprint(getContext()));
|
||||
|
||||
grpDebug.setVisibility(swDebug.isChecked() || BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
|
||||
cardDebug.setVisibility(swDebug.isChecked() || BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
private void updateUsage() {
|
||||
|
|
|
@ -501,6 +501,43 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/swDebug" />
|
||||
|
||||
<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/cardDebug"
|
||||
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:padding="6dp">
|
||||
|
||||
<eu.faircode.email.FixedTextView
|
||||
android:id="@+id/tvCaptionDebug"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/title_advanced_caption_debug"
|
||||
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/swQueries"
|
||||
android:layout_width="0dp"
|
||||
|
@ -509,7 +546,7 @@
|
|||
android:text="@string/title_advanced_query_threads"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvDebugHint"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCaptionDebug"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<eu.faircode.email.FixedTextView
|
||||
|
@ -722,25 +759,6 @@
|
|||
android:text="@string/title_advanced_files"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnCiphers" />
|
||||
|
||||
<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/grpDebug"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:constraint_referenced_ids="
|
||||
swQueries,tvQueriesHint,tvQueriesRemark,swWal,
|
||||
swModSeq,swExpunge,
|
||||
swAuthPlain,swAuthLogin,swAuthNtlm,swAuthSasl,
|
||||
swExactAlarms,
|
||||
tvProcessors,tvMemoryClass,tvMemoryUsage,tvStorageUsage,
|
||||
tvFingerprint,
|
||||
btnGC,btnCharsets,btnCiphers,btnFiles" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
|
@ -363,6 +363,7 @@
|
|||
<string name="title_advanced_caption_message">Message</string>
|
||||
<string name="title_advanced_caption_message_header">Message header</string>
|
||||
<string name="title_advanced_caption_message_body">Message body</string>
|
||||
<string name="title_advanced_caption_debug" translatable="false">Debug</string>
|
||||
|
||||
<string name="title_advanced_portrait2">Use two rows in portrait mode</string>
|
||||
<string name="title_advanced_landscape">Use two columns in landscape mode</string>
|
||||
|
|
Loading…
Reference in a new issue