-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Pm rounded button #2897
Pm rounded button #2897
Changes from all commits
e850fbb
06e6611
2b46881
eeab8d2
573ca4d
6cc54e7
b7156c8
10eadc6
3ae3643
ad7c456
a3af6b6
8e070fd
9f15541
99bc8f8
ccf96c2
1754bda
42a347b
e7cd5e8
29eb7f7
affabbf
1d4a933
cfe8594
ed3c688
7ea3cf6
b79797c
2c5eefe
2182e23
063e95c
53befeb
5f33c64
732c706
1def181
322e1aa
4ac0f10
3dcb2f1
1e5f9d8
5f22c1a
6c9ba8c
3ea45c8
9365782
c06692c
67d2919
44c763e
edbc979
13ae017
180db27
dde40f5
2e275f5
9e87ddb
4ef0149
eb6ce41
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<!-- Disabled state --> | ||
<item android:state_enabled="false" android:color="@color/green_700" /> | ||
<!-- Pressed state --> | ||
<item android:state_pressed="true" android:color="@color/green_900" /> | ||
<!-- Default state --> | ||
<item android:color="@color/green_500" /> | ||
</selector> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<!-- Disabled state --> | ||
<item android:state_enabled="false" android:color="@color/orange_700" /> | ||
<!-- Pressed state --> | ||
<item android:state_pressed="true" android:color="@color/orange_900" /> | ||
<!-- Default state --> | ||
<item android:color="@color/orange_500" /> | ||
</selector> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<!-- Disabled state --> | ||
<item android:state_enabled="false" android:color="@color/red_700" /> | ||
<!-- Pressed state --> | ||
<item android:state_pressed="true" android:color="@color/red_900" /> | ||
<!-- Default state --> | ||
<item android:color="@color/red_500" /> | ||
</selector> |
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_primary_color" /> | ||
</selector> |
This file was deleted.
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 --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Corner radius of 22dp is inconsistent with app's button styling Based on the search results, most rounded elements in the app use a 12dp radius (seen in multiple files like blue_tabbed_box.xml, grey_bordered_box.xml, info_bubble.xml, bubble.xml). The 22dp radius in button_background_white.xml is significantly larger and inconsistent with this pattern. Only border_dashed_edges.xml uses a similar larger radius of 18dp, but it's not a button element.
🔗 Analysis chainVerify corner radius consistency with Figma design The corner radius of 22dp should be verified against the Figma design specifications to ensure consistency across all rounded buttons in the app. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for other corner radius definitions in drawable files
rg -l "android:radius" --type xml
Length of output: 869 Script: #!/bin/bash
# Search for corner radius values in drawable files
rg "android:radius=\"\d+dp\"" --type xml -A 1
Length of output: 3306 Script: #!/bin/bash
# Search for button-specific drawables with corner radius
rg "android:radius=\"\d+dp\"" --type xml -A 2 -B 2 "*button*.xml"
Length of output: 118 Script: #!/bin/bash
# Search for button-specific drawables with corner radius, using full paths
rg "android:radius=\"\d+dp\"" --type xml -A 2 -B 2 "button_background_white.xml|rounded_button_shape.xml|map_button_base_background.xml"
Length of output: 260 |
||
<stroke | ||
android:width="2dp" | ||
android:color="@color/cc_brand_color" /> <!-- Optional border --> | ||
</shape> |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="20dp" | ||
android:height="20dp" | ||
android:viewportWidth="20" | ||
android:viewportHeight="20"> | ||
<path | ||
android:pathData="M10,10m-10,0a10,10 0,1 1,20 0a10,10 0,1 1,-20 0" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M17.591,8.821C17.286,7.737 16.584,6.836 15.611,6.287C15.111,6.005 14.57,5.834 14.018,5.775C13.992,5.539 13.95,5.304 13.886,5.071C13.582,3.987 12.879,3.086 11.907,2.537C10.934,1.987 9.809,1.854 8.738,2.162C7.667,2.47 6.777,3.181 6.235,4.166C5.956,4.672 5.788,5.22 5.729,5.779C5.496,5.805 5.264,5.847 5.034,5.912C3.963,6.22 3.073,6.931 2.53,7.916C1.988,8.9 1.856,10.039 2.16,11.124C2.465,12.208 3.167,13.108 4.14,13.658C4.639,13.94 5.181,14.11 5.733,14.17C5.759,14.405 5.801,14.641 5.865,14.873C6.169,15.958 6.872,16.858 7.844,17.408C8.817,17.957 9.942,18.09 11.013,17.782C12.084,17.474 12.974,16.763 13.516,15.778C13.795,15.273 13.963,14.725 14.022,14.165C14.255,14.139 14.487,14.097 14.717,14.032C15.788,13.724 16.678,13.013 17.221,12.029C17.762,11.044 17.893,9.905 17.591,8.821ZM7.498,4.88C7.853,4.238 8.432,3.773 9.132,3.572C9.832,3.371 10.566,3.458 11.201,3.816C11.837,4.175 12.295,4.762 12.494,5.47C12.532,5.606 12.557,5.743 12.574,5.882C12.634,6.365 12.569,6.852 12.378,7.303C12.341,7.391 12.3,7.479 12.252,7.565C12.145,7.76 11.948,8.091 11.711,8.481C10.755,7.868 8.835,6.644 8.203,6.287C7.875,6.102 7.53,5.969 7.176,5.879C7.217,5.532 7.326,5.194 7.498,4.88ZM10.946,9.973C10.946,10.571 10.466,11.057 9.875,11.057C9.284,11.057 8.804,10.571 8.804,9.973C8.804,9.374 9.284,8.889 9.875,8.889C10.466,8.889 10.946,9.374 10.946,9.973ZM6.233,11.666C6.05,11.997 5.919,12.347 5.831,12.705C5.488,12.662 5.154,12.552 4.844,12.377C4.21,12.019 3.75,11.432 3.551,10.723C3.353,10.015 3.438,9.272 3.793,8.629C4.147,7.985 4.727,7.521 5.426,7.32C5.561,7.281 5.696,7.257 5.833,7.239C6.31,7.179 6.792,7.244 7.237,7.437C7.324,7.475 7.411,7.518 7.496,7.566C7.688,7.674 8.015,7.874 8.401,8.114C7.796,9.082 6.587,11.027 6.233,11.666ZM12.251,15.064C11.897,15.706 11.317,16.172 10.617,16.373C9.918,16.574 9.184,16.487 8.548,16.128C7.913,15.77 7.454,15.183 7.256,14.475C7.217,14.339 7.193,14.201 7.176,14.063C7.116,13.58 7.18,13.093 7.37,12.642C7.407,12.553 7.448,12.465 7.497,12.38C7.604,12.185 7.801,11.854 8.038,11.463C8.995,12.076 10.914,13.301 11.547,13.658C11.874,13.843 12.22,13.976 12.574,14.066C12.532,14.412 12.424,14.751 12.251,15.064ZM15.955,11.314C15.601,11.958 15.021,12.422 14.322,12.623C14.188,12.662 14.052,12.686 13.915,12.704C13.438,12.764 12.957,12.699 12.511,12.506C12.424,12.468 12.337,12.426 12.252,12.377C12.06,12.269 11.733,12.069 11.347,11.829C11.953,10.861 13.162,8.918 13.515,8.277C13.698,7.946 13.829,7.596 13.918,7.238C14.26,7.281 14.594,7.391 14.904,7.566C15.538,7.925 15.998,8.511 16.197,9.22C16.395,9.928 16.31,10.673 15.955,11.314Z" | ||
android:fillColor="#ffffff"/> | ||
Comment on lines
+9
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification 🛠️ Refactor suggestion Add accessibility description and ensure theme compatibility The logo needs accessibility support and theme compatibility improvements:
<string name="commcare_logo_description">CommCare Logo</string>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:contentDescription="@string/commcare_logo_description"
android:width="20dp"
android:height="20dp"
android:viewportWidth="20"
android:viewportHeight="20">
<path
android:pathData="M10,10m-10,0a10,10 0,1 1,20 0a10,10 0,1 1,-20 0"
- android:fillColor="#000000"/>
+ android:fillColor="?attr/colorPrimary"/>
<path
android:pathData="M17.591,8.821C17.286,7.737..."
- android:fillColor="#ffffff"/>
+ android:fillColor="?attr/colorOnPrimary"/> The codebase shows usage of theme attributes (e.g., 🔗 Analysis chainAdd accessibility description and improve theme compatibility. The logo needs accessibility support and better theme compatibility:
<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:contentDescription="@string/commcare_logo"
android:width="20dp"
android:height="20dp"
android:viewportWidth="20"
android:viewportHeight="20">
<path
android:pathData="M10,10m-10,0a10,10 0,1 1,20 0a10,10 0,1 1,-20 0"
android:fillColor="?attr/colorPrimary"/>
<path
android:pathData="M17.591,8.821C17.286,7.737 16.584,6.836 15.611,6.287C15.111,6.005 14.57,5.834 14.018,5.775C13.992,5.539 13.95,5.304 13.886,5.071C13.582,3.987 12.879,3.086 11.907,2.537C10.934,1.987 9.809,1.854 8.738,2.162C7.667,2.47 6.777,3.181 6.235,4.166C5.956,4.672 5.788,5.22 5.729,5.779C5.496,5.805 5.264,5.847 5.034,5.912C3.963,6.22 3.073,6.931 2.53,7.916C1.988,8.9 1.856,10.039 2.16,11.124C2.465,12.208 3.167,13.108 4.14,13.658C4.639,13.94 5.181,14.11 5.733,14.17C5.759,14.405 5.801,14.641 5.865,14.873C6.169,15.958 6.872,16.858 7.844,17.408C8.817,17.957 9.942,18.09 11.013,17.782C12.084,17.474 12.974,16.763 13.516,15.778C13.795,15.273 13.963,14.725 14.022,14.165C14.255,14.139 14.487,14.097 14.717,14.032C15.788,13.724 16.678,13.013 17.221,12.029C17.762,11.044 17.893,9.905 17.591,8.821ZM7.498,4.88C7.853,4.238 8.432,3.773 9.132,3.572C9.832,3.371 10.566,3.458 11.201,3.816C11.837,4.175 12.295,4.762 12.494,5.47C12.532,5.606 12.557,5.743 12.574,5.882C12.634,6.365 12.569,6.852 12.378,7.303C12.341,7.391 12.3,7.479 12.252,7.565C12.145,7.76 11.948,8.091 11.711,8.481C10.755,7.868 8.835,6.644 8.203,6.287C7.875,6.102 7.53,5.969 7.176,5.879C7.217,5.532 7.326,5.194 7.498,4.88ZM10.946,9.973C10.946,10.571 10.466,11.057 9.875,11.057C9.284,11.057 8.804,10.571 8.804,9.973C8.804,9.374 9.284,8.889 9.875,8.889C10.466,8.889 10.946,9.374 10.946,9.973ZM6.233,11.666C6.05,11.997 5.919,12.347 5.831,12.705C5.488,12.662 5.154,12.552 4.844,12.377C4.21,12.019 3.75,11.432 3.551,10.723C3.353,10.015 3.438,9.272 3.793,8.629C4.147,7.985 4.727,7.521 5.426,7.32C5.561,7.281 5.696,7.257 5.833,7.239C6.31,7.179 6.792,7.244 7.237,7.437C7.324,7.475 7.411,7.518 7.496,7.566C7.688,7.674 8.015,7.874 8.401,8.114C7.796,9.082 6.587,11.027 6.233,11.666ZM12.251,15.064C11.897,15.706 11.317,16.172 10.617,16.373C9.918,16.574 9.184,16.487 8.548,16.128C7.913,15.77 7.454,15.183 7.256,14.475C7.217,14.339 7.193,14.201 7.176,14.063C7.116,13.58 7.18,13.093 7.37,12.642C7.407,12.553 7.448,12.465 7.497,12.38C7.604,12.185 7.801,11.854 8.038,11.463C8.995,12.076 10.914,13.301 11.547,13.658C11.874,13.843 12.22,13.976 12.574,14.066C12.532,14.412 12.424,14.751 12.251,15.064ZM15.955,11.314C15.601,11.958 15.021,12.422 14.322,12.623C14.188,12.662 14.052,12.686 13.915,12.704C13.438,12.764 12.957,12.699 12.511,12.506C12.424,12.468 12.337,12.426 12.252,12.377C12.06,12.269 11.733,12.069 11.347,11.829C11.953,10.861 13.162,8.918 13.515,8.277C13.698,7.946 13.829,7.596 13.918,7.238C14.26,7.281 14.594,7.391 14.904,7.566C15.538,7.925 15.998,8.511 16.197,9.22C16.395,9.928 16.31,10.673 15.955,11.314Z"
- android:fillColor="#ffffff"/>
+ android:fillColor="?attr/colorOnPrimary"/> 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify the string resource exists and check for similar logos
# that might need the same updates
# Check if the content description string resource exists
rg "commcare_logo" -t xml
# Find similar vector drawables that might need the same updates
fd -e xml -x grep -l "android:fillColor=\"#000000\"" {} \; -x grep -l "android:fillColor=\"#ffffff\"" {} \;
Length of output: 682 Script: #!/bin/bash
# Let's check for string resources containing "logo" to find potential content description
rg "logo" -t xml app/res/values/
# Also check for theme-aware color attributes usage in drawables
rg "attr/color" -t xml app/res/drawable/
Length of output: 940 |
||
</vector> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layer-list | ||
xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item | ||
android:drawable="@drawable/commcare_actionbar_logo" | ||
android:right="16dp"/> | ||
</layer-list> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="167dp" | ||
android:height="168dp" | ||
android:viewportWidth="167" | ||
android:viewportHeight="168"> | ||
android:width="300dp" | ||
android:height="233dp" | ||
android:viewportWidth="300" | ||
android:viewportHeight="233"> | ||
<path | ||
android:pathData="M54.73,22.85C58.9,10.98 70.23,2.49 83.53,2.49C96.83,2.49 108.16,10.98 112.33,22.85H124.26C135.5,22.85 144.63,31.98 144.63,43.22V145.04C144.63,156.28 135.5,165.41 124.26,165.41H42.8C31.57,165.41 22.44,156.28 22.44,145.04V43.22C22.44,31.98 31.57,22.85 42.8,22.85H54.73ZM90.73,25.83C88.82,23.92 86.23,22.85 83.53,22.85C80.83,22.85 78.24,23.92 76.33,25.83C74.42,27.74 73.35,30.33 73.35,33.03C73.35,35.73 74.42,38.32 76.33,40.23C78.24,42.14 80.83,43.22 83.53,43.22C86.23,43.22 88.82,42.14 90.73,40.23C92.64,38.32 93.72,35.73 93.72,33.03C93.72,30.33 92.64,27.74 90.73,25.83ZM47.58,71.95C46.15,73.38 45.35,75.32 45.35,77.35C45.35,79.38 46.15,81.32 47.58,82.75C49.02,84.18 50.96,84.99 52.98,84.99C55.01,84.99 56.95,84.18 58.38,82.75C59.82,81.32 60.62,79.38 60.62,77.35C60.62,75.32 59.82,73.38 58.38,71.95C56.95,70.52 55.01,69.71 52.98,69.71C50.96,69.71 49.02,70.52 47.58,71.95ZM119.17,72.26H78.44C75.64,72.26 73.35,74.55 73.35,77.35C73.35,80.15 75.64,82.44 78.44,82.44H119.17C121.97,82.44 124.26,80.15 124.26,77.35C124.26,74.55 121.97,72.26 119.17,72.26ZM128.84,124.26C128.84,135.51 119.72,144.63 108.47,144.63C97.22,144.63 88.1,135.51 88.1,124.26C88.1,113.01 97.22,103.9 108.47,103.9C119.72,103.9 128.84,113.01 128.84,124.26ZM110.38,115.99C110.38,114.93 109.53,114.08 108.47,114.08C107.41,114.08 106.56,114.93 106.56,115.99V124.9C106.56,125.96 107.41,126.81 108.47,126.81C109.53,126.81 110.38,125.96 110.38,124.9V115.99ZM108.47,134.45C109.88,134.45 111.02,133.31 111.02,131.9C111.02,130.49 109.88,129.35 108.47,129.35C107.06,129.35 105.92,130.49 105.92,131.9C105.92,133.31 107.06,134.45 108.47,134.45Z" | ||
android:fillColor="#ffffff" | ||
android:pathData="M122.98,58.67C126.89,47.53 137.52,39.56 150,39.56C162.48,39.56 173.11,47.53 177.02,58.67H188.22C198.76,58.67 207.33,67.24 207.33,77.78V173.33C207.33,183.87 198.76,192.44 188.22,192.44H111.78C101.24,192.44 92.67,183.87 92.67,173.33V77.78C92.67,67.24 101.24,58.67 111.78,58.67H122.98ZM156.76,61.47C154.96,59.68 152.53,58.67 150,58.67C147.47,58.67 145.04,59.68 143.24,61.47C141.45,63.26 140.45,65.69 140.45,68.22C140.45,70.76 141.45,73.19 143.24,74.98C145.04,76.77 147.47,77.78 150,77.78C152.53,77.78 154.96,76.77 156.76,74.98C158.55,73.19 159.55,70.76 159.55,68.22C159.55,65.69 158.55,63.26 156.76,61.47ZM116.27,104.74C114.92,106.08 114.17,107.91 114.17,109.81C114.17,111.71 114.92,113.53 116.27,114.88C117.61,116.22 119.43,116.97 121.33,116.97C123.24,116.97 125.06,116.22 126.4,114.88C127.75,113.53 128.5,111.71 128.5,109.81C128.5,107.91 127.75,106.08 126.4,104.74C125.06,103.4 123.24,102.64 121.33,102.64C119.43,102.64 117.61,103.4 116.27,104.74ZM183.44,105.03H145.22C142.6,105.03 140.45,107.18 140.45,109.81C140.45,112.44 142.6,114.59 145.22,114.59H183.44C186.07,114.59 188.22,112.44 188.22,109.81C188.22,107.18 186.07,105.03 183.44,105.03ZM192.51,153.83C192.51,164.38 183.96,172.94 173.4,172.94C162.85,172.94 154.29,164.38 154.29,153.83C154.29,143.27 162.85,134.72 173.4,134.72C183.96,134.72 192.51,143.27 192.51,153.83ZM175.19,146.07C175.19,145.07 174.39,144.27 173.4,144.27C172.41,144.27 171.61,145.07 171.61,146.07V154.43C171.61,155.42 172.41,156.22 173.4,156.22C174.39,156.22 175.19,155.42 175.19,154.43V146.07ZM173.4,163.38C174.72,163.38 175.79,162.32 175.79,161C175.79,159.68 174.72,158.61 173.4,158.61C172.08,158.61 171.01,159.68 171.01,161C171.01,162.32 172.08,163.38 173.4,163.38Z" | ||
android:fillColor="@color/square_button_icon_color" | ||
android:fillType="evenOdd"/> | ||
</vector> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Color inconsistency detected with design system
The current implementation uses
@color/start_home_button
(#6AB849), but this doesn't align with the design system's rounded button specifications. The design system (CustomButtonStyle) uses@color/cc_brand_color
as the standard background color for primary rounded buttons.btn_finish_background.xml
should use@color/cc_brand_color
instead of@color/start_home_button
to maintain consistency with the design systemCustomButtonStyle
directly instead of managing colors separately🔗 Analysis chain
Ensure color consistency with design system
The button's default state now uses
@color/start_home_button
. Please verify this aligns with the Figma design specifications for rounded buttons.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 473
Script:
Length of output: 2704
Script:
Length of output: 1636