Skip to content

Commit

Permalink
App Material 3 Colors
Browse files Browse the repository at this point in the history
  • Loading branch information
SlaVcE14 committed May 29, 2022
1 parent 369f8a1 commit 6f3e462
Show file tree
Hide file tree
Showing 10 changed files with 164 additions and 31 deletions.
2 changes: 1 addition & 1 deletion SJDialog/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ android {
dependencies {

implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'com.google.android.material:material:1.6.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
Expand Down
2 changes: 1 addition & 1 deletion SJDialog/src/main/res/drawable/dialog_background.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/SJLibrary_main1"/>
<solid android:color="?colorSurface"/>
<corners android:radius="30dp"/>

</shape>
4 changes: 2 additions & 2 deletions SJDialog/src/main/res/drawable/ripple_button.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/white">
android:color="#ffffff">
<item android:id="@+id/mask">

<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/SJLibrary_Blue_1"/>
<solid android:color="?colorPrimaryContainer"/>
<corners android:radius="60dp"/>

</shape>
Expand Down
3 changes: 2 additions & 1 deletion SJDialog/src/main/res/layout/message_dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginHorizontal="10dp"
android:layout_marginTop="20dp"
android:layout_weight="1"
android:layout_marginHorizontal="10dp"
android:text="Title"
android:textColor="?colorOnSurface"
android:textAlignment="center"
android:textSize="25dp" />
<TextView
Expand Down
1 change: 1 addition & 0 deletions SJDialog/src/main/res/layout/popup_panel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
android:id="@+id/Btn1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

android:layout_marginEnd="10dp"
android:layout_weight="1"
android:autoSizeTextType="uniform"
Expand Down
11 changes: 0 additions & 11 deletions SJDialog/src/main/res/values-night/colors.xml

This file was deleted.

45 changes: 41 additions & 4 deletions SJDialog/src/main/res/values-night/themes.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.sjlibrary" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<resources>

<style name="Theme.sjlibrary" parent="Theme.Material3.DynamicColors.Dark">
<item name="colorPrimary">@color/md_theme_dark_primary</item>
<item name="colorOnPrimary">@color/md_theme_dark_onPrimary</item>
<item name="colorPrimaryContainer">@color/md_theme_dark_primaryContainer</item>
<item name="colorOnPrimaryContainer">@color/md_theme_dark_onPrimaryContainer</item>
<item name="colorSecondary">@color/md_theme_dark_secondary</item>
<item name="colorOnSecondary">@color/md_theme_dark_onSecondary</item>
<item name="colorSecondaryContainer">@color/md_theme_dark_secondaryContainer</item>
<item name="colorOnSecondaryContainer">@color/md_theme_dark_onSecondaryContainer</item>
<item name="colorTertiary">@color/md_theme_dark_tertiary</item>
<item name="colorOnTertiary">@color/md_theme_dark_onTertiary</item>
<item name="colorTertiaryContainer">@color/md_theme_dark_tertiaryContainer</item>
<item name="colorOnTertiaryContainer">@color/md_theme_dark_onTertiaryContainer</item>
<item name="colorError">@color/md_theme_dark_error</item>
<item name="colorErrorContainer">@color/md_theme_dark_errorContainer</item>
<item name="colorOnError">@color/md_theme_dark_onError</item>
<item name="colorOnErrorContainer">@color/md_theme_dark_onErrorContainer</item>
<item name="android:colorBackground">@color/md_theme_dark_background</item>
<item name="colorOnBackground">@color/md_theme_dark_onBackground</item>
<item name="colorSurface">@color/md_theme_dark_surface</item>
<item name="colorOnSurface">@color/md_theme_dark_onSurface</item>
<item name="colorSurfaceVariant">@color/md_theme_dark_surfaceVariant</item>
<item name="colorOnSurfaceVariant">@color/md_theme_dark_onSurfaceVariant</item>
<item name="colorOutline">@color/md_theme_dark_outline</item>
<item name="colorOnSurfaceInverse">@color/md_theme_dark_inverseOnSurface</item>
<item name="colorSurfaceInverse">@color/md_theme_dark_inverseSurface</item>
<!-- <item name="colorInversePrimary">@color/md_theme_dark_inversePrimary</item>-->
<!-- <item name="colorShadow">@color/md_theme_dark_shadow</item>-->
<item name="colorPrimaryInverse">@color/md_theme_dark_primaryInverse</item>

<item name="materialButtonStyle">@style/ButtonColor</item>
</style>

Expand All @@ -14,7 +43,15 @@
<item name="android:focusable">true</item>
<item name="android:clickable">true</item>
<item name="android:textAppearance">?android:attr/textAppearanceSmallInverse</item>
<item name="android:textColor">@android:color/primary_text_dark</item>
<item name="android:textColor">@color/md_theme_dark_onPrimaryContainer</item>
<item name="android:gravity">center_vertical|center_horizontal</item>
</style>

<style name="AppTheme.Overlay" parent="ThemeOverlay.Material3.DynamicColors.Dark">
<item name="colorPrimary">@color/overlay_light_primary</item>
<item name="colorOnPrimary">@color/overlay_light_onPrimary</item>
<item name="colorPrimaryContainer">@color/overlay_light_primaryContainer</item>
<item name="colorOnPrimaryContainer">@color/overlay_light_onPrimaryContainer</item>
</style>

</resources>
70 changes: 63 additions & 7 deletions SJDialog/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="SJLibrary_Blue_1">#0060f4</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="md_theme_light_primary">#0053DC</color>
<color name="md_theme_light_onPrimary">#FFFFFF</color>
<color name="md_theme_light_primaryContainer">#DAE2FF</color>
<color name="md_theme_light_onPrimaryContainer">#00174D</color>
<color name="md_theme_light_secondary">#585E71</color>
<color name="md_theme_light_onSecondary">#FFFFFF</color>
<color name="md_theme_light_secondaryContainer">#DCE1F9</color>
<color name="md_theme_light_onSecondaryContainer">#151B2C</color>
<color name="md_theme_light_tertiary">#433EF7</color>
<color name="md_theme_light_onTertiary">#FFFFFF</color>
<color name="md_theme_light_tertiaryContainer">#E1E0FF</color>
<color name="md_theme_light_onTertiaryContainer">#07006D</color>
<color name="md_theme_light_error">#BA1B1B</color>
<color name="md_theme_light_errorContainer">#FFDAD4</color>
<color name="md_theme_light_onError">#FFFFFF</color>
<color name="md_theme_light_onErrorContainer">#410001</color>
<color name="md_theme_light_background">#FEFBFF</color>
<color name="md_theme_light_onBackground">#1B1B1F</color>
<color name="md_theme_light_surface">#FEFBFF</color>
<color name="md_theme_light_onSurface">#1B1B1F</color>
<color name="md_theme_light_surfaceVariant">#E2E2EC</color>
<color name="md_theme_light_onSurfaceVariant">#44464E</color>
<color name="md_theme_light_outline">#75767F</color>
<color name="md_theme_light_inverseOnSurface">#F2F0F5</color>
<color name="md_theme_light_inverseSurface">#303033</color>
<color name="md_theme_light_inversePrimary">#B2C5FF</color>
<color name="md_theme_light_shadow">#000000</color>
<color name="md_theme_light_primaryInverse">#B2C5FF</color>
<color name="md_theme_dark_primary">#B2C5FF</color>
<color name="md_theme_dark_onPrimary">#002A79</color>
<color name="md_theme_dark_primaryContainer">#003EA9</color>
<color name="md_theme_dark_onPrimaryContainer">#DAE2FF</color>
<color name="md_theme_dark_secondary">#C1C6DD</color>
<color name="md_theme_dark_onSecondary">#2A3042</color>
<color name="md_theme_dark_secondaryContainer">#414659</color>
<color name="md_theme_dark_onSecondaryContainer">#DCE1F9</color>
<color name="md_theme_dark_tertiary">#C0C1FF</color>
<color name="md_theme_dark_onTertiary">#1200AA</color>
<color name="md_theme_dark_tertiaryContainer">#2510E1</color>
<color name="md_theme_dark_onTertiaryContainer">#E1E0FF</color>
<color name="md_theme_dark_error">#FFB4A9</color>
<color name="md_theme_dark_errorContainer">#930006</color>
<color name="md_theme_dark_onError">#680003</color>
<color name="md_theme_dark_onErrorContainer">#FFDAD4</color>
<color name="md_theme_dark_background">#1B1B1F</color>
<color name="md_theme_dark_onBackground">#E3E1E6</color>
<color name="md_theme_dark_surface">#1B1B1F</color>
<color name="md_theme_dark_onSurface">#E3E1E6</color>
<color name="md_theme_dark_surfaceVariant">#44464E</color>
<color name="md_theme_dark_onSurfaceVariant">#C6C6D0</color>
<color name="md_theme_dark_outline">#8F909A</color>
<color name="md_theme_dark_inverseOnSurface">#1B1B1F</color>
<color name="md_theme_dark_inverseSurface">#E3E1E6</color>
<color name="md_theme_dark_inversePrimary">#0053DC</color>
<color name="md_theme_dark_shadow">#000000</color>
<color name="md_theme_dark_primaryInverse">#0053DC</color>
<color name="seed">#0060F4</color>
<color name="error">#BA1B1B</color>
<color name="Custom0">#625FCD</color>

<color name="SJLibrary_main1">#E5E5E5</color>
<color name="SJLibrary_main2">#D5D5D5</color>

<color name="BtnClick">#BDBDBD</color>
<color name="overlay_light_primary">#9C4146</color>
<color name="overlay_light_onPrimary">#FFFFFF</color>
<color name= "overlay_light_primaryContainer">#FFDADB</color>
<color name="overlay_light_onPrimaryContainer">#400008</color>
</resources>
48 changes: 44 additions & 4 deletions SJDialog/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.sjlibrary" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<resources>

<style name="Theme.sjlibrary" parent="Theme.Material3.DynamicColors.Light">
<item name="colorPrimary">@color/md_theme_light_primary</item>
<item name="colorOnPrimary">@color/md_theme_light_onPrimary</item>
<item name="colorPrimaryContainer">@color/md_theme_light_primaryContainer</item>
<item name="colorOnPrimaryContainer">@color/md_theme_light_onPrimaryContainer</item>
<item name="colorSecondary">@color/md_theme_light_secondary</item>
<item name="colorOnSecondary">@color/md_theme_light_onSecondary</item>
<item name="colorSecondaryContainer">@color/md_theme_light_secondaryContainer</item>
<item name="colorOnSecondaryContainer">@color/md_theme_light_onSecondaryContainer</item>
<item name="colorTertiary">@color/md_theme_light_tertiary</item>
<item name="colorOnTertiary">@color/md_theme_light_onTertiary</item>
<item name="colorTertiaryContainer">@color/md_theme_light_tertiaryContainer</item>
<item name="colorOnTertiaryContainer">@color/md_theme_light_onTertiaryContainer</item>
<item name="colorError">@color/md_theme_light_error</item>
<item name="colorErrorContainer">@color/md_theme_light_errorContainer</item>
<item name="colorOnError">@color/md_theme_light_onError</item>
<item name="colorOnErrorContainer">@color/md_theme_light_onErrorContainer</item>
<item name="android:colorBackground">@color/md_theme_light_background</item>
<item name="colorOnBackground">@color/md_theme_light_onBackground</item>
<item name="colorSurface">@color/md_theme_light_surface</item>
<item name="colorOnSurface">@color/md_theme_light_onSurface</item>
<item name="colorSurfaceVariant">@color/md_theme_light_surfaceVariant</item>
<item name="colorOnSurfaceVariant">@color/md_theme_light_onSurfaceVariant</item>
<item name="colorOutline">@color/md_theme_light_outline</item>
<item name="colorOnSurfaceInverse">@color/md_theme_light_inverseOnSurface</item>
<item name="colorSurfaceInverse">@color/md_theme_light_inverseSurface</item>
<!-- <item name="colorInversePrimary">@color/md_theme_light_inversePrimary</item>-->
<!-- <item name="colorShadow">@color/md_theme_light_shadow</item>-->
<item name="colorPrimaryInverse">@color/md_theme_light_primaryInverse</item>

<item name="materialButtonStyle">@style/ButtonColor</item>
</style>

Expand All @@ -14,7 +43,18 @@
<item name="android:focusable">true</item>
<item name="android:clickable">true</item>
<item name="android:textAppearance">?android:attr/textAppearanceSmallInverse</item>
<item name="android:textColor">@android:color/primary_text_dark</item>
<item name="android:textColor">@color/md_theme_light_onPrimaryContainer</item>
<item name="android:gravity">center_vertical|center_horizontal</item>
</style>
<!-- <style name="Theme.sjlibrary.ButtonColor" parent="@android:style/Widget.Button">-->
<!-- <item name="android:background">@drawable/ripple_button</item>-->

<!-- </style>-->

<style name="AppTheme.Overlay" parent="ThemeOverlay.Material3.DynamicColors.Light">
<item name="colorPrimary">@color/overlay_light_primary</item>
<item name="colorOnPrimary">@color/overlay_light_onPrimary</item>
<item name="colorPrimaryContainer">@color/overlay_light_primaryContainer</item>
<item name="colorOnPrimaryContainer">@color/overlay_light_onPrimaryContainer</item>
</style>
</resources>
9 changes: 9 additions & 0 deletions SJDialog/src/main/res/values/themes_overlay.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme.Overlay" parent="ThemeOverlay.Material3.DynamicColors.Light">
<item name="colorPrimary">@color/overlay_light_primary</item>
<item name="colorOnPrimary">@color/overlay_light_onPrimary</item>
<item name="colorPrimaryContainer">@color/overlay_light_primaryContainer</item>
<item name="colorOnPrimaryContainer">@color/overlay_light_onPrimaryContainer</item>
</style>
</resources>

0 comments on commit 6f3e462

Please sign in to comment.