Skip to content

Commit

Permalink
-changes of button color
Browse files Browse the repository at this point in the history
  • Loading branch information
pm-dimagi committed Nov 27, 2024
1 parent 3ae3643 commit ccf96c2
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/res/color/primary_button_background.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/button_disabled" android:state_enabled="false" />
<item android:color="@color/button_primary" />
<item android:color="@color/button_background_color" />
</selector>
8 changes: 8 additions & 0 deletions app/res/drawable/button_background_white.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white" /> <!-- Background color -->
<corners android:radius="22dp" /> <!-- Rounded corners -->
<stroke
android:width="2dp"
android:color="@color/button_background_color" /> <!-- Optional border -->
</shape>
6 changes: 3 additions & 3 deletions app/res/layout/hierarchy_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ the License.
android:layout_height="wrap_content"
android:text="@string/jump_to_previous"
android:padding="12dp"
android:textColor="@color/button_primary_color"
android:textColor="@color/button_background_color"
android:background="@color/cc_core_bg"
style="@style/CommCare.Button.Default"
android:textSize="@dimen/text_medium"
Expand All @@ -59,7 +59,7 @@ the License.
android:text="@string/jump_to_beginning"
android:padding="12dp"
android:textSize="@dimen/text_medium"
android:textColor="@color/button_primary_color"
android:textColor="@color/button_background_color"
android:background="@color/cc_core_bg"
style="@style/CommCare.Button.Default"
android:layout_weight="1"/>
Expand All @@ -71,7 +71,7 @@ the License.
android:text="@string/jump_to_end"
android:padding="12dp"
android:textSize="@dimen/text_medium"
android:textColor="@color/button_primary_color"
android:textColor="@color/button_background_color"
android:background="@color/cc_core_bg"
style="@style/CommCare.Button.Default"
android:layout_weight="1"/>
Expand Down
5 changes: 1 addition & 4 deletions app/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,12 @@
<color name="red_900">#B71C1C</color>

<!-- Button colors -->
<color name="button_primary">#005ab2</color>
<color name="button_disabled">#d0e3ff</color>

<color name="start_home_button">#6AB849</color>
<color name="start_save_button">#1B998B</color>
<color name="start_sync_button">#5D70D2</color>
<color name="button_background_color">#5D70D2</color>
<color name="start_sync_dark_button">#3b4fb6</color>
<color name="start_logout_button">#373534</color>
<color name="button_primary_color"> #3A42C7</color>


</resources>
9 changes: 5 additions & 4 deletions app/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
</style>

<style name="PromptedUpdateButtonUpdateLater" parent="PromptedUpdateButtonBase">
<item name="android:background">@color/cc_brand_color</item>
<item name="android:background">@color/button_background_color</item>
<item name="android:textSize">@dimen/font_size_xlarge</item>
<item name="android:paddingLeft">@dimen/standard_spacer_large</item>
<item name="android:paddingRight">@dimen/standard_spacer_large</item>
Expand Down Expand Up @@ -307,7 +307,7 @@
</style>

<style name="CustomButtonStyle" parent="Widget.MaterialComponents.Button">
<item name="background">@color/start_sync_button</item>
<item name="backgroundTint">@color/button_background_color</item>
<item name="android:textColor">@color/white</item>
<item name="android:textSize">16sp</item>
<item name="android:gravity">center</item>
Expand All @@ -323,14 +323,15 @@
<item name="shapeAppearanceOverlay">@style/RoundedButtonStyle</item>
</style>
<style name="RoundedButtonStyle" parent="">
<item name="android:background">@drawable/button_background_white</item>
<item name="cornerFamilyTopLeft">rounded</item>
<item name="cornerFamilyBottomLeft">rounded</item>
<item name="cornerFamilyTopRight">rounded</item>
<item name="cornerFamilyBottomRight">rounded</item>
<item name="cornerSize">22dp</item>
<item name="strokeColor">@color/button_primary_color</item>
<item name="strokeColor">@color/button_background_color</item>
<item name="strokeWidth">2dp</item>
<item name="textColor">@color/button_primary_color</item>
<item name="textColor">@color/button_background_color</item>
</style>

</resources>
2 changes: 1 addition & 1 deletion app/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
<item name="textAllCaps">true</item>
<item name="android:minHeight">@dimen/dp60</item>
<item name="android:textColor">@color/white</item>
<item name="backgroundTint">@color/primary_button_background</item>
<item name="backgroundTint">@color/button_background_color</item>
<item name="cornerRadius">@dimen/dp6</item>
</style>

Expand Down
2 changes: 1 addition & 1 deletion app/src/org/commcare/activities/HomeButtons.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static HomeCardDisplayData[] buildButtonData(StandardHomeActivity activit
HomeCardDisplayData.homeCardDataWithNotification(Localization.get(syncKey), R.color.white,
R.color.white,
R.drawable.home_sync,
R.color.start_sync_button,
R.color.button_background_color,
R.color.start_sync_dark_button,
getSyncButtonListener(activity),
getSyncButtonSubTextListener(activity),
Expand Down

0 comments on commit ccf96c2

Please sign in to comment.