Added legacy theme (Fraxure)

Theme is, in color, identical to legacy colors.
This commit is contained in:
Viktor De Pasquale 2020-01-30 16:57:21 +01:00 committed by John Wu
parent 6e48294f2a
commit 1ba9faf35b
4 changed files with 134 additions and 104 deletions

View File

@ -35,6 +35,10 @@ enum class Theme(
Salamence(
themeName = "Salamence",
themeRes = R.style.ThemeFoundationMD2_Salamence
),
Fraxure(
themeName = "Fraxure (Legacy)",
themeRes = R.style.ThemeFoundationMD2_Fraxure
);
val isSelected get() = Config.themeOrdinal == ordinal

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
@ -22,7 +21,7 @@
android:paddingEnd="@dimen/l1"
android:paddingBottom="@{viewModel.insets.bottom + (int) @dimen/l1}">
<androidx.constraintlayout.widget.ConstraintLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="2"
@ -30,21 +29,17 @@
android:useDefaultMargins="true">
<include
item="@{viewModel.themeHeadline}"
android:id="@+id/theme_card_dark"
item="@{viewModel.themeHeadline}"
layout="@layout/item_tappable_headline"
listener="@{viewModel}" />
<LinearLayout style="@style/W.Theme.Container">
<FrameLayout
android:id="@+id/theme_default"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/l1"
android:layout_marginEnd="@dimen/l1"
android:theme="@style/ThemeFoundationMD2.Piplup"
app:layout_constraintEnd_toStartOf="@+id/theme_amoled"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/theme_card_dark">
style="@style/W.Theme.Left"
android:theme="@style/ThemeFoundationMD2.Piplup">
<include
layout="@layout/item_theme"
@ -55,13 +50,8 @@
<FrameLayout
android:id="@+id/theme_amoled"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/l1"
android:theme="@style/ThemeFoundationMD2.Amoled"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/theme_default"
app:layout_constraintTop_toBottomOf="@+id/theme_card_dark">
style="@style/W.Theme.Right"
android:theme="@style/ThemeFoundationMD2.Amoled">
<include
layout="@layout/item_theme"
@ -70,15 +60,14 @@
</FrameLayout>
</LinearLayout>
<LinearLayout style="@style/W.Theme.Container">
<FrameLayout
android:id="@+id/theme_rayquaza"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/l1"
android:theme="@style/ThemeFoundationMD2.Rayquaza"
app:layout_constraintEnd_toEndOf="@+id/theme_default"
app:layout_constraintStart_toStartOf="@+id/theme_default"
app:layout_constraintTop_toBottomOf="@+id/theme_default">
style="@style/W.Theme.Left"
android:theme="@style/ThemeFoundationMD2.Rayquaza">
<include
layout="@layout/item_theme"
@ -89,13 +78,8 @@
<FrameLayout
android:id="@+id/theme_zapdos"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/l1"
android:theme="@style/ThemeFoundationMD2.Zapdos"
app:layout_constraintEnd_toEndOf="@+id/theme_amoled"
app:layout_constraintStart_toStartOf="@+id/theme_amoled"
app:layout_constraintTop_toBottomOf="@+id/theme_amoled">
style="@style/W.Theme.Right"
android:theme="@style/ThemeFoundationMD2.Zapdos">
<include
layout="@layout/item_theme"
@ -104,15 +88,14 @@
</FrameLayout>
</LinearLayout>
<LinearLayout style="@style/W.Theme.Container">
<FrameLayout
android:id="@+id/theme_charmeleon"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/l1"
android:theme="@style/ThemeFoundationMD2.Charmeleon"
app:layout_constraintEnd_toEndOf="@+id/theme_rayquaza"
app:layout_constraintStart_toStartOf="@+id/theme_rayquaza"
app:layout_constraintTop_toBottomOf="@+id/theme_rayquaza">
style="@style/W.Theme.Left"
android:theme="@style/ThemeFoundationMD2.Charmeleon">
<include
layout="@layout/item_theme"
@ -123,13 +106,8 @@
<FrameLayout
android:id="@+id/theme_mew"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/l1"
android:theme="@style/ThemeFoundationMD2.Mew"
app:layout_constraintEnd_toEndOf="@+id/theme_zapdos"
app:layout_constraintStart_toStartOf="@+id/theme_zapdos"
app:layout_constraintTop_toBottomOf="@+id/theme_zapdos">
style="@style/W.Theme.Right"
android:theme="@style/ThemeFoundationMD2.Mew">
<include
layout="@layout/item_theme"
@ -138,15 +116,14 @@
</FrameLayout>
</LinearLayout>
<LinearLayout style="@style/W.Theme.Container">
<FrameLayout
android:id="@+id/theme_salamence"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/l1"
android:theme="@style/ThemeFoundationMD2.Salamence"
app:layout_constraintEnd_toEndOf="@+id/theme_charmeleon"
app:layout_constraintStart_toStartOf="@+id/theme_charmeleon"
app:layout_constraintTop_toBottomOf="@+id/theme_charmeleon">
style="@style/W.Theme.Left"
android:theme="@style/ThemeFoundationMD2.Salamence">
<include
layout="@layout/item_theme"
@ -155,7 +132,21 @@
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<FrameLayout
android:id="@+id/theme_fraxure"
style="@style/W.Theme.Right"
android:theme="@style/ThemeFoundationMD2.Fraxure">
<include
layout="@layout/item_theme"
theme="@{Theme.Fraxure}"
viewModel="@{viewModel}" />
</FrameLayout>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View File

@ -3,6 +3,8 @@
<style name="W" parent="android:Widget" />
<!--region Home-->
<style name="W.Home" />
<style name="W.Home.Extra" />
@ -26,4 +28,30 @@
<item name="android:singleLine">true</item>
</style>
<!--endregion-->
<!--region Themes-->
<style name="W.Theme">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginTop">@dimen/l1</item>
<item name="android:layout_weight">1</item>
</style>
<style name="W.Theme.Left">
<item name="android:layout_marginEnd">@dimen/l1</item>
</style>
<style name="W.Theme.Right" />
<style name="W.Theme.Container" parent="Empty">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">match_parent</item>
<item name="android:orientation">horizontal</item>
<item name="android:baselineAligned">false</item>
</style>
<!--endregion-->
</resources>

View File

@ -113,6 +113,13 @@
<item name="colorOnPrimaryVariant">#D9222222</item>
</style>
<style name="ThemeFoundationMD2.Fraxure" parent="ThemeFoundationMD2.Amoled">
<item name="colorPrimary">#009688</item>
<item name="colorPrimaryVariant">#8000796B</item>
<item name="colorSecondary">#D50000</item>
<item name="colorSecondaryVariant">#806D1111</item>
</style>
<!--3rd party themes-->
</resources>