Skip to content

Commit

Permalink
-ui changes for rounded button
Browse files Browse the repository at this point in the history
  • Loading branch information
pm-dimagi committed Nov 15, 2024
1 parent e850fbb commit 06e6611
Show file tree
Hide file tree
Showing 49 changed files with 296 additions and 175 deletions.
1 change: 1 addition & 0 deletions app/res/drawable/button_green_background.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
<item android:drawable="@color/green_900" android:state_pressed="true" />
<item android:drawable="@color/green_500" />


</selector>
17 changes: 17 additions & 0 deletions app/res/drawable/rounded_button.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Disabled State -->
<item android:state_enabled="false">
<shape android:shape="rectangle">
<corners android:radius="22dp" />
<solid android:color="#A5B8D8" /> <!-- Light blue for disabled -->
</shape>
</item>
<!-- Default State -->
<item>
<shape android:shape="rectangle">
<corners android:radius="22dp" />
<solid android:color="#004EBC" /> <!-- Blue background -->
</shape>
</item>
</selector>
7 changes: 3 additions & 4 deletions app/res/layout-land/activity_crash_warning.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,11 @@
</LinearLayout>
</ScrollView>

<Button
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:id="@+id/RestartCommCare"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="@dimen/content_min_margin"
android:background="@color/cc_brand_color"
android:textColor="@color/cc_neutral_bg"/>
android:layout_margin="@dimen/content_min_margin"/>
</RelativeLayout>
7 changes: 3 additions & 4 deletions app/res/layout/activity_crash_warning.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,11 @@
</LinearLayout>
</LinearLayout>

<Button
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:id="@+id/RestartCommCare"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="@dimen/content_min_margin"
android:background="@color/cc_brand_color"
android:textColor="@color/cc_neutral_bg"/>
android:layout_margin="@dimen/content_min_margin"/>
</RelativeLayout>
20 changes: 12 additions & 8 deletions app/res/layout/activity_drawing_boundary.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,32 +44,36 @@
android:layout_width="match_parent"
android:orientation="horizontal">

<Button
style="@style/MapButtonGreen"
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:backgroundTint="@color/green_500"
android:id="@+id/start_tracking_button"
android:layout_height="wrap_content"
android:layout_weight="1"
android:visibility="gone"
android:layout_width="0dp" />

<Button
style="@style/MapButtonRed"
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:id="@+id/stop_tracking_button"
android:backgroundTint="@color/red_500"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_width="0dp"
android:visibility="gone" />

<Button
style="@style/MapButtonOrange"
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:backgroundTint="@color/orange_500"
android:id="@+id/redo_tracking_button"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_width="0dp"
android:visibility="gone" />

<Button
style="@style/MapButtonGreen"
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:backgroundTint="@color/green_500"
android:id="@+id/ok_tracking_button"
android:layout_height="wrap_content"
android:layout_weight="1"
Expand Down
8 changes: 4 additions & 4 deletions app/res/layout/activity_mapbox_location_picker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,21 @@
android:maxLines="3"
android:minLines="3" />

<Button
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:id="@+id/confirm_location_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:enabled="false"
style="@style/Commcare.Button.Primary"
android:text="@string/confirm_location" />

<Button
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:id="@+id/cancel_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
style="@style/Commcare.Button.Primary"
android:text="@string/cancel" />

</LinearLayout>
Expand Down
4 changes: 3 additions & 1 deletion app/res/layout/activity_report_problem.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

<RelativeLayout
android:layout_width="match_parent"
android:layout_margin="16dp"
android:layout_height="wrap_content">

<ImageView
Expand Down Expand Up @@ -46,7 +47,8 @@
android:lines="5"
android:textColor="@color/black"/>

<Button
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:id="@+id/ReportButton01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
6 changes: 4 additions & 2 deletions app/res/layout/activity_target_mismatch_error.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@
tools:text="In order to install CommCare LTS, Please click on install button below. Then try installing your app again."/>
</LinearLayout>

<Button
style="@style/PromptedUpdateButtonUpdateLater"
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/standard_spacer_large"
android:layout_below="@+id/error_info_container"
android:id="@+id/install_app_button"
Expand Down
3 changes: 2 additions & 1 deletion app/res/layout/app_manager.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
android:layout_centerHorizontal="true"
android:gravity="center"/>

