Skip to content

Commit

Permalink
Updated the style to M3 to look more like other demo apps (#2741)
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-07 authored Nov 28, 2024
1 parent d37ef08 commit 5f7ce19
Show file tree
Hide file tree
Showing 7 changed files with 213 additions and 50 deletions.
2 changes: 1 addition & 1 deletion workflow_demo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Androidfhir"
android:theme="@style/AppTheme"
>
<activity android:name=".MainActivity" android:exported="true">
<intent-filter>
Expand Down
7 changes: 3 additions & 4 deletions workflow_demo/src/main/res/layout/card_item_phase.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_margin="10dp"
app:cardCornerRadius="5dp"
app:contentPadding="5dp"
app:strokeWidth="2dp"
app:cardElevation="5dp"
>

<RelativeLayout
Expand All @@ -19,6 +16,7 @@
>

<com.google.android.material.textview.MaterialTextView
style="@style/AppTheme.Subtitle2"
android:layout_marginTop="10dp"
tools:text="Proposal"
android:gravity="center"
Expand All @@ -32,13 +30,14 @@
android:layout_marginTop="10dp"
android:layout_alignRight="@id/phase_name"
android:layout_below="@id/phase_name"
android:text="Start"
android:text="@string/start"
android:id="@+id/start_phase"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>

<com.google.android.material.textview.MaterialTextView
style="@style/AppTheme.body2"
android:layout_below="@id/start_phase"
android:layout_marginTop="10dp"
tools:text="details"
Expand Down
15 changes: 6 additions & 9 deletions workflow_demo/src/main/res/layout/fragment_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,47 +19,44 @@
android:layout_marginEnd="9dp"
android:layout_marginRight="9dp"
android:layout_marginBottom="10dp"
app:cardCornerRadius="5dp"
app:cardElevation="5dp"
app:contentPadding="5dp"
app:layout_constraintBottom_toTopOf="@+id/install_dependencies"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:strokeWidth="2dp"
>


<com.google.android.material.textview.MaterialTextView
android:id="@+id/patient_name"
style="@style/TextAppearance.AppCompat.Headline"
style="@style/AppTheme.headline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mr. John Doe Sr."
android:text="@string/patient_name"
/>


</com.google.android.material.card.MaterialCardView>

<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/restart_flow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginRight="20dp"
android:text="Restart Flow"
android:text="@string/restart"
app:layout_constraintBottom_toTopOf="@+id/phase_view_pager"
app:layout_constraintEnd_toEndOf="@+id/phase_view_pager"
/>

<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/install_dependencies"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="180dp"
android:text="Initialize"
android:text="@string/initialize"
app:layout_constraintStart_toStartOf="@+id/phase_view_pager"
app:layout_constraintTop_toTopOf="parent"
/>
Expand Down
77 changes: 62 additions & 15 deletions workflow_demo/src/main/res/values-night/themes.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,66 @@
<!--
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style
name="Theme.Androidfhir"
parent="Theme.MaterialComponents.DayNight.DarkActionBar"
>
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_200</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
<style name="AppTheme" parent="Theme.Material3.DayNight.NoActionBar">
<item name="colorPrimary">@color/primary_blue_80</item>
<item name="colorOnPrimary">@color/onPrimary_blue_20</item>
<item
name="colorPrimaryContainer"
>@color/primaryContainer_blue_30</item>
<item
name="colorOnPrimaryContainer"
>@color/onPrimaryContainer_blue_90</item>

<item name="colorSecondary">@color/secondary_blue_80</item>
<item name="colorOnSecondary">@color/onSecondary_blue_20</item>
<item
name="colorSecondaryContainer"
>@color/secondaryContainer_blue_30</item>
<item
name="colorOnSecondaryContainer"
>@color/onSecondaryContainer_blue_90</item>

<item name="colorTertiary">@color/tertiary_green_80</item>
<item name="colorOnTertiary">@color/onTertiary_green_20</item>
<item
name="colorTertiaryContainer"
>@color/tertiaryContainer_green_30</item>
<item
name="colorOnTertiaryContainer"
>@color/onTertiaryContainer_green_90</item>

<item name="colorError">@color/error_red_80</item>
<item name="colorErrorContainer">@color/errorContainer_red_20</item>
<item name="colorOnError">@color/onError_red_30</item>
<item name="colorOnErrorContainer">@color/onErrorContainer_red_90</item>

<item name="android:colorBackground">@color/background_neutral_10</item>
<item name="colorOnBackground">@color/onBackground_neutral_90</item>

<item name="colorSurface">@color/surface_neutral_10</item>
<item name="colorOnSurface">@color/onSurface_neutral_90</item>

<item
name="colorSurfaceVariant"
>@color/surfaceVariant_neutral_variant_30</item>
<item
name="colorOnSurfaceVariant"
>@color/onSurfaceVariant_neutral_variant_80</item>

<item name="colorOutline">@color/outline_neutral_variant_60</item>
</style>
</resources>
70 changes: 64 additions & 6 deletions workflow_demo/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,68 @@
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="primary_blue_40">#0B57D0</color>
<color name="onPrimary_blue_100">#FFFFFF</color>
<color name="primaryContainer_blue_90">#D3E3FD</color>
<color name="onPrimaryContainer_blue_10">#041E49</color>

<color name="secondary_blue_40">#00639B</color>
<color name="onSecondary_blue_100">#FFFFFF</color>
<color name="secondaryContainer_blue_90">#C2E7FF</color>
<color name="onSecondaryContainer_blue_10">#001D35</color>

<color name="tertiary_green_40">#146C2E</color>
<color name="onTertiary_green_100">#FFFFFF</color>
<color name="tertiaryContainer_green_90">#C4EED0</color>
<color name="onTertiaryContainer_green_10">#072711</color>

<color name="error_red_40">#B3261E</color>
<color name="errorContainer_red_100">#FFFFFF</color>
<color name="onError_red_90">#F9DEDC</color>
<color name="onErrorContainer_red_10">#410E0B</color>

<color name="background_neutral_100">#FFFFFF</color>
<color name="onBackground_neutral_10">#1F1F1F</color>

<color name="surface_neutral_100">#FFFFFF</color>
<color name="onSurface_neutral_10">#1F1F1F</color>

<color name="surfaceVariant_neutral_variant_90">#E1E3E1</color>
<color name="onSurfaceVariant_neutral_variant_30">#444746</color>

<color name="outline_neutral_variant_50">#747775</color>

<color name="primary_blue_80">#A8C7FA</color>
<color name="onPrimary_blue_20">#062E6F</color>
<color name="primaryContainer_blue_30">#0842A0</color>
<color name="onPrimaryContainer_blue_90">#D3E3FD</color>

<color name="secondary_blue_80">#7FCFFF</color>
<color name="onSecondary_blue_20">#003355</color>
<color name="secondaryContainer_blue_30">#004A77</color>
<color name="onSecondaryContainer_blue_90">#C2E7FF</color>

<color name="tertiary_green_80">#146C2E</color>
<color name="onTertiary_green_20">#0A3818</color>
<color name="tertiaryContainer_green_30">#0F5223</color>
<color name="onTertiaryContainer_green_90">#C4EED0</color>

<color name="error_red_80">#F2B8B5</color>
<color name="onError_red_30">#8C1D18</color>
<color name="errorContainer_red_20">#601410</color>
<color name="onErrorContainer_red_90">#F9DEDC</color>

<color name="background_neutral_10">#1F1F1F</color>
<color name="onBackground_neutral_90">#E3E3E3</color>

<color name="surface_neutral_10">#1F1F1F</color>
<color name="onSurface_neutral_90">#E3E3E3</color>

<color name="surfaceVariant_neutral_variant_30">#444746</color>
<color name="onSurfaceVariant_neutral_variant_80">#C4C7C5</color>

<color name="outline_neutral_variant_60">#8E918F</color>

<color name="black">#000000</color>
<color name="white">#FFFFFFFF</color>
<color name="dashboard_cardview_textcolor">#4D4D4D</color>
</resources>
4 changes: 4 additions & 0 deletions workflow_demo/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<resources>
<string name="app_name">WorkflowDemo</string>
<string name="initialize">Initialize</string>
<string name="restart">Restart Flow</string>
<string name="start">Start</string>
<string name="patient_name">Mr. John Doe Sr.</string>
</resources>
88 changes: 73 additions & 15 deletions workflow_demo/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,77 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style
name="Theme.Androidfhir"
parent="Theme.MaterialComponents.DayNight.DarkActionBar"
>
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
<style name="AppTheme" parent="Theme.Material3.DayNight.NoActionBar">
<item name="colorPrimary">@color/primary_blue_40</item>
<item name="colorOnPrimary">@color/onPrimary_blue_100</item>
<item
name="colorPrimaryContainer"
>@color/primaryContainer_blue_90</item>
<item
name="colorOnPrimaryContainer"
>@color/onPrimaryContainer_blue_10</item>

<item name="colorSecondary">@color/secondary_blue_40</item>
<item name="colorOnSecondary">@color/onSecondary_blue_100</item>
<item
name="colorSecondaryContainer"
>@color/secondaryContainer_blue_90</item>
<item
name="colorOnSecondaryContainer"
>@color/onSecondaryContainer_blue_10</item>

<item name="colorTertiary">@color/tertiary_green_40</item>
<item name="colorOnTertiary">@color/onTertiary_green_100</item>
<item
name="colorTertiaryContainer"
>@color/tertiaryContainer_green_90</item>
<item
name="colorOnTertiaryContainer"
>@color/onTertiaryContainer_green_10</item>

<item name="colorError">@color/error_red_40</item>
<item name="colorErrorContainer">@color/errorContainer_red_100</item>
<item name="colorOnError">@color/onError_red_90</item>
<item name="colorOnErrorContainer">@color/onErrorContainer_red_10</item>

<item
name="android:colorBackground"
>@color/background_neutral_100</item>
<item name="colorOnBackground">@color/onBackground_neutral_10</item>

<item name="colorSurface">@color/surface_neutral_100</item>
<item name="colorOnSurface">@color/onSurface_neutral_10</item>

<item
name="colorSurfaceVariant"
>@color/surfaceVariant_neutral_variant_90</item>
<item
name="colorOnSurfaceVariant"
>@color/onSurfaceVariant_neutral_variant_30</item>

<item name="colorOutline">@color/outline_neutral_variant_50</item>

</style>

<style name="AppCard" parent="Widget.Material3.CardView.Outlined">
<item name="cardElevation">8dp</item>
</style>

<style name="AppTheme.headline">
<item
name="android:textAppearance"
>?attr/textAppearanceHeadlineSmall</item>
<item name="android:textStyle">normal</item>
</style>

<style name="AppTheme.Subtitle2">
<item
name="android:textAppearance"
>?attr/textAppearanceTitleSmall</item>
</style>

<style name="AppTheme.body2">
<item
name="android:textAppearance"
>?attr/textAppearanceBodyMedium</item>
</style>
</resources>

0 comments on commit 5f7ce19

Please sign in to comment.