Skip to content

Commit

Permalink
Make dialog buttons rounded cornered
Browse files Browse the repository at this point in the history
  • Loading branch information
avazirna committed Dec 6, 2024
1 parent 322e1aa commit 4ac0f10
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
11 changes: 11 additions & 0 deletions app/res/drawable/rounded_button_shape.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >

<size
android:minHeight="@dimen/min_button_height">
</size>

<corners android:radius="@dimen/rounded_button_corner_radius"/>
</shape>
2 changes: 2 additions & 0 deletions app/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
<dimen name="standard_spacer_large">24dp</dimen>
<dimen name="standard_title_margin_bottom">20dp</dimen>
<dimen name="min_button_height">52dp</dimen>
<dimen name="min_button_width">88dp</dimen>
<dimen name="rounded_button_corner_radius">22dp</dimen>
<dimen name="spacer">10dp</dimen>

<dimen name="action_icon_size">60dp</dimen>
Expand Down
6 changes: 6 additions & 0 deletions app/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,12 @@
<item name="android:navigationBarColor">@color/black</item>
</style>

<style name="AlertDialogButtonStyle" parent="Widget.AppCompat.Button.ButtonBar.AlertDialog">
<item name="android:background">@drawable/rounded_button_shape</item>
<item name="android:minWidth">@dimen/min_button_width</item>
<item name="backgroundTint">@color/cc_brand_color</item>
</style>

<style name="CustomButtonStyle" parent="Widget.MaterialComponents.Button">
<item name="backgroundTint">@color/cc_brand_color</item>
<item name="android:textColor">@color/white</item>
Expand Down
2 changes: 1 addition & 1 deletion app/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<item name="android:textColorPrimary">@color/cc_core_text</item>
<item name="buttonStyle">@style/Commcare.Button.Primary</item>
<item name="materialButtonStyle">@style/Commcare.Button.Primary.Rounded</item>
<item name="buttonBarButtonStyle">@style/Commcare.Button.Primary</item>
<item name="buttonBarButtonStyle">@style/AlertDialogButtonStyle</item>
<item name="android:textAppearanceButton">@style/TextAppearance.AppCompat.Medium</item>
<item name="android:colorBackground">@color/cc_core_bg</item>
<item name="detail_odd_row_color">@color/cc_neutral_bg</item>
Expand Down

0 comments on commit 4ac0f10

Please sign in to comment.