Skip to content

Commit

Permalink
Fixing alert dialog styling capability in material theme
Browse files Browse the repository at this point in the history
Currently, custom styling on alert dialogs can only be applied to apps using AppCompat base themes. This patch fills the gap by setting the attribute "materialAlertDialogTheme" in Shaky's base theme.
  • Loading branch information
Abhishek Nancherla Jagannatha authored and kahrendsen-li committed Jan 21, 2021
1 parent f354d4c commit 035e84d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion shaky-sample/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- LinkedIn Color theme -->
<!-- https://brand.linkedin.com/visual-identity/color-palettes -->
<item name="colorAccent">@color/blue</item>
Expand Down
1 change: 1 addition & 0 deletions shaky/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ dependencies {
api 'com.squareup:seismic:1.0.2'
implementation 'com.jraska:falcon:2.1.1'
implementation "androidx.appcompat:appcompat:1.0.0"
implementation "com.google.android.material:material:1.1.0"
implementation "androidx.recyclerview:recyclerview:1.0.0"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation "androidx.annotation:annotation:1.0.0"
Expand Down
1 change: 1 addition & 0 deletions shaky/src/main/res/values/shaky_styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
<!-- AlertDialog -->
<item name="shakyAlertDialogTheme">@style/ShakyBaseAlertDialogTheme</item>
<item name="alertDialogTheme">?attr/shakyAlertDialogTheme</item>
<item name="materialAlertDialogTheme">?attr/shakyAlertDialogTheme</item>
</style>

<style name="ShakyBasePopupTheme" parent="Theme.AppCompat.Light.Dialog.Alert">
Expand Down

0 comments on commit 035e84d

Please sign in to comment.