Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.

Commit

Permalink
Improve theme
Browse files Browse the repository at this point in the history
  • Loading branch information
deltazefiro committed May 22, 2021
1 parent ed77d4d commit 4ba60c2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 30 deletions.
5 changes: 2 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.SmartCrutch"
android:theme="@style/Theme.SmartCrutch.DayNight"
android:usesCleartextTraffic="true">
<!-- Amap api key -->
<meta-data
Expand All @@ -34,10 +34,9 @@
android:parentActivityName=".ui.SettingsActivity" />
<activity
android:name=".ui.MainActivity"
android:theme="@style/Theme.MaterialComponents.Light.NoActionBar">
android:theme="@style/Theme.SmartCrutch.DayNight.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Expand Down
12 changes: 6 additions & 6 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
android:id="@+id/main_card_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="28dp"
android:layout_marginHorizontal="34dp"
android:layout_marginTop="26dp"
app:cardBackgroundColor="@color/LightSlateGray"
app:cardElevation="8dp"
Expand All @@ -56,8 +56,8 @@
android:id="@+id/main_status_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="26dp"
android:layout_marginTop="26dp"
android:layout_marginStart="30dp"
android:layout_marginTop="28dp"
android:text="@string/status_loading"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline6"
android:textColor="@color/White"
Expand All @@ -69,7 +69,7 @@
android:id="@+id/main_status_info_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="26dp"
android:layout_marginStart="30dp"
android:layout_marginTop="2dp"
android:text="@string/status_info_loading"
android:textColor="@color/light_grey"
Expand All @@ -82,9 +82,9 @@
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="26dp"
android:layout_marginStart="28dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="22dp"
android:layout_marginBottom="24dp"
android:onClick="launchMapView"
android:text="@string/button_view_map"
android:textColor="@color/White"
Expand Down
16 changes: 0 additions & 16 deletions app/src/main/res/values-night/themes.xml

This file was deleted.

19 changes: 14 additions & 5 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
<resources xmlns:tools="http://schemas.android.com/tools">

<!-- Base application theme. -->
<style name="Theme.SmartCrutch" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<style name="Theme.SmartCrutch.DayNight" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/Blue</item>
<item name="colorPrimaryVariant">@color/teal_700</item>
<item name="colorPrimaryVariant">@color/RoyalBlue</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/White</item>

<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
<item name="cornerSize">8dp</item>
<item name="android:statusBarColor">?attr/backgroundColor</item>
<item name="android:windowLightStatusBar">true</item>

<item name="cornerSize">12dp</item>

<!-- Make layout above navigation bar-->
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:fitsSystemWindows">true</item>
</style>

<style name="Theme.SmartCrutch.DayNight.NoActionBar" parent="Theme.SmartCrutch.DayNight">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
</style>
</resources>

0 comments on commit 4ba60c2

Please sign in to comment.