<Button
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:id="@+id/install_app_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down
6 changes: 4 additions & 2 deletions app/res/layout/blank_missing_multimedia_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
android:paddingStart="20px">
</ImageView>

<Button
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:id="@+id/skip_verification_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
Expand All @@ -31,7 +32,8 @@
android:layout_above="@+id/screen_multimedia_retry"
android:visibility="gone" />

<Button
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:id="@id/screen_multimedia_retry"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
Expand Down
9 changes: 5 additions & 4 deletions app/res/layout/blue_outlined_button.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Button xmlns:android="http://schemas.android.com/apk/res/android"
<com.google.android.material.button.MaterialButton xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
style="@style/CustomButtonStyleOutline"
app:strokeColor="@color/primary_button_background"
android:id="@+id/blue_outlined_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:textColor="@color/blue"
android:visibility="gone"
style="@style/CommCare.Button.Default"
android:background="@drawable/blue_outlined_view"
android:padding="10dp"
tools:viewBindingIgnore="true"/>
tools:viewBindingIgnore="true" />
9 changes: 6 additions & 3 deletions app/res/layout/choice_dialog_three_panel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
android:layout_marginEnd="@dimen/standard_spacer_large"
android:layout_marginStart="@dimen/standard_spacer_large">

<Button
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:id="@+id/choice_dialog_panel_1"
android:layout_width="0dp"
android:layout_height="wrap_content"
Expand All @@ -35,7 +36,8 @@
android:paddingTop="15dp"
android:layout_marginEnd="@dimen/standard_spacer" />

<Button
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:id="@+id/choice_dialog_panel_2"
android:layout_width="0dp"
android:layout_height="wrap_content"
Expand All @@ -48,7 +50,8 @@
android:layout_marginStart="@dimen/standard_spacer"
android:layout_marginEnd="@dimen/standard_spacer" />

<Button
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:id="@+id/choice_dialog_panel_3"
android:layout_width="0dp"
android:layout_height="wrap_content"
Expand Down
10 changes: 5 additions & 5 deletions app/res/layout/choice_dialog_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@
android:layout_marginEnd="@dimen/standard_spacer_large">
</ListView>

<Button xmlns:android="http://schemas.android.com/apk/res/android"
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyleOutline"
xmlns:android="http://schemas.android.com/apk/res/android"
app:strokeColor="@color/primary_button_background"
android:id="@+id/optional_button"
android:layout_width="wrap_content"
android:layout_height="@dimen/min_button_height"
android:padding="@dimen/standard_spacer"
android:layout_gravity="end"
android:layout_marginRight="@dimen/standard_spacer"
android:background="@android:color/transparent"
android:textSize="@dimen/font_size_dp_medium"
android:textColor="@color/dialog_button_color"
android:visibility="gone"
android:layout_marginEnd="@dimen/standard_spacer">
</Button>
android:layout_marginEnd="@dimen/standard_spacer"/>

<LinearLayout
android:layout_width="match_parent"
Expand Down
9 changes: 6 additions & 3 deletions app/res/layout/component_entity_detail_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
android:visibility="visible"
android:layout_marginEnd="8dp" />

<Button
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:id="@+id/detail_value_phone"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
Expand Down Expand Up @@ -105,7 +106,8 @@
android:drawablePadding="@dimen/content_min_margin"
android:text="Callout"/>

<Button
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:id="@+id/callout_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
Expand Down Expand Up @@ -146,7 +148,8 @@
android:paddingStart="11dp"
android:paddingEnd="4dp">

<Button
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:id="@+id/detail_address_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
Expand Down
13 changes: 7 additions & 6 deletions app/res/layout/connection_diagnostic.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@
android:paddingStart="5dp"
android:paddingEnd="5dp">

<Button
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:id="@+id/run_connection_test"
style="@style/ButtonBottom"
android:layout_width="match_parent"
android:layout_margin="10dp"
android:layout_height="wrap_content"
android:text="Run Connection Test"/>

Expand All @@ -58,17 +59,17 @@
android:text="Output message."
android:visibility="invisible"/>

<Button
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:id="@+id/settings_button"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Go to Settings"
android:visibility="invisible"/>

<Button
<com.google.android.material.button.MaterialButton
style="@style/CustomButtonStyle"
android:id="@+id/report_button"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Report to CommCare"
Expand Down
Loading

0 comments on commit 06e6611

Please sign in to comment.