Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button Revamp-Pm ccct 536 #2896

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added app/res/font/roboto_bold.ttf
Binary file not shown.
Binary file added app/res/font/roboto_italic.ttf
Binary file not shown.
Binary file added app/res/font/roboto_medium.ttf
Binary file not shown.
Binary file added app/res/font/roboto_regular.ttf
Binary file not shown.
6 changes: 3 additions & 3 deletions app/res/layout-land/activity_crash_warning.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@
</LinearLayout>
</ScrollView>

<Button
<org.commcare.activities.components.RoundedButton
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"/>
app:roundButtonBackgroundColor="@color/primary_button_background"
app:roundButtonTextColor="@color/white"/>
</RelativeLayout>
6 changes: 3 additions & 3 deletions app/res/layout/activity_crash_warning.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@
</LinearLayout>
</LinearLayout>

<Button
<org.commcare.activities.components.RoundedButton
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"/>
app:roundButtonBackgroundColor="@color/primary_button_background"
app:roundButtonTextColor="@color/white"/>
</RelativeLayout>
16 changes: 10 additions & 6 deletions app/res/layout/activity_mapbox_location_picker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="org.commcare.gis.MapboxLocationPickerActivity">

<io.ona.kujaku.views.KujakuMapView
Expand Down Expand Up @@ -56,22 +57,25 @@
android:maxLines="3"
android:minLines="3" />

<Button
<org.commcare.activities.components.RoundedButton
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" />
android:text="@string/confirm_location"
app:roundButtonBackgroundColor="@color/button_primary"
app:roundButtonTextColor="@color/white"/>
Comment on lines +67 to +68
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we set a common theme to all buttons instead of specifying the same attributes for all individual rounded buttons ? It will make any changes in future much easier.


<Button
<org.commcare.activities.components.RoundedButton
android:id="@+id/cancel_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_gravity="bottom"
style="@style/Commcare.Button.Primary"
android:text="@string/cancel" />
android:text="@string/cancel"
app:roundButtonBackgroundColor="@color/button_primary"
app:roundButtonTextColor="@color/white"/>

</LinearLayout>

Expand Down
6 changes: 4 additions & 2 deletions app/res/layout/activity_report_problem.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@
android:lines="5"
android:textColor="@color/black"/>

<Button
<org.commcare.activities.components.RoundedButton
android:id="@+id/ReportButton01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ReportText01"
android:layout_centerHorizontal="true"
android:text="Submit Report"/>
android:text="Submit Report"
app:roundButtonBackgroundColor="@color/primary_button_background"
app:roundButtonTextColor="@color/white"/>

</RelativeLayout>
</ScrollView>
25 changes: 15 additions & 10 deletions app/res/layout/activity_target_mismatch_error.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:gravity="center_horizontal"
android:layout_height="match_parent"
android:layout_margin="@dimen/standard_spacer"
android:layout_width="match_parent"
android:orientation="vertical"
tools:viewBindingIgnore="true">
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:gravity="center_horizontal"
android:layout_height="match_parent"
android:layout_margin="@dimen/standard_spacer"
android:layout_width="match_parent"
android:orientation="vertical"
tools:viewBindingIgnore="true">

<TextView
android:id="@+id/error_title"
Expand Down Expand Up @@ -38,12 +39,16 @@
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"
<org.commcare.activities.components.RoundedButton
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/standard_spacer_large"
android:layout_below="@+id/error_info_container"
android:padding="8dp"
android:id="@+id/install_app_button"
android:layout_centerHorizontal="true"
tools:text="Install CommCare LTS"/>
tools:text="Install CommCare LTS"
app:roundButtonBackgroundColor="@color/cc_brand_color"
app:roundButtonTextColor="@color/cc_neutral_bg"/>

</RelativeLayout>
9 changes: 6 additions & 3 deletions app/res/layout/app_manager.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
android:textColor="@color/darkest_grey"
android:layout_centerHorizontal="true"
android:gravity="center"/>

<Button
<org.commcare.activities.components.RoundedButton
android:id="@+id/install_app_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand All @@ -45,7 +44,11 @@
android:layout_marginTop="@dimen/standard_spacer"
android:paddingHorizontal="@dimen/standard_spacer_double"
android:onClick="installAppClicked"
android:text="@string/install_app" />
android:text="@string/install_app"
app:roundButtonTextSize="10sp"
app:roundButtonBackgroundColor="@color/primary_button_background"
app:roundButtonTextColor="@color/white"/>


<ListView
android:id="@+id/apps_list_view"
Expand Down
12 changes: 8 additions & 4 deletions app/res/layout/blank_missing_multimedia_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,28 @@
android:paddingStart="20px">
</ImageView>

<Button
<org.commcare.activities.components.RoundedButton
android:id="@+id/skip_verification_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/skip_button_text"
android:layout_centerHorizontal="true"
android:layout_above="@+id/screen_multimedia_retry"
android:visibility="gone" />
android:visibility="gone"
app:roundButtonBackgroundColor="@color/primary_button_background"
app:roundButtonTextColor="@color/white" />

<Button
<org.commcare.activities.components.RoundedButton
android:id="@id/screen_multimedia_retry"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:text="@string/retry_button_text"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:visibility="gone"/>
android:visibility="gone"
app:roundButtonBackgroundColor="@color/primary_button_background"
app:roundButtonTextColor="@color/white"/>


<ScrollView
Expand Down
13 changes: 8 additions & 5 deletions app/res/layout/blue_outlined_button.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Button xmlns:android="http://schemas.android.com/apk/res/android"

<org.commcare.activities.components.RoundedButton 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"
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:focusable="true"
android:padding="10dp"
tools:viewBindingIgnore="true"/>
tools:viewBindingIgnore="true"
app:roundButtonBorderVisible="true"
app:roundButtonBorderColor="@color/button_primary"
app:roundButtonTextColor="@color/blue"/>
38 changes: 24 additions & 14 deletions app/res/layout/choice_dialog_three_panel.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:viewBindingIgnore="true">
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:viewBindingIgnore="true">

<include
android:id="@+id/choice_dialog_title"
Expand All @@ -24,40 +25,49 @@
android:layout_marginEnd="@dimen/standard_spacer_large"
android:layout_marginStart="@dimen/standard_spacer_large">

<Button
<org.commcare.activities.components.RoundedButton
android:id="@+id/choice_dialog_panel_1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@android:color/transparent"
android:drawablePadding="5dp"
android:layout_marginRight="@dimen/standard_spacer"
android:paddingTop="15dp"
android:layout_marginEnd="@dimen/standard_spacer" />
android:layout_marginEnd="@dimen/standard_spacer"
app:roundButtonBorderVisible="true"
app:roundButtonBorderColor="@color/cc_brand_color"
app:roundButtonTextColor="@color/cc_brand_color"
app:roundButtonBackgroundColor="@color/transparent"/>

<Button
<org.commcare.activities.components.RoundedButton
android:id="@+id/choice_dialog_panel_2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@android:color/transparent"
android:drawablePadding="5dp"
android:layout_marginLeft="@dimen/standard_spacer"
android:layout_marginRight="@dimen/standard_spacer"
android:paddingTop="15dp"
android:layout_marginStart="@dimen/standard_spacer"
android:layout_marginEnd="@dimen/standard_spacer" />
android:layout_marginEnd="@dimen/standard_spacer"
app:roundButtonBorderVisible="true"
app:roundButtonBorderColor="@color/cc_brand_color"
app:roundButtonTextColor="@color/cc_brand_color"
app:roundButtonBackgroundColor="@color/transparent"/>

<Button
<org.commcare.activities.components.RoundedButton
android:id="@+id/choice_dialog_panel_3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@android:color/transparent"
android:drawablePadding="5dp"
android:layout_marginLeft="@dimen/standard_spacer"
android:paddingTop="15dp"
android:layout_marginStart="@dimen/standard_spacer" />
app:roundButtonBorderVisible="true"
app:roundButtonBorderColor="@color/cc_brand_color"
app:roundButtonTextColor="@color/cc_brand_color"
android:layout_marginStart="@dimen/standard_spacer"
app:roundButtonBackgroundColor="@color/transparent"/>

</LinearLayout>

Expand Down
16 changes: 8 additions & 8 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"
<org.commcare.activities.components.RoundedButton
xmlns:android="http://schemas.android.com/apk/res/android"
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:visibility="visible"
android:layout_marginEnd="@dimen/standard_spacer"
app:roundButtonLeftPadding="8dp"
app:roundButtonRightPadding="8dp"
app:roundButtonBackgroundColor="@color/transparent"
app:roundButtonTextColor="@color/dialog_button_color"/>

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

<Button
<org.commcare.activities.components.RoundedButton
android:id="@+id/detail_value_phone"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:layout_marginLeft="11dp"
android:layout_marginRight="12dp"
android:drawableLeft="@drawable/sym_action_call"
android:drawablePadding="@dimen/content_min_margin"
app:roundButtonIconPadding="16dp"
android:text="555-555-5555"
android:typeface="monospace"
android:visibility="gone"
android:layout_marginEnd="12dp"
android:drawableStart="@drawable/sym_action_call"
android:layout_marginStart="11dp" />
android:layout_marginStart="11dp"
app:roundButtonIconLeftAlign="true"
app:roundButtonIcon="@drawable/sym_action_call"
app:roundButtonBackgroundColor="@color/primary_button_background"
app:roundButtonTextColor="@color/white"/>

<ImageButton
android:id="@+id/detail_video_button"
Expand Down Expand Up @@ -105,13 +106,15 @@
android:drawablePadding="@dimen/content_min_margin"
android:text="Callout"/>

<Button
<org.commcare.activities.components.RoundedButton
android:id="@+id/callout_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawablePadding="@dimen/content_min_margin"
android:text="Callout"/>
android:text="Callout"
app:roundButtonBackgroundColor="@color/primary_button_background"
app:roundButtonTextColor="@color/white"/>

<TextView
android:id="@+id/callout_text"
Expand Down Expand Up @@ -141,20 +144,24 @@
android:paddingLeft="11dp"
android:paddingRight="4dp"
android:paddingTop="4dp"
android:visibility="gone"
android:visibility="visible"
android:layout_marginEnd="8dp"
android:paddingStart="11dp"
android:paddingEnd="4dp">

<Button
<org.commcare.activities.components.RoundedButton
android:id="@+id/detail_address_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:drawableLeft="@drawable/sym_action_lookup"
app:roundButtonIcon="@drawable/sym_action_lookup"
app:roundButtonIconLeftAlign="true"
android:drawablePadding="@dimen/content_min_margin"
android:text="Show Address"
android:drawableStart="@drawable/sym_action_lookup" />
android:drawableStart="@drawable/sym_action_lookup"
app:roundButtonBackgroundColor="@color/primary_button_background"
app:roundButtonTextColor="@color/white"
/>

<TextView
android:id="@+id/detail_address_text"
Expand Down
Loading
Loading