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( Salamence(
themeName = "Salamence", themeName = "Salamence",
themeRes = R.style.ThemeFoundationMD2_Salamence themeRes = R.style.ThemeFoundationMD2_Salamence
),
Fraxure(
themeName = "Fraxure (Legacy)",
themeRes = R.style.ThemeFoundationMD2_Fraxure
); );
val isSelected get() = Config.themeOrdinal == ordinal val isSelected get() = Config.themeOrdinal == ordinal

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android" <layout xmlns:android="http://schemas.android.com/apk/res/android">
xmlns:app="http://schemas.android.com/apk/res-auto">
<data> <data>
@ -22,7 +21,7 @@
android:paddingEnd="@dimen/l1" android:paddingEnd="@dimen/l1"
android:paddingBottom="@{viewModel.insets.bottom + (int) @dimen/l1}"> android:paddingBottom="@{viewModel.insets.bottom + (int) @dimen/l1}">
<androidx.constraintlayout.widget.ConstraintLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:columnCount="2" android:columnCount="2"
@ -30,132 +29,124 @@
android:useDefaultMargins="true"> android:useDefaultMargins="true">
<include <include
item="@{viewModel.themeHeadline}"
android:id="@+id/theme_card_dark" android:id="@+id/theme_card_dark"
item="@{viewModel.themeHeadline}"
layout="@layout/item_tappable_headline" layout="@layout/item_tappable_headline"
listener="@{viewModel}" /> listener="@{viewModel}" />
<FrameLayout <LinearLayout style="@style/W.Theme.Container">
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">
<include <FrameLayout
layout="@layout/item_theme" android:id="@+id/theme_default"
theme="@{Theme.Piplup}" style="@style/W.Theme.Left"
viewModel="@{viewModel}" /> android:theme="@style/ThemeFoundationMD2.Piplup">
</FrameLayout> <include
layout="@layout/item_theme"
theme="@{Theme.Piplup}"
viewModel="@{viewModel}" />
<FrameLayout </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">
<include <FrameLayout
layout="@layout/item_theme" android:id="@+id/theme_amoled"
theme="@{Theme.PiplupAmoled}" style="@style/W.Theme.Right"
viewModel="@{viewModel}" /> android:theme="@style/ThemeFoundationMD2.Amoled">
</FrameLayout> <include
layout="@layout/item_theme"
theme="@{Theme.PiplupAmoled}"
viewModel="@{viewModel}" />
<FrameLayout </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">
<include </LinearLayout>
layout="@layout/item_theme"
theme="@{Theme.Rayquaza}"
viewModel="@{viewModel}" />
</FrameLayout> <LinearLayout style="@style/W.Theme.Container">
<FrameLayout <FrameLayout
android:id="@+id/theme_zapdos" android:id="@+id/theme_rayquaza"
android:layout_width="0dp" style="@style/W.Theme.Left"
android:layout_height="wrap_content" android:theme="@style/ThemeFoundationMD2.Rayquaza">
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">
<include <include
layout="@layout/item_theme" layout="@layout/item_theme"
theme="@{Theme.Zapdos}" theme="@{Theme.Rayquaza}"
viewModel="@{viewModel}" /> viewModel="@{viewModel}" />
</FrameLayout> </FrameLayout>
<FrameLayout <FrameLayout
android:id="@+id/theme_charmeleon" android:id="@+id/theme_zapdos"
android:layout_width="0dp" style="@style/W.Theme.Right"
android:layout_height="wrap_content" android:theme="@style/ThemeFoundationMD2.Zapdos">
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">
<include <include
layout="@layout/item_theme" layout="@layout/item_theme"
theme="@{Theme.Charmeleon}" theme="@{Theme.Zapdos}"
viewModel="@{viewModel}" /> viewModel="@{viewModel}" />
</FrameLayout> </FrameLayout>
<FrameLayout </LinearLayout>
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">
<include <LinearLayout style="@style/W.Theme.Container">
layout="@layout/item_theme"
theme="@{Theme.Mew}"
viewModel="@{viewModel}" />
</FrameLayout> <FrameLayout
android:id="@+id/theme_charmeleon"
style="@style/W.Theme.Left"
android:theme="@style/ThemeFoundationMD2.Charmeleon">
<FrameLayout <include
android:id="@+id/theme_salamence" layout="@layout/item_theme"
android:layout_width="0dp" theme="@{Theme.Charmeleon}"
android:layout_height="wrap_content" viewModel="@{viewModel}" />
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">
<include </FrameLayout>
layout="@layout/item_theme"
theme="@{Theme.Salamence}"
viewModel="@{viewModel}" />
</FrameLayout> <FrameLayout
android:id="@+id/theme_mew"
style="@style/W.Theme.Right"
android:theme="@style/ThemeFoundationMD2.Mew">
</androidx.constraintlayout.widget.ConstraintLayout> <include
layout="@layout/item_theme"
theme="@{Theme.Mew}"
viewModel="@{viewModel}" />
</FrameLayout>
</LinearLayout>
<LinearLayout style="@style/W.Theme.Container">
<FrameLayout
android:id="@+id/theme_salamence"
style="@style/W.Theme.Left"
android:theme="@style/ThemeFoundationMD2.Salamence">
<include
layout="@layout/item_theme"
theme="@{Theme.Salamence}"
viewModel="@{viewModel}" />
</FrameLayout>
<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> </androidx.core.widget.NestedScrollView>

View File

@ -3,6 +3,8 @@
<style name="W" parent="android:Widget" /> <style name="W" parent="android:Widget" />
<!--region Home-->
<style name="W.Home" /> <style name="W.Home" />
<style name="W.Home.Extra" /> <style name="W.Home.Extra" />
@ -26,4 +28,30 @@
<item name="android:singleLine">true</item> <item name="android:singleLine">true</item>
</style> </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> </resources>

View File

@ -113,6 +113,13 @@
<item name="colorOnPrimaryVariant">#D9222222</item> <item name="colorOnPrimaryVariant">#D9222222</item>
</style> </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--> <!--3rd party themes-->
</resources> </resources>