Commit c7439f56 authored by Joey's avatar Joey

ui: minor theme improvements

* Better colors for dark mode
* Increase app radius to 8dp
Signed-off-by: Joey's avatarJoey <bevilacquajoey@gmail.com>
Change-Id: If3f583c132783571d0d83d31b4aa47b0c34974ae
parent 5733b3f1
......@@ -40,8 +40,8 @@ class GlucoseListAdapter(
val openGlucose: LiveData<Event<Long>> = _openGlucose
// Store the these for better performance
private val lowIndicator by lazy { buildIndicator(R.color.glucose_indicator_low) }
private val highIndicator by lazy { buildIndicator(R.color.glucose_indicator_high) }
private val lowIndicator by lazy { buildIndicator(R.color.glucoseIndicator_low) }
private val highIndicator by lazy { buildIndicator(R.color.glucoseIndicator_high) }
private val highThreshold by lazy { PreferencesUtil.getGlucoseHighThreshold(context) }
private val lowThreshold by lazy { PreferencesUtil.getGlucoseLowThreshold(context) }
......
......@@ -186,7 +186,7 @@ class OverviewFragment : BaseFragment() {
return null
}
val color = ContextCompat.getColor(context, R.color.graph_overview_today)
val color = ContextCompat.getColor(context, R.color.overviewGraph_today)
val textColor = ContextCompat.getColor(context, R.color.textPrimary)
return LineDataSet(entries, "").apply {
......@@ -208,7 +208,7 @@ class OverviewFragment : BaseFragment() {
return null
}
val color = ContextCompat.getColor(context, R.color.graph_overview_average)
val color = ContextCompat.getColor(context, R.color.overviewGraph_average)
return LineDataSet(entries, "").apply {
this.color = color
......
......@@ -35,7 +35,7 @@
android:layout_height="1dp"
android:layout_gravity="bottom"
android:layout_marginBottom="@dimen/main_bottom_nav_height"
android:foreground="@color/item_header_divider" />
android:foreground="@color/contentDivider" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabs"
......
......@@ -26,10 +26,10 @@
android:background="@drawable/bg_circle"
android:contentDescription="@null"
android:padding="8dp"
android:src="@drawable/ic_time_dinner"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_time_dinner" />
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="0dp"
......@@ -69,5 +69,5 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:background="@color/glucose_indicator_high" />
tools:background="@color/glucoseIndicator_high" />
</androidx.constraintlayout.widget.ConstraintLayout>
......@@ -17,7 +17,7 @@
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground"
android:stateListAnimator="@animator/lift_on_touch"
app:cardBackgroundColor="@color/item_card_bg"
app:cardBackgroundColor="@color/elevatedSurface"
app:cardCornerRadius="@dimen/app_radius"
app:cardElevation="2dp"
app:contentPadding="8dp">
......
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2019 Bevilacqua Joey
......@@ -9,5 +8,6 @@
-->
<resources>
<color name="item_card_bg">#1F1F1F</color>
<color name="glucoseIndicator_high">#ffb84d</color>
<color name="glucoseIndicator_low">#fc6599</color>
</resources>
\ No newline at end of file
......@@ -10,11 +10,9 @@
<resources>
<color name="ic_launcher_background">#243FE0</color>
<color name="graph_overview_today">@color/colorAccentDark</color>
<color name="graph_overview_average">@color/colorAccentLight</color>
<color name="overviewGraph_today">@color/colorAccentDark</color>
<color name="overviewGraph_average">@color/colorAccentLight</color>
<color name="glucose_indicator_high">#ffcd80</color>
<color name="glucose_indicator_low">#ff90b5</color>
<color name="item_card_bg">#fafafa</color>
<color name="glucoseIndicator_high">#ffcd80</color>
<color name="glucoseIndicator_low">#ff90b5</color>
</resources>
......@@ -6,10 +6,12 @@
The text of the license can be found in the LICENSE file
or at https://www.gnu.org/licenses/gpl.txt
-->
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Main -->
<style name="AppTheme.Main" parent="AppTheme.NoActionBar" />
<style name="AppTheme.Main" parent="AppTheme.NoActionBar">
<item name="android:navigationBarDividerColor" tools:targetApi="27">@color/navigationBar_color</item>
</style>
<style name="AppTheme.Main.TabText" parent="@style/TextAppearance.AppCompat.Button">
<item name="android:textAllCaps">false</item>
......
......@@ -11,7 +11,6 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/navigationBar_color"
android:fitsSystemWindows="true"
android:orientation="horizontal"
android:padding="16dp"
......
......@@ -10,7 +10,6 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/navigationBar_color"
android:minWidth="288dp"
android:orientation="vertical"
android:paddingStart="16dp"
......
......@@ -13,8 +13,7 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?actionBarSize"
android:elevation="0dp" />
android:layout_height="?actionBarSize" />
<fragment
android:name="it.diab.settings.ui.SettingsFragment"
......
<!--
Copyright (c) 2018 Bevilacqua Joey
Copyright (c) 2019 Bevilacqua Joey
Licensed under the GNU GPLv3 license
The text of the license can be found in the LICENSE file
or at https://www.gnu.org/licenses/gpl.txt
-->
<resources>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<style name="AppTheme.Main" parent="AppTheme.NoActionBar">
<item name="android:navigationBarDividerColor">@color/navigationBar_color</item>
</style>
</resources>
\ No newline at end of file
<corners
android:topLeftRadius="@dimen/app_radius"
android:topRightRadius="@dimen/app_radius" />
<solid android:color="@color/elevatedSurface" />
</shape>
\ No newline at end of file
......@@ -6,19 +6,23 @@
The text of the license can be found in the LICENSE file
or at https://www.gnu.org/licenses/gpl.txt
-->
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingDefaultResource">
<resources>
<color name="colorPrimary">#212121</color>
<color name="colorPrimaryDark">#000000</color>
<color name="colorPrimary">#121212</color>
<color name="colorPrimaryDark">#121212</color>
<color name="colorAccent">#32aaff</color>
<color name="colorAccentDark">#008cff</color>
<color name="textPrimary">#deFFFFFF</color>
<color name="textSecondary">#99FFFFFF</color>
<color name="background_activity">@android:color/black</color>
<color name="navigationBar_color">@android:color/black</color>
<color name="navigationBar_divider">@android:color/black</color>
<color name="item_circle_bg">#333333</color>
<color name="item_header_divider">#22FFFFFF</color>
<color name="elevatedSurface">#232323</color>
<color name="contentDivider">#22FFFFFF</color>
<color name="listItem_fg">?android:textColorPrimary</color>
<color name="listItem_bg">#1cffffff</color>
</resources>
\ No newline at end of file
......@@ -11,12 +11,12 @@
<style name="DiabTheme" parent="Theme.MaterialComponents">
<item name="diab_actionBarBackground">@color/colorPrimary</item>
<item name="diab_actionIconDefault">?android:attr/colorControlNormal</item>
<item name="diab_dividerColor">@color/item_header_divider</item>
<item name="diab_dividerColor">@color/contentDivider</item>
<item name="diab_editorBackground">@color/colorPrimaryDark</item>
<item name="diab_editorFormIcon">@color/colorAccent</item>
<item name="diab_importantBackground">@color/colorAccentDark</item>
<item name="diab_importantForeground">@android:color/white</item>
<item name="diab_itemBackground">@color/item_circle_bg</item>
<item name="diab_itemBackground">@color/listItem_bg</item>
<item name="diab_itemForeground">?android:textColorSecondary</item>
<item name="diab_rippleColor">@color/colorAccentLight</item>
<item name="diab_titleContrastColor">@color/colorAccent</item>
......
......@@ -9,17 +9,25 @@
<resources>
<style name="AppTheme" parent="DiabTheme">
<item name="bottomSheetDialogTheme">@style/AppTheme.BottomSheetDialog</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="dialogCornerRadius">@dimen/app_radius</item>
<item name="isLightTheme">@bool/is_light</item>
<item name="android:statusBarColor">@color/colorPrimary</item>
<item name="android:navigationBarColor">@color/navigationBar_color</item>
<item name="android:navigationBarDividerColor">@color/navigationBar_divider</item>
<item name="android:textColorPrimary">@color/textPrimary</item>
<item name="android:textColorSecondary">@color/textSecondary</item>
<item name="android:windowBackground">@color/background_activity</item>
<item name="android:windowBackground">@color/backgroundSurface</item>
<item name="android:windowLightStatusBar">@bool/is_light</item>
<item name="android:windowLightNavigationBar">@bool/is_light</item>
</style>
<style name="AppTheme.BottomSheetDialog" parent="Theme.Design.Light.BottomSheetDialog">
<item name="bottomSheetStyle">@style/AppTheme.ModalStyle</item>
<item name="android:navigationBarColor">@color/navigationBar_color</item>
<item name="android:navigationBarDividerColor">@color/navigationBar_color</item>
</style>
</resources>
\ No newline at end of file
......@@ -6,7 +6,7 @@
The text of the license can be found in the LICENSE file
or at https://www.gnu.org/licenses/gpl.txt
-->
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingDefaultResource">
<resources>
<color name="colorPrimary">#fafbfc</color>
<color name="colorPrimaryDark">#f0f1f2</color>
......@@ -17,11 +17,15 @@
<color name="textPrimary">#de000000</color>
<color name="textSecondary">#99000000</color>
<color name="background_activity">@color/colorPrimary</color>
<color name="backgroundSurface">@color/colorPrimary</color>
<color name="navigationBar_color">@android:color/white</color>
<color name="navigationBar_divider">#1f000000</color>
<color name="item_circle_bg">#EBECF0</color>
<color name="item_header_divider">#0c000000</color>
<color name="elevatedSurface">@android:color/white</color>
<color name="contentDivider">#0c000000</color>
<color name="listItem_fg">?android:textColorSecondary</color>
<color name="listItem_bg">#1c000000</color>
</resources>
......@@ -7,5 +7,5 @@
or at https://www.gnu.org/licenses/gpl.txt
-->
<resources>
<dimen name="app_radius">4dp</dimen>
<dimen name="app_radius">8dp</dimen>
</resources>
\ No newline at end of file
......@@ -6,31 +6,33 @@
The text of the license can be found in the LICENSE file
or at https://www.gnu.org/licenses/gpl.txt
-->
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="DiabTheme" parent="Theme.MaterialComponents.Light">
<item name="diab_actionBarBackground">@color/colorPrimary</item>
<item name="diab_actionIconDefault">@android:color/black</item>
<item name="diab_dividerColor">@color/item_header_divider</item>
<item name="diab_dividerColor">@color/contentDivider</item>
<item name="diab_editorBackground">@color/colorPrimaryDark</item>
<item name="diab_editorFormIcon">@color/colorAccent</item>
<item name="diab_importantBackground">@color/colorAccentDark</item>
<item name="diab_importantForeground">?android:textColorPrimaryInverse</item>
<item name="diab_itemBackground">@color/item_circle_bg</item>
<item name="diab_itemForeground">?android:textColorSecondary</item>
<item name="diab_itemBackground">@color/listItem_bg</item>
<item name="diab_itemForeground">@color/listItem_fg</item>
<item name="diab_rippleColor">@color/colorAccentLight</item>
<item name="diab_titleContrastColor">@color/colorAccent</item>
</style>
<style name="AppTheme" parent="DiabTheme">
<item name="bottomSheetDialogTheme">@style/AppTheme.BottomSheetDialog</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="dialogCornerRadius">@dimen/app_radius</item>
<item name="isLightTheme">@bool/is_light</item>
<item name="android:statusBarColor">@color/colorPrimary</item>
<item name="android:textColorPrimary">@color/textPrimary</item>
<item name="android:textColorSecondary">@color/textSecondary</item>
<item name="android:windowBackground">@color/background_activity</item>
<item name="android:windowBackground">@color/backgroundSurface</item>
<item name="android:windowLightStatusBar">@bool/is_light</item>
</style>
......@@ -42,4 +44,12 @@
<item name="android:windowAllowEnterTransitionOverlap">true</item>
<item name="android:windowAllowReturnTransitionOverlap">true</item>
</style>
<style name="AppTheme.BottomSheetDialog" parent="Theme.Design.Light.BottomSheetDialog">
<item name="bottomSheetStyle">@style/AppTheme.ModalStyle</item>
</style>
<style name="AppTheme.ModalStyle" parent="Widget.Design.BottomSheet.Modal">
<item name="android:background">@drawable/bg_bottom_sheet</item>
</style>
</resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment