Implement dynamic material3 colors
This commit is contained in:
parent
cc89f398d7
commit
efe4c78cdb
@ -11,8 +11,8 @@ android {
|
|||||||
applicationId = "cz.bugsy.passwordzebra"
|
applicationId = "cz.bugsy.passwordzebra"
|
||||||
minSdk = 29
|
minSdk = 29
|
||||||
targetSdk = 34
|
targetSdk = 34
|
||||||
versionCode = 4
|
versionCode = 5
|
||||||
versionName = "1.3.1"
|
versionName = "1.4.0"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
<uses-permission android:name="MediaStore.createWriteRequest" />
|
<uses-permission android:name="MediaStore.createWriteRequest" />
|
||||||
<application
|
<application
|
||||||
|
android:name=".PasswordZebra"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||||
android:fullBackupContent="@xml/backup_rules"
|
android:fullBackupContent="@xml/backup_rules"
|
||||||
|
|||||||
12
app/src/main/java/cz/bugsy/passwordzebra/PasswordZebra.kt
Normal file
12
app/src/main/java/cz/bugsy/passwordzebra/PasswordZebra.kt
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package cz.bugsy.passwordzebra
|
||||||
|
|
||||||
|
import android.app.Application
|
||||||
|
import com.google.android.material.color.DynamicColors
|
||||||
|
|
||||||
|
class PasswordZebra : Application() {
|
||||||
|
override fun onCreate() {
|
||||||
|
// Apply dynamic color
|
||||||
|
//DynamicColors.applyToActivitiesIfAvailable(this)
|
||||||
|
DynamicColors.applyToActivitiesIfAvailable(this, R.style.AppTheme_Overlay)
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -37,7 +37,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:background="@drawable/password_background"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:padding="16dp"
|
android:padding="16dp"
|
||||||
android:text=""
|
android:text=""
|
||||||
@ -50,8 +49,8 @@
|
|||||||
android:id="@+id/passwordLengthLabel"
|
android:id="@+id/passwordLengthLabel"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="80dp"
|
android:layout_marginStart="72dp"
|
||||||
android:layout_marginBottom="104dp"
|
android:layout_marginBottom="96dp"
|
||||||
android:text="@string/textview_password_length"
|
android:text="@string/textview_password_length"
|
||||||
app:layout_constraintBottom_toTopOf="@id/switchWithoutSpaces"
|
app:layout_constraintBottom_toTopOf="@id/switchWithoutSpaces"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
@ -60,9 +59,11 @@
|
|||||||
android:id="@+id/passwordLengthPicker"
|
android:id="@+id/passwordLengthPicker"
|
||||||
android:layout_width="69dp"
|
android:layout_width="69dp"
|
||||||
android:layout_height="178dp"
|
android:layout_height="178dp"
|
||||||
|
android:layout_marginStart="81dp"
|
||||||
android:layout_marginEnd="72dp"
|
android:layout_marginEnd="72dp"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/switchWithoutSpaces"
|
app:layout_constraintBottom_toTopOf="@+id/switchWithoutSpaces"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/passwordLengthLabel"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintVertical_bias="0.953" />
|
app:layout_constraintVertical_bias="0.953" />
|
||||||
|
|
||||||
@ -89,12 +90,19 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="64dp"
|
android:layout_marginBottom="64dp"
|
||||||
android:backgroundTint="@color/design_default_color_secondary"
|
|
||||||
android:text="@string/generate_button_text"
|
android:text="@string/generate_button_text"
|
||||||
android:textColor="@android:color/white"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.498"
|
app:layout_constraintHorizontal_bias="0.498"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline
|
||||||
|
android:id="@+id/guideline"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintGuide_begin="20dp" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
|
||||||
<!-- Base application theme. -->
|
<resources>
|
||||||
<style name="Base.Theme.PasswordZebra" parent="Theme.Material3.DayNight.NoActionBar">
|
<style name="Theme.PasswordZebra" parent="Theme.Material3.DayNight.NoActionBar">
|
||||||
<!-- Customize your dark theme here. -->
|
|
||||||
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
|
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
4
app/src/main/res/values/attrs.xml.xml
Normal file
4
app/src/main/res/values/attrs.xml.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<resources>
|
||||||
|
<attr name="iconColor" format="color" />
|
||||||
|
</resources>
|
||||||
|
|
||||||
@ -1,5 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
<resources>
|
||||||
<color name="black">#FF000000</color>
|
<color name="green">#1B5E20</color>
|
||||||
<color name="white">#FFFFFFFF</color>
|
<color name="green_dark">#003300</color>
|
||||||
|
<color name="green_light">#A5D6A7</color>
|
||||||
|
<color name="blue">#0288D1</color>
|
||||||
|
<color name="blue_dark">#005B9F</color>
|
||||||
|
<color name="blue_light">#81D4FA</color>
|
||||||
|
<color name="black">#000000</color>
|
||||||
|
<color name="white">#FFFFFF</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>
|
</resources>
|
||||||
@ -1,9 +1,5 @@
|
|||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
|
||||||
<!-- Base application theme. -->
|
|
||||||
<style name="Base.Theme.PasswordZebra" parent="Theme.Material3.DayNight.NoActionBar">
|
|
||||||
<!-- Customize your light theme here. -->
|
|
||||||
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="Theme.PasswordZebra" parent="Base.Theme.PasswordZebra" />
|
<resources>
|
||||||
|
<style name="Theme.PasswordZebra" parent="Theme.Material3.Light.NoActionBar">
|
||||||
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
5
app/src/main/res/values/themes_overlays.xml.xml
Normal file
5
app/src/main/res/values/themes_overlays.xml.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<style name="AppTheme.Overlay" parent="ThemeOverlay.Material3.DynamicColors.DayNight">
|
||||||
|
<item name="iconColor">@android:color/system_accent2_600</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
||||||
Loading…
x
Reference in New Issue
Block a user