Added text color debugging

This commit is contained in:
M66B 2022-01-05 19:55:15 +01:00
parent e675c0e9de
commit a8dbd2bc25
2 changed files with 50 additions and 1 deletions

View File

@ -21,6 +21,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.SwitchCompat;
import androidx.constraintlayout.widget.Group;
import androidx.core.content.ContextCompat;
import androidx.preference.PreferenceManager;
@ -36,6 +37,7 @@ public class FragmentDialogTheme extends FragmentDialogBase {
private SwitchCompat swComposerLight;
private Button btnMore;
private TextView tvMore;
private Group grpDebug;
private void eval() {
int checkedId = rgTheme.getCheckedRadioButtonId();
@ -73,6 +75,7 @@ public class FragmentDialogTheme extends FragmentDialogBase {
String theme = prefs.getString("theme", "blue_orange_system");
boolean default_light = prefs.getBoolean("default_light", false);
boolean composer_light = prefs.getBoolean("composer_light", false);
boolean debug = prefs.getBoolean("debug", false);
View dview = LayoutInflater.from(context).inflate(R.layout.dialog_theme, null);
rgTheme = dview.findViewById(R.id.rgTheme);
@ -86,6 +89,7 @@ public class FragmentDialogTheme extends FragmentDialogBase {
swComposerLight = dview.findViewById(R.id.swComposerLight);
btnMore = dview.findViewById(R.id.btnMore);
tvMore = dview.findViewById(R.id.tvMore);
grpDebug = dview.findViewById(R.id.grpDebug);
rgTheme.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
@ -240,6 +244,9 @@ public class FragmentDialogTheme extends FragmentDialogBase {
}
});
if (grpDebug != null)
grpDebug.setVisibility(debug || BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
return new AlertDialog.Builder(getContext())
.setView(dview)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {

View File

@ -222,6 +222,38 @@
app:layout_constraintStart_toEndOf="@+id/tvYou800_2"
app:layout_constraintTop_toBottomOf="@id/tvYou500_1" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvPrimary"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Primary"
android:textColor="?android:textColorPrimary"
app:layout_constraintEnd_toStartOf="@+id/tvSecondary"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvYou800_3" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvSecondary"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Secondary"
android:textColor="?android:textColorSecondary"
app:layout_constraintEnd_toStartOf="@+id/tvTertiary"
app:layout_constraintStart_toEndOf="@+id/tvPrimary"
app:layout_constraintTop_toBottomOf="@id/tvYou800_3" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvTertiary"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Tertiary"
android:textColor="?android:textColorTertiary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/tvSecondary"
app:layout_constraintTop_toBottomOf="@id/tvYou800_3" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swReverse"
@ -231,7 +263,7 @@
android:text="@string/title_setup_theme_reverse"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvYou800_1" />
app:layout_constraintTop_toBottomOf="@id/tvPrimary" />
<RadioGroup
android:id="@+id/rgThemeOptions"
@ -334,5 +366,15 @@
android:textColor="?android:attr/textColorLink"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnMore" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpDebug"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="
tvYou200_1,tvYou200_2,tvYou200_3,
tvYou500_1,tvYou500_2,tvYou500_3,
tvYou800_1,tvYou800_2,tvYou800_3,
tvPrimary,tvSecondary,tvTertiary" />
</androidx.constraintlayout.widget.ConstraintLayout>
</eu.faircode.email.ScrollViewEx>