Skip to content

Commit

Permalink
Merge pull request #2899 from dimagi/pm_CCCT_534
Browse files Browse the repository at this point in the history
PM-title bar color changes
  • Loading branch information
pm-dimagi authored Nov 29, 2024
2 parents 42a347b + e7cd5e8 commit 29eb7f7
Show file tree
Hide file tree
Showing 15 changed files with 93 additions and 32 deletions.
7 changes: 0 additions & 7 deletions app/res/drawable/actionbar_modern_spacing.xml

This file was deleted.

27 changes: 22 additions & 5 deletions app/res/drawable/button_green_background.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:drawable="@color/green_700" android:state_enabled="false" />
<item android:drawable="@color/green_900" android:state_pressed="true" />
<item android:drawable="@color/green_500" />

<!-- Disabled state -->
<item android:state_enabled="false">
<shape>
<solid android:color="@color/green_700" />
<corners android:radius="22dp" />
</shape>
</item>
<!-- Pressed state -->
<item android:state_pressed="true">
<shape>
<solid android:color="@color/green_900" />
<corners android:radius="22dp" />
</shape>
</item>
<!-- Default state -->
<item>
<shape>
<solid android:color="@color/green_500" />
<corners android:radius="22dp" />
</shape>
</item>
</selector>

26 changes: 21 additions & 5 deletions app/res/drawable/button_orange_background.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:drawable="@color/orange_700" android:state_enabled="false" />
<item android:drawable="@color/orange_900" android:state_pressed="true" />
<item android:drawable="@color/orange_500" />

<!-- Disabled state -->
<item android:state_enabled="false">
<shape>
<solid android:color="@color/orange_700" />
<corners android:radius="22dp" />
</shape>
</item>
<!-- Pressed state -->
<item android:state_pressed="true">
<shape>
<solid android:color="@color/orange_900" />
<corners android:radius="22dp" />
</shape>
</item>
<!-- Default state -->
<item>
<shape>
<solid android:color="@color/orange_500" />
<corners android:radius="22dp" />
</shape>
</item>
</selector>
26 changes: 21 additions & 5 deletions app/res/drawable/button_red_background.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:drawable="@color/red_700" android:state_enabled="false" />
<item android:drawable="@color/red_900" android:state_pressed="true" />
<item android:drawable="@color/red_500" />

<!-- Disabled state -->
<item android:state_enabled="false">
<shape>
<solid android:color="@color/red_700" />
<corners android:radius="22dp" />
</shape>
</item>
<!-- Pressed state -->
<item android:state_pressed="true">
<shape>
<solid android:color="@color/red_900" />
<corners android:radius="22dp" />
</shape>
</item>
<!-- Default state -->
<item>
<shape>
<solid android:color="@color/red_500" />
<corners android:radius="22dp" />
</shape>
</item>
</selector>
9 changes: 9 additions & 0 deletions app/res/drawable/commcare_actionbar_logo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="66"
android:viewportHeight="66">
<path
android:pathData="M65.243,28.031C63.982,23.591 61.071,19.904 57.042,17.654C54.971,16.5 52.728,15.802 50.439,15.559C50.332,14.594 50.16,13.629 49.894,12.677C48.634,8.237 45.723,4.55 41.694,2.3C37.664,0.051 33.002,-0.494 28.564,0.767C24.126,2.028 20.44,4.94 18.192,8.971C17.038,11.043 16.34,13.286 16.097,15.577C15.133,15.683 14.168,15.855 13.216,16.121C8.778,17.382 5.092,20.294 2.844,24.325C0.595,28.356 0.051,33.02 1.311,37.46C2.571,41.899 5.482,45.587 9.512,47.836C11.583,48.99 13.825,49.689 16.115,49.931C16.222,50.896 16.393,51.861 16.659,52.814C17.92,57.253 20.831,60.941 24.86,63.19C28.889,65.439 33.552,65.984 37.989,64.723C42.427,63.462 46.113,60.55 48.362,56.519C49.515,54.448 50.214,52.204 50.456,49.914C51.421,49.807 52.385,49.635 53.338,49.369C57.775,48.108 61.462,45.196 63.71,41.165C65.952,37.134 66.497,32.47 65.243,28.031ZM23.428,11.895C24.896,9.267 27.298,7.361 30.197,6.538C33.096,5.716 36.138,6.071 38.771,7.539C41.403,9.007 43.303,11.41 44.125,14.31C44.285,14.866 44.386,15.429 44.457,15.997C44.705,17.974 44.439,19.969 43.646,21.816C43.492,22.177 43.321,22.538 43.125,22.887C42.682,23.686 41.865,25.042 40.883,26.64C36.919,24.13 28.966,19.116 26.345,17.654C24.99,16.897 23.558,16.352 22.091,15.985C22.263,14.565 22.712,13.18 23.428,11.895ZM37.711,32.748C37.711,35.199 35.723,37.188 33.274,37.188C30.824,37.188 28.836,35.199 28.836,32.748C28.836,30.298 30.824,28.309 33.274,28.309C35.723,28.309 37.711,30.298 37.711,32.748ZM18.186,39.679C17.428,41.035 16.884,42.467 16.517,43.935C15.097,43.758 13.713,43.308 12.429,42.592C9.802,41.124 7.896,38.721 7.074,35.82C6.252,32.92 6.607,29.877 8.074,27.243C9.541,24.609 11.944,22.709 14.843,21.887C15.399,21.727 15.961,21.626 16.529,21.555C18.505,21.306 20.499,21.573 22.345,22.366C22.706,22.52 23.067,22.698 23.416,22.893C24.215,23.337 25.57,24.154 27.168,25.136C24.659,29.102 19.653,37.063 18.186,39.679ZM43.119,53.595C41.652,56.223 39.25,58.129 36.351,58.952C33.451,59.775 30.41,59.42 27.777,57.952C25.144,56.484 23.245,54.081 22.422,51.18C22.263,50.624 22.162,50.062 22.091,49.493C21.843,47.516 22.109,45.521 22.896,43.675C23.049,43.314 23.221,42.953 23.422,42.603C23.866,41.804 24.683,40.449 25.665,38.851C29.629,41.36 37.581,46.374 40.202,47.836C41.557,48.594 42.989,49.138 44.457,49.505C44.285,50.926 43.835,52.311 43.119,53.595ZM58.468,38.241C57,40.875 54.598,42.775 51.699,43.598C51.143,43.758 50.581,43.858 50.013,43.929C48.036,44.178 46.042,43.912 44.196,43.118C43.835,42.965 43.474,42.793 43.125,42.592C42.327,42.148 40.972,41.331 39.374,40.348C41.883,36.382 46.894,28.427 48.356,25.805C49.113,24.45 49.658,23.017 50.024,21.549C51.444,21.727 52.829,22.177 54.113,22.893C56.74,24.361 58.645,26.764 59.468,29.664C60.29,32.565 59.935,35.613 58.468,38.241Z"
android:fillColor="#ffffff"/>
</vector>
7 changes: 7 additions & 0 deletions app/res/drawable/commcare_actionbar_logo_spacing.xml
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>
8 changes: 4 additions & 4 deletions app/res/layout/activity_drawing_boundary.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
android:orientation="horizontal">

