Add Color Theme

This commit is contained in:
icewithcola 2024-06-02 10:28:58 +08:00
parent b781948911
commit 2418dfcac2
7 changed files with 29 additions and 37 deletions

View file

@ -12,8 +12,8 @@ android {
applicationId = "uk.kagurach.android101"
minSdk = 31
targetSdk = 34
versionCode = 158
versionName = "1.5.8"
versionCode = 159
versionName = "1.5.9"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

View file

@ -52,7 +52,7 @@
android:layout_weight="1"
android:text="@string/next_page"
android:enabled="false"
android:backgroundTint="#4DB6AC" />
android:backgroundTint="?colorSecondary" />

View file

@ -109,6 +109,7 @@
android:layout_weight="1"
android:onClick="setUnit_sp"
android:layout_marginStart="5dp"
android:backgroundTint="?colorPrimary"
android:text="70sp" />
<Button
@ -118,6 +119,7 @@
android:layout_weight="1"
android:onClick="setUnit_dp"
android:layout_marginHorizontal="10dp"
android:backgroundTint="?colorSecondary"
android:text="70dp" />
<Button
@ -127,6 +129,7 @@
android:layout_weight="1"
android:onClick="setUnit_px"
android:text="70px"
android:backgroundTint="?colorTertiary"
tools:ignore="PxUsage" />
</LinearLayout>
@ -251,6 +254,7 @@
android:layout_weight="1"
android:layout_marginStart="20dp"
android:text="@string/test_color"
android:backgroundTint="?colorPrimary"
android:textAllCaps="false"/>
@ -262,6 +266,7 @@
android:layout_weight="1"
android:text="@string/set_color"
android:textAllCaps="false"
android:backgroundTint="?colorTertiary"
android:onClick="setColor"/>
</LinearLayout>
</LinearLayout>
@ -301,6 +306,7 @@
android:layout_marginStart="30dp"
android:onClick="setSize"
android:textAllCaps="false"
android:backgroundTint="?colorTertiary"
android:text="@string/set" />
</LinearLayout>

View file

@ -77,7 +77,7 @@
android:layout_marginHorizontal="10dp"
android:layout_height="match_parent"
android:id="@+id/P4Vibrate"
android:backgroundTint="#7E57C2"
android:backgroundTint="?colorTertiary"
android:text="@string/vibrate"
/>

View file

@ -93,14 +93,14 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="15dp"
android:backgroundTint="#D50000"
android:backgroundTint="?colorTertiary"
android:text="@string/clean_data"/>
<Button
android:id="@+id/P5QueryButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="15dp"
android:backgroundTint="#9FA8DA"
android:backgroundTint="?colorSecondary"
android:text="@string/query"/>
<Button
android:id="@+id/P5NextPage"

View file

@ -61,7 +61,7 @@
android:layout_height="40dp"
android:layout_marginVertical="15dp"
android:layout_marginStart="30dp"
android:background="#E53935"
android:background="#E57373"
android:contentDescription="@string/add" />
<ImageButton

View file

@ -1,14 +1,12 @@
<resources>
<!-- Base application theme. -->
<style name="Theme.Android101" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">#039BE5</item>
<item name="colorPrimaryVariant">#D500F9</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/black</item>
<item name="colorSecondaryVariant">@color/black</item>
<item name="colorOnSecondary">@color/black</item>
<item name="colorSecondary">#03e5bf</item>
<item name="colorTertiary">#e5039a</item>
<!-- Status bar color. -->
<item name="overlapAnchor">false</item>
<item name="android:dropDownVerticalOffset">?attr/actionBarSize</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">#0D47A1</item>
<!-- Customize your theme here. -->
@ -19,8 +17,8 @@
<style name="Theme.Blue" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<item name="colorPrimary">#039BE5</item>
<item name="colorSecondary">#1976D2</item>
<item name="colorSecondaryVariant">#81D4FA</item>
<item name="colorSecondary">#03e5bf</item>
<item name="colorTertiary">#e5039a</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">#0D47A1</item>
<item name="overlapAnchor">false</item>
@ -29,21 +27,17 @@
<style name="Theme.Green" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<item name="colorPrimary">#43A047</item>
<item name="colorSecondary">#388E3C</item>
<item name="colorSecondaryVariant">#A5D6A7</item>
<item name="colorSecondary">#a0439b</item>
<item name="colorTertiary">#439ba0</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">#0D47A1</item>
<item name="overlapAnchor">false</item>
<item name="android:dropDownVerticalOffset">?attr/actionBarSize</item>
</style>
<style name="Theme.Red" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<item name="colorPrimary">#E53935</item>
<item name="colorPrimaryVariant">#D500F9</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/black</item>
<item name="colorSecondaryVariant">@color/black</item>
<item name="colorOnSecondary">@color/black</item>
<item name="colorPrimary">#E57373</item>
<item name="colorSecondary">#e573ac</item>
<item name="colorTertiary">#73e573</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">#0D47A1</item>
<item name="overlapAnchor">false</item>
@ -51,12 +45,8 @@
</style>
<style name="Theme.Cyan" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<item name="colorPrimary">#00ACC1</item>
<item name="colorPrimaryVariant">#D500F9</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/black</item>
<item name="colorSecondaryVariant">@color/black</item>
<item name="colorOnSecondary">@color/black</item>
<item name="colorSecondary">#00c177</item>
<item name="colorTertiary">#c100aa</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">#0D47A1</item>
<item name="overlapAnchor">false</item>
@ -64,12 +54,8 @@
</style>
<style name="Theme.Pink" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<item name="colorPrimary">#FF80AB</item>
<item name="colorPrimaryVariant">#D500F9</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/black</item>
<item name="colorSecondaryVariant">@color/black</item>
<item name="colorOnSecondary">@color/black</item>
<item name="colorSecondary">#ff80ea</item>
<item name="colorTertiary">#ffb51f</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">#0D47A1</item>
<item name="overlapAnchor">false</item>