1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-13 12:14:19 +02:00

switch to material3 themes

This commit is contained in:
oliexdev
2023-07-22 09:54:32 +02:00
parent 16336cc04e
commit 252a5b7b51
12 changed files with 207 additions and 84 deletions

View File

@@ -7,7 +7,7 @@
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="29"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
@@ -32,7 +32,6 @@
android:theme="@style/AppTheme" >
<activity
android:name=".gui.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
android:exported="true">
<intent-filter>

View File

@@ -166,7 +166,7 @@ public class MainActivity extends AppCompatActivity
if (Build.VERSION.SDK_INT >= 29) {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
} else {
setTheme(R.style.AppTheme_Dark);
setTheme(R.style.AppTheme);
}
}

View File

@@ -61,7 +61,6 @@ public class ChartActionBarView extends HorizontalScrollView {
actionBarView = new LinearLayout(getContext());
actionBarView.setOrientation(LinearLayout.HORIZONTAL);
actionBarView.setBackgroundColor(ColorUtil.COLOR_BLACK);
measurementViews = MeasurementView.getMeasurementList(
getContext(), MeasurementView.DateTimeOrder.NONE);

View File

@@ -28,7 +28,7 @@ public class AppIntroActivity extends AppIntro {
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setBarColor(getResources().getColor(R.color.blue_normal));
setBarColor(getResources().getColor(R.color.seed));
setSkipButtonEnabled(true);

View File

@@ -3,7 +3,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@color/blue_pressed">
android:background="@color/seed">
<ImageView
android:id="@+id/profileImageView"

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/blue_pressed"/>
<background android:drawable="@color/seed"/>
<foreground android:drawable="@drawable/ic_launcher_openscale_light"/>
<monochrome android:drawable="@drawable/ic_notification_openscale_monochrome"/>
</adaptive-icon>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/blue_pressed"/>
<background android:drawable="@color/seed"/>
<foreground android:drawable="@drawable/ic_launcher_openscale_pro"/>
<monochrome android:drawable="@drawable/ic_notification_openscale_monochrome"/>
</adaptive-icon>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/blue_pressed"/>
<background android:drawable="@color/seed"/>
<foreground android:drawable="@drawable/ic_launcher_openscale"/>
<monochrome android:drawable="@drawable/ic_notification_openscale_monochrome"/>
</adaptive-icon>

View File

@@ -0,0 +1,69 @@
<resources>
<style name="AppTheme" parent="Theme.Material3.Dark.NoActionBar">
<item name="colorPrimary">@color/md_theme_dark_primary</item>
<item name="colorOnPrimary">@color/md_theme_dark_onPrimary</item>
<item name="colorPrimaryContainer">@color/md_theme_dark_primaryContainer</item>
<item name="colorOnPrimaryContainer">@color/md_theme_dark_onPrimaryContainer</item>
<item name="colorSecondary">@color/md_theme_dark_secondary</item>
<item name="colorOnSecondary">@color/md_theme_dark_onSecondary</item>
<item name="colorSecondaryContainer">@color/md_theme_dark_secondaryContainer</item>
<item name="colorOnSecondaryContainer">@color/md_theme_dark_onSecondaryContainer</item>
<item name="colorTertiary">@color/md_theme_dark_tertiary</item>
<item name="colorOnTertiary">@color/md_theme_dark_onTertiary</item>
<item name="colorTertiaryContainer">@color/md_theme_dark_tertiaryContainer</item>
<item name="colorOnTertiaryContainer">@color/md_theme_dark_onTertiaryContainer</item>
<item name="colorError">@color/md_theme_dark_error</item>
<item name="colorErrorContainer">@color/md_theme_dark_errorContainer</item>
<item name="colorOnError">@color/md_theme_dark_onError</item>
<item name="colorOnErrorContainer">@color/md_theme_dark_onErrorContainer</item>
<item name="android:colorBackground">@color/md_theme_dark_background</item>
<item name="colorOnBackground">@color/md_theme_dark_onBackground</item>
<item name="colorSurface">@color/md_theme_dark_surface</item>
<item name="colorOnSurface">@color/md_theme_dark_onSurface</item>
<item name="colorSurfaceVariant">@color/md_theme_dark_surfaceVariant</item>
<item name="colorOnSurfaceVariant">@color/md_theme_dark_onSurfaceVariant</item>
<item name="colorOutline">@color/md_theme_dark_outline</item>
<item name="colorOnSurfaceInverse">@color/md_theme_dark_inverseOnSurface</item>
<item name="colorSurfaceInverse">@color/md_theme_dark_inverseSurface</item>
<item name="colorPrimaryInverse">@color/md_theme_dark_inversePrimary</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<!-- Style for an Preference Entry -->
<style name="AppPreference">
<item name="android:layout">@layout/preference_material</item>
</style>
<!-- Style for a DialogPreference Entry -->
<style name="AppPreference.DialogPreference">
<item name="positiveButtonText">@android:string/ok</item>
<item name="negativeButtonText">@android:string/cancel</item>
</style>
<declare-styleable name="StickyHeaderTableView">
<attr name="shtv_textLabelColor" format="color" />
<attr name="shtv_textLabelSize" format="dimension" />
<attr name="shtv_textHeaderColor" format="color" />
<attr name="shtv_textHeaderSize" format="dimension" />
<attr name="shtv_dividerColor" format="dimension" />
<attr name="shtv_dividerThickness" format="dimension" />
<attr name="shtv_contentCellFillColor" format="color" />
<attr name="shtv_headerCellFillColor" format="color" />
<attr name="shtv_cellPadding" format="dimension" />
<attr name="shtv_isDisplayLeftHeadersVertically" format="boolean" />
<attr name="shtv_isWrapHeightOfEachRow" format="boolean" />
<attr name="shtv_isWrapWidthOfEachColumn" format="boolean" />
<attr name="shtv_is2DScrollEnabled" format="boolean" />
</declare-styleable>
</resources>

View File

@@ -1,12 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="blue_pressed">@android:color/holo_blue_dark</color>
<color name="blue_normal">@android:color/holo_blue_light</color>
<color name="gray_disabled">#cccccc</color>
<color name="seed">#0099cc</color>
<color name="md_theme_light_primary">#004C68</color>
<color name="md_theme_light_onPrimary">#FFFFFF</color>
<color name="md_theme_light_primaryContainer">#C3E8FF</color>
<color name="md_theme_light_onPrimaryContainer">#001E2C</color>
<color name="md_theme_light_secondary">#4E616D</color>
<color name="md_theme_light_onSecondary">#FFFFFF</color>
<color name="md_theme_light_secondaryContainer">#006685</color>
<color name="md_theme_light_onSecondaryContainer">#091E28</color>
<color name="md_theme_light_tertiary">#006685</color>
<color name="md_theme_light_onTertiary">#FFFFFF</color>
<color name="md_theme_light_tertiaryContainer">#BFE9FF</color>
<color name="md_theme_light_onTertiaryContainer">#001F2A</color>
<color name="md_theme_light_error">#BA1A1A</color>
<color name="md_theme_light_errorContainer">#FFDAD6</color>
<color name="md_theme_light_onError">#FFFFFF</color>
<color name="md_theme_light_onErrorContainer">#410002</color>
<color name="md_theme_light_background">#FBFCFE</color>
<color name="md_theme_light_onBackground">#191C1E</color>
<color name="md_theme_light_surface">#FBFCFE</color>
<color name="md_theme_light_onSurface">#191C1E</color>
<color name="md_theme_light_surfaceVariant">#DCE3E9</color>
<color name="md_theme_light_onSurfaceVariant">#41484D</color>
<color name="md_theme_light_outline">#71787D</color>
<color name="md_theme_light_inverseOnSurface">#F0F1F3</color>
<color name="md_theme_light_inverseSurface">#2E3133</color>
<color name="md_theme_light_inversePrimary">#78D1FF</color>
<color name="md_theme_light_shadow">#000000</color>
<color name="md_theme_light_surfaceTint">#006689</color>
<color name="md_theme_light_outlineVariant">#C0C7CD</color>
<color name="md_theme_light_scrim">#000000</color>
<color name="primaryColor">#000000</color>
<color name="primaryLightColor">@android:color/holo_blue_light</color>
<color name="primaryDarkColor">#000000</color>
<color name="md_theme_dark_primary">#000000</color>
<color name="md_theme_dark_onPrimary">#006689</color>
<color name="md_theme_dark_primaryContainer">#004C68</color>
<color name="md_theme_dark_onPrimaryContainer">#C3E8FF</color>
<color name="md_theme_dark_secondary">#B5C9D7</color>
<color name="md_theme_dark_onSecondary">#20333D</color>
<color name="md_theme_dark_secondaryContainer">#364955</color>
<color name="md_theme_dark_onSecondaryContainer">#D1E5F3</color>
<color name="md_theme_dark_tertiary">#6DD2FF</color>
<color name="md_theme_dark_onTertiary">#003547</color>
<color name="md_theme_dark_tertiaryContainer">#004D65</color>
<color name="md_theme_dark_onTertiaryContainer">#BFE9FF</color>
<color name="md_theme_dark_error">#FFB4AB</color>
<color name="md_theme_dark_errorContainer">#93000A</color>
<color name="md_theme_dark_onError">#690005</color>
<color name="md_theme_dark_onErrorContainer">#FFDAD6</color>
<color name="md_theme_dark_background">#191C1E</color>
<color name="md_theme_dark_onBackground">#E1E2E5</color>
<color name="md_theme_dark_surface">#191C1E</color>
<color name="md_theme_dark_onSurface">#E1E2E5</color>
<color name="md_theme_dark_surfaceVariant">#41484D</color>
<color name="md_theme_dark_onSurfaceVariant">#C0C7CD</color>
<color name="md_theme_dark_outline">#8A9297</color>
<color name="md_theme_dark_inverseOnSurface">#191C1E</color>
<color name="md_theme_dark_inverseSurface">#E1E2E5</color>
<color name="md_theme_dark_inversePrimary">#006689</color>
<color name="md_theme_dark_shadow">#000000</color>
<color name="md_theme_dark_surfaceTint">#78D1FF</color>
<color name="md_theme_dark_outlineVariant">#41484D</color>
<color name="md_theme_dark_scrim">#000000</color>
<color name="widgetTextColor">#555555</color>
</resources>

View File

@@ -1,69 +0,0 @@
<resources>
<!-- Application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
<item name="colorPrimary">@color/primaryColor</item>
<item name="colorOnPrimary">@color/primaryLightColor</item>
<item name="colorPrimaryDark">@color/primaryDarkColor</item>
<item name="colorAccent">@color/primaryLightColor</item>
<item name="materialCalendarTheme">@style/MaterialCalendarTheme</item>
</style>
<style name="AppTheme_Dark" parent="Theme.MaterialComponents.NoActionBar">
<item name="colorPrimary">@color/primaryColor</item>
<item name="colorOnPrimary">@color/primaryLightColor</item>
<item name="colorPrimaryDark">@color/primaryDarkColor</item>
<item name="colorAccent">@color/primaryLightColor</item>
<item name="materialCalendarTheme">@style/MaterialCalendarTheme</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="MaterialCalendarTheme" parent="ThemeOverlay.MaterialComponents.MaterialCalendar">
<item name="buttonBarPositiveButtonStyle">@style/CalendarPositiveButtonStyle</item>
<item name="buttonBarNegativeButtonStyle">@style/CalendarNegativeButtonStyle</item>
</style>
<style name="CalendarPositiveButtonStyle" parent="@style/Widget.MaterialComponents.Button.TextButton.Dialog">
<item name="android:textColor">@color/primaryLightColor</item>
</style>
<style name="CalendarNegativeButtonStyle" parent="@style/Widget.MaterialComponents.Button.TextButton.Dialog">
<item name="android:textColor">@color/primaryLightColor</item>
</style>
<!-- Style for an Preference Entry -->
<style name="AppPreference">
<item name="android:layout">@layout/preference_material</item>
</style>
<!-- Style for a DialogPreference Entry -->
<style name="AppPreference.DialogPreference">
<item name="positiveButtonText">@android:string/ok</item>
<item name="negativeButtonText">@android:string/cancel</item>
</style>
<declare-styleable name="StickyHeaderTableView">
<attr name="shtv_textLabelColor" format="color" />
<attr name="shtv_textLabelSize" format="dimension" />
<attr name="shtv_textHeaderColor" format="color" />
<attr name="shtv_textHeaderSize" format="dimension" />
<attr name="shtv_dividerColor" format="dimension" />
<attr name="shtv_dividerThickness" format="dimension" />
<attr name="shtv_contentCellFillColor" format="color" />
<attr name="shtv_headerCellFillColor" format="color" />
<attr name="shtv_cellPadding" format="dimension" />
<attr name="shtv_isDisplayLeftHeadersVertically" format="boolean" />
<attr name="shtv_isWrapHeightOfEachRow" format="boolean" />
<attr name="shtv_isWrapWidthOfEachColumn" format="boolean" />
<attr name="shtv_is2DScrollEnabled" format="boolean" />
</declare-styleable>
</resources>

View File

@@ -0,0 +1,69 @@
<resources>
<style name="AppTheme" parent="Theme.Material3.Light.NoActionBar">
<item name="colorPrimary">@color/md_theme_light_primary</item>
<item name="colorOnPrimary">@color/md_theme_light_onPrimary</item>
<item name="colorPrimaryContainer">@color/md_theme_light_primaryContainer</item>
<item name="colorOnPrimaryContainer">@color/md_theme_light_onPrimaryContainer</item>
<item name="colorSecondary">@color/md_theme_light_secondary</item>
<item name="colorOnSecondary">@color/md_theme_light_onSecondary</item>
<item name="colorSecondaryContainer">@color/md_theme_light_secondaryContainer</item>
<item name="colorOnSecondaryContainer">@color/md_theme_light_onSecondaryContainer</item>
<item name="colorTertiary">@color/md_theme_light_tertiary</item>
<item name="colorOnTertiary">@color/md_theme_light_onTertiary</item>
<item name="colorTertiaryContainer">@color/md_theme_light_tertiaryContainer</item>
<item name="colorOnTertiaryContainer">@color/md_theme_light_onTertiaryContainer</item>
<item name="colorError">@color/md_theme_light_error</item>
<item name="colorErrorContainer">@color/md_theme_light_errorContainer</item>
<item name="colorOnError">@color/md_theme_light_onError</item>
<item name="colorOnErrorContainer">@color/md_theme_light_onErrorContainer</item>
<item name="android:colorBackground">@color/md_theme_light_background</item>
<item name="colorOnBackground">@color/md_theme_light_onBackground</item>
<item name="colorSurface">@color/md_theme_light_surface</item>
<item name="colorOnSurface">@color/md_theme_light_onSurface</item>
<item name="colorSurfaceVariant">@color/md_theme_light_surfaceVariant</item>
<item name="colorOnSurfaceVariant">@color/md_theme_light_onSurfaceVariant</item>
<item name="colorOutline">@color/md_theme_light_outline</item>
<item name="colorOnSurfaceInverse">@color/md_theme_light_inverseOnSurface</item>
<item name="colorSurfaceInverse">@color/md_theme_light_inverseSurface</item>
<item name="colorPrimaryInverse">@color/md_theme_light_inversePrimary</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<!-- Style for an Preference Entry -->
<style name="AppPreference">
<item name="android:layout">@layout/preference_material</item>
</style>
<!-- Style for a DialogPreference Entry -->
<style name="AppPreference.DialogPreference">
<item name="positiveButtonText">@android:string/ok</item>
<item name="negativeButtonText">@android:string/cancel</item>
</style>
<declare-styleable name="StickyHeaderTableView">
<attr name="shtv_textLabelColor" format="color" />
<attr name="shtv_textLabelSize" format="dimension" />
<attr name="shtv_textHeaderColor" format="color" />
<attr name="shtv_textHeaderSize" format="dimension" />
<attr name="shtv_dividerColor" format="dimension" />
<attr name="shtv_dividerThickness" format="dimension" />
<attr name="shtv_contentCellFillColor" format="color" />
<attr name="shtv_headerCellFillColor" format="color" />
<attr name="shtv_cellPadding" format="dimension" />
<attr name="shtv_isDisplayLeftHeadersVertically" format="boolean" />
<attr name="shtv_isWrapHeightOfEachRow" format="boolean" />
<attr name="shtv_isWrapWidthOfEachColumn" format="boolean" />
<attr name="shtv_is2DScrollEnabled" format="boolean" />
</declare-styleable>
</resources>