Using You background color

pull/214/head
M66B 1 year ago
parent 59bcce556c
commit 1f8aa6ce93

@ -627,16 +627,23 @@ public class FragmentDialogTheme extends FragmentDialogBase {
String theme = prefs.getString("theme", "blue_orange_system"); String theme = prefs.getString("theme", "blue_orange_system");
boolean dark = Helper.isDarkTheme(context); boolean dark = Helper.isDarkTheme(context);
boolean solarized = (theme != null && theme.startsWith("solarized")); boolean solarized = (theme != null && theme.startsWith("solarized"));
boolean you = (theme != null && theme.startsWith("you_"));
if (cards) { if (cards) {
if (compose) { if (you && Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
if (!dark || solarized) view.setBackgroundColor(ContextCompat.getColor(context, dark
view.setBackgroundColor(Helper.resolveColor(context, R.attr.colorCardBackground)); ? android.R.color.system_background_dark
} else { : android.R.color.system_background_light));
if (!dark && !solarized) else {
view.setBackgroundColor(ContextCompat.getColor(context, beige if (compose) {
? R.color.lightColorBackground_cards_beige if (!dark || solarized)
: R.color.lightColorBackground_cards)); view.setBackgroundColor(Helper.resolveColor(context, R.attr.colorCardBackground));
} else {
if (!dark && !solarized)
view.setBackgroundColor(ContextCompat.getColor(context, beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
}
} }
} else { } else {
if (tabular_card_bg) if (tabular_card_bg)

@ -0,0 +1,465 @@
<?xml version="1.0" encoding="utf-8"?>
<eu.faircode.email.ScrollViewEx xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fadeScrollbars="false"
android:padding="24dp"
android:scrollbarStyle="outsideOverlay">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<eu.faircode.email.FixedTextView
android:id="@+id/tvCaption"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:drawableEnd="@drawable/twotone_palette_24"
android:drawablePadding="6dp"
android:text="@string/title_setup_theme"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<RadioGroup
android:id="@+id/rgTheme"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvCaption">
<RadioButton
android:id="@+id/rbThemeBlueOrange"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp"
android:text="@string/title_setup_theme_blue_orange"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
<RadioButton
android:id="@+id/rbThemeRedGreen"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp"
android:text="@string/title_setup_theme_red_green"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
<RadioButton
android:id="@+id/rbThemeYellowPurple"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp"
android:text="@string/title_setup_theme_yellow_purple"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
<RadioButton
android:id="@+id/rbThemeGrey"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp"
android:text="@string/title_setup_theme_grey"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
<RadioButton
android:id="@+id/rbThemeSolarized"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp"
android:text="@string/title_setup_theme_solarized"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
<RadioButton
android:id="@+id/rbThemeBlackOrWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp"
android:text="@string/title_setup_theme_black_or_white"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
<RadioButton
android:id="@+id/rbThemeBlackAndWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp"
android:text="@string/title_setup_theme_black_and_white"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
<RadioButton
android:id="@+id/rbThemeYou"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp"
android:text="@string/title_setup_theme_you"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
<RadioButton
android:id="@+id/rbThemeYouMono"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp"
android:text="@string/title_setup_theme_you_mono"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
</RadioGroup>
<eu.faircode.email.FixedTextView
android:id="@+id/tvYou"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:drawableEnd="@drawable/twotone_settings_24"
android:drawablePadding="6dp"
android:text="@string/title_setup_theme_you_hint"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/rgTheme" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvBackgroundLight"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:background="@android:color/system_background_light"
android:gravity="center"
android:text="Light"
android:textColor="@android:color/system_neutral1_800"
app:layout_constraintEnd_toStartOf="@+id/tvYou200_2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvYou" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvBackgroundDark"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:background="@android:color/system_background_dark"
android:gravity="center"
android:text="Dark"
android:textColor="@android:color/system_neutral2_200"
app:layout_constraintEnd_toStartOf="@+id/tvBackgroundEnd"
app:layout_constraintStart_toEndOf="@+id/tvBackgroundLight"
app:layout_constraintTop_toBottomOf="@id/tvYou" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvBackgroundEnd"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:gravity="center"
android:text=""
android:textColor="@android:color/system_neutral1_200"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/tvBackgroundDark"
app:layout_constraintTop_toBottomOf="@id/tvYou" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvYou200_1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@android:color/system_accent1_200"
android:gravity="center"
android:text="1/200"
android:textColor="@android:color/system_neutral1_800"
app:layout_constraintEnd_toStartOf="@+id/tvYou200_2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvBackgroundLight" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvYou200_2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@android:color/system_accent2_200"
android:gravity="center"
android:text="2/200"
android:textColor="@android:color/system_neutral1_800"
app:layout_constraintEnd_toStartOf="@+id/tvYou200_3"
app:layout_constraintStart_toEndOf="@+id/tvYou200_1"
app:layout_constraintTop_toBottomOf="@id/tvBackgroundLight" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvYou200_3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@android:color/system_accent3_200"
android:gravity="center"
android:text="3/200"
android:textColor="@android:color/system_neutral2_800"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/tvYou200_2"
app:layout_constraintTop_toBottomOf="@id/tvBackgroundLight" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvYou500_1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@android:color/system_accent1_500"
android:gravity="center"
android:text="1/500"
android:textColor="@android:color/system_neutral1_100"
app:layout_constraintEnd_toStartOf="@+id/tvYou500_2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvYou200_1" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvYou500_2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@android:color/system_accent2_500"
android:gravity="center"
android:text="2/500"
android:textColor="@android:color/system_neutral1_100"
app:layout_constraintEnd_toStartOf="@+id/tvYou500_3"
app:layout_constraintStart_toEndOf="@+id/tvYou500_1"
app:layout_constraintTop_toBottomOf="@id/tvYou200_1" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvYou500_3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@android:color/system_accent3_500"
android:gravity="center"
android:text="3/500"
android:textColor="@android:color/system_neutral2_100"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/tvYou500_2"
app:layout_constraintTop_toBottomOf="@id/tvYou200_1" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvYou800_1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@android:color/system_accent1_800"
android:gravity="center"
android:text="1/800"
android:textColor="@android:color/system_neutral1_200"
app:layout_constraintEnd_toStartOf="@+id/tvYou800_2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvYou500_1" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvYou800_2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@android:color/system_accent2_800"
android:gravity="center"
android:text="2/800"
android:textColor="@android:color/system_neutral1_200"
app:layout_constraintEnd_toStartOf="@+id/tvYou800_3"
app:layout_constraintStart_toEndOf="@+id/tvYou800_1"
app:layout_constraintTop_toBottomOf="@id/tvYou500_1" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvYou800_3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@android:color/system_accent3_800"
android:gravity="center"
android:text="3/800"
android:textColor="@android:color/system_neutral2_200"
app:layout_constraintEnd_toEndOf="parent"
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:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/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:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/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:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/tvSecondary"
app:layout_constraintTop_toBottomOf="@id/tvYou800_3" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvNormal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Normal"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="normal"
app:layout_constraintEnd_toStartOf="@+id/tvItalic"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPrimary" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvItalic"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Italic"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="italic"
app:layout_constraintEnd_toStartOf="@+id/tvBold"
app:layout_constraintStart_toEndOf="@+id/tvNormal"
app:layout_constraintTop_toBottomOf="@id/tvSecondary" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvBold"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Bold"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/tvItalic"
app:layout_constraintTop_toBottomOf="@id/tvTertiary" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swReverse"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_setup_theme_reverse"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvNormal" />
<RadioGroup
android:id="@+id/rgThemeOptions"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swReverse">
<RadioButton
android:id="@+id/rbThemeLight"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp"
android:text="@string/title_setup_theme_light"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
<RadioButton
android:id="@+id/rbThemeDark"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp"
android:text="@string/title_setup_theme_dark"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
<RadioButton
android:id="@+id/rbThemeSystem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp"
android:text="@string/title_setup_theme_system"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
</RadioGroup>
<eu.faircode.email.FixedTextView
android:id="@+id/tvSystem"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/title_setup_theme_system_hint"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/rgThemeOptions" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swBlack"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_setup_theme_black_background"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvSystem" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swHtmlLight"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_setup_theme_html_light"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swBlack" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swComposerLight"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_setup_theme_composer_light"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swHtmlLight" />
<Button
android:id="@+id/btnMore"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:drawableEnd="@drawable/twotone_monitor_24"
android:drawablePadding="6dp"
android:text="@string/title_advanced_more"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swComposerLight" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvMore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:drawableEnd="@drawable/twotone_open_in_new_12"
android:drawablePadding="6dp"
android:drawableTint="?android:attr/textColorLink"
android:text="@string/title_setup_theme_more_colors"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
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,
tvNormal,tvItalic,tvBold" />
</androidx.constraintlayout.widget.ConstraintLayout>
</eu.faircode.email.ScrollViewEx>
Loading…
Cancel
Save