<com.google.android.material.button.MaterialButton
android:backgroundTint="@color/green_500"
style="@style/MapButtonGreen"
android:id="@+id/start_tracking_button"
android:layout_height="wrap_content"
android:layout_weight="1"
Expand All @@ -54,22 +54,22 @@

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

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

<com.google.android.material.button.MaterialButton
android:backgroundTint="@color/green_500"
style="@style/MapButtonGreen"
android:id="@+id/ok_tracking_button"
android:layout_height="wrap_content"
android:layout_weight="1"
Expand Down
Binary file modified app/res/mipmap-hdpi/commcare_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/res/mipmap-mdpi/commcare_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/res/mipmap-xhdpi/commcare_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/res/mipmap-xxhdpi/commcare_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/res/mipmap-xxxhdpi/commcare_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions app/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@

<!-- Button colors -->
<color name="button_disabled">#d0e3ff</color>
<color name="button_primary_color"> #3A42C7</color>
<color name="title_bar_color"> #5d70D2</color>
<color name="start_home_button">#6AB849</color>
<color name="start_save_button">#1B998B</color>
<color name="button_background_color">#5D70D2</color>
Expand Down
11 changes: 6 additions & 5 deletions app/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<resources xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android">

<style name="CommonTheme" parent="Theme.MaterialComponents.Light.DarkActionBar.Bridge">
<item name="colorPrimary">@color/cc_brand_color</item>
Expand Down Expand Up @@ -60,11 +60,10 @@
</style>

<style name="ActionBar" parent="Widget.AppCompat.Light.ActionBar">
<item name="background">@color/cc_brand_color</item>
<item name="background">@color/title_bar_color</item>
<item name="titleTextStyle">@style/ActionBar.TitleTextStyle</item>
<item name="subtitleTextStyle">@style/ActionBarSubtitleTextStyle</item>
<item name="logo">@drawable/actionbar_modern_spacing</item>
<item name="actionButtonStyle">@style/ActionButtonStyle</item>
<item name="logo">@drawable/commcare_actionbar_logo_spacing</item>
</style>

<style name="dropDownListView" parent="Widget.AppCompat.ListView.DropDown">
Expand All @@ -73,7 +72,9 @@

<style name="ActionBar.TitleTextStyle">
<item name="android:textColor">@color/white</item>
<item name="android:paddingLeft">8dp</item>
<item name="android:paddingLeft">16dp</item>
<item name="android:textSize">22sp</item>
<item name="android:textStyle">bold</item>
</style>

<style name="ActionBarSubtitleTextStyle">
Expand Down
2 changes: 1 addition & 1 deletion app/src/org/commcare/activities/CommCareActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ protected void onCreate(Bundle savedInstanceState) {
persistManagedUiState(fm);

if (getSupportActionBar() != null) {
getSupportActionBar().setLogo(org.commcare.dalvik.R.mipmap.commcare_launcher);
getSupportActionBar().setLogo(org.commcare.dalvik.R.drawable.commcare_actionbar_logo_spacing);
}

if (shouldShowBreadcrumbBar()) {
Expand Down

0 comments on commit 29eb7f7

Please sign in to comment.