OmniControl: use RRO exposed system colors
Change-Id: I051932816a8bb919e6f7dbf7cd55a3bb815dca49
diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml
index d73d5a2..b8aa29d 100644
--- a/.idea/deploymentTargetDropDown.xml
+++ b/.idea/deploymentTargetDropDown.xml
@@ -12,6 +12,6 @@
</deviceKey>
</Target>
</targetSelectedWithDropDown>
- <timeTargetWasSelectedWithDropDown value="2021-11-08T15:05:22.491286Z" />
+ <timeTargetWasSelectedWithDropDown value="2021-11-21T13:03:38.339749Z" />
</component>
</project>
\ No newline at end of file
diff --git a/app/src/main/java/org/omnirom/control/ButtonSettingsFragment.kt b/app/src/main/java/org/omnirom/control/ButtonSettingsFragment.kt
index ab8e5b1..c872783 100644
--- a/app/src/main/java/org/omnirom/control/ButtonSettingsFragment.kt
+++ b/app/src/main/java/org/omnirom/control/ButtonSettingsFragment.kt
@@ -49,15 +49,17 @@
val powerCategory: PreferenceCategory? = findPreference(CATEGORY_POWER)
if (powerCategory != null) {
val id = Resources.getSystem().getIdentifier("config_rebootActionsList", "array", "android")
- val rebootList = Resources.getSystem().getStringArray(id)
- if (rebootList.isEmpty()) {
- val advancedReboot: Preference? = findPreference(KEY_ADVANCED_REBOOT)
- if (advancedReboot != null) {
- powerCategory.removePreference(advancedReboot)
+ if (id != 0) {
+ val rebootList = Resources.getSystem().getStringArray(id)
+ if (rebootList.isEmpty()) {
+ val advancedReboot: Preference? = findPreference(KEY_ADVANCED_REBOOT)
+ if (advancedReboot != null) {
+ powerCategory.removePreference(advancedReboot)
+ }
}
- }
- if (powerCategory.preferenceCount == 0){
- // TODO
+ if (powerCategory.preferenceCount == 0) {
+ // TODO
+ }
}
}
}
diff --git a/app/src/main/res/layout/grid_item.xml b/app/src/main/res/layout/grid_item.xml
index adc88b8..8d26c0c 100644
--- a/app/src/main/res/layout/grid_item.xml
+++ b/app/src/main/res/layout/grid_item.xml
@@ -13,8 +13,8 @@
android:id="@+id/grid_item_icon"
android:layout_width="@dimen/grid_item_icon_size"
android:layout_height="@dimen/grid_item_icon_size"
- android:layout_marginStart="@dimen/grid_icon_margin_start"
- android:layout_gravity="center_vertical" />
+ android:layout_gravity="center_vertical"
+ android:layout_marginStart="@dimen/grid_icon_margin_start" />
<LinearLayout
android:layout_width="0dp"
@@ -29,15 +29,19 @@
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
+ android:ellipsize="end"
android:gravity="center_vertical"
- android:textAppearance="@style/Theme.OmniControl.GridItem.TitleTextStyle"/>
+ android:maxLines="1"
+ android:textAppearance="@style/Theme.OmniControl.GridItem.TitleTextStyle" />
<TextView
android:id="@+id/grid_item_summary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:ellipsize="end"
android:gravity="center_vertical"
- android:textAppearance="@style/Theme.OmniControl.GridItem.SummaryTextStyle"/>
+ android:maxLines="1"
+ android:textAppearance="@style/Theme.OmniControl.GridItem.SummaryTextStyle" />
</LinearLayout>
</LinearLayout>
diff --git a/app/src/main/res/layout/settings_activity.xml b/app/src/main/res/layout/settings_activity.xml
index 8d2b0f8..cecfcbc 100644
--- a/app/src/main/res/layout/settings_activity.xml
+++ b/app/src/main/res/layout/settings_activity.xml
@@ -35,14 +35,18 @@
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
+ android:ellipsize="end"
android:gravity="center_vertical"
+ android:maxLines="1"
android:textAppearance="@style/Theme.OmniControl.TitleTextStyle" />
<TextView
android:id="@+id/fragment_summary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:ellipsize="end"
android:gravity="center_vertical"
+ android:maxLines="1"
android:textAppearance="@style/Theme.OmniControl.GridItem.SummaryTextStyle" />
</LinearLayout>
diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml
index 9f5a30e..70a2802 100644
--- a/app/src/main/res/values-night/colors.xml
+++ b/app/src/main/res/values-night/colors.xml
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <color name="colorPrimary">@color/system_neutral1_900</color>
- <color name="colorPrimaryDark">@color/system_neutral1_900</color>
- <color name="main_background_light">@color/system_neutral1_900</color>
- <color name="grid_shape_background">@color/main_background_light</color>
-
+ <color name="colorPrimary">@android:color/system_neutral1_900</color>
+ <color name="colorPrimaryDark">@android:color/system_neutral1_900</color>
+ <color name="colorAccent">@android:color/system_accent1_100</color>
</resources>
\ No newline at end of file
diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml
index 74a3cb9..c90aed5 100644
--- a/app/src/main/res/values-night/themes.xml
+++ b/app/src/main/res/values-night/themes.xml
@@ -3,29 +3,15 @@
<style name="Theme.OmniControl" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimary</item>
- <item name="android:windowBackground">@color/main_background_light</item>
+ <item name="android:windowBackground">@color/colorPrimary</item>
<item name="android:windowLightNavigationBar">false</item>
<item name="android:windowLightStatusBar">false</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="alertDialogTheme">@style/Theme.AlertDialog</item>
- <item name="colorAccent">@*android:color/accent_device_default_dark</item>
+ <item name="colorAccent">@color/colorAccent</item>
<item name="android:windowSplashScreenIconBackgroundColor">@color/ic_launcher_background</item>
</style>
- <style name="Theme.AlertDialog" parent="Theme.MaterialComponents.DayNight.Dialog.Alert">
- <item name="colorAccent">@*android:color/accent_device_default_dark</item>
- <item name="buttonBarNegativeButtonStyle">@style/NegativeButtonStyle</item>
- <item name="buttonBarPositiveButtonStyle">@style/PositiveButtonStyle</item>
- </style>
-
- <style name="NegativeButtonStyle" parent="Widget.MaterialComponents.Button.TextButton.Dialog">
- <item name="android:textColor">@*android:color/accent_device_default_dark</item>
- </style>
-
- <style name="PositiveButtonStyle" parent="Widget.MaterialComponents.Button.TextButton.Dialog">
- <item name="android:textColor">@*android:color/accent_device_default_dark</item>
- </style>
-
</resources>
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 26ef2e9..3676baa 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -1,19 +1,7 @@
<?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="white">#FFFFFFFF</color>
- <color name="omni_logo_color">#a1c729</color>
- <color name="colorPrimary">@color/system_neutral1_50</color>
- <color name="colorPrimaryDark">@color/system_neutral1_50</color>
- <color name="main_background_light">@color/system_neutral1_50</color>
- <color name="grid_shape_background">@color/main_background_light</color>
- <color name="material_grey_950">#ff101010</color>
- <color name="system_neutral1_800">#2E3133</color>
- <color name="system_neutral1_900">#191C1E</color>
- <color name="system_neutral1_50">#F0F0F3</color>
+ <color name="colorPrimary">@android:color/system_neutral1_50</color>
+ <color name="colorPrimaryDark">@android:color/system_neutral1_50</color>
+ <color name="colorAccent">@android:color/system_accent1_600</color>
+ <color name="grid_shape_background">@color/colorPrimary</color>
</resources>
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 66c1d0b..bf47cb3 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -37,7 +37,7 @@
<string name="status_bar_clock_seconds_summary">Show seconds on status bar clock</string>
<string name="button_settings_title">Buttons</string>
- <string name="button_settings_summary"></string>
+ <string name="button_settings_summary">Power and volume button options</string>
<string name="global_actions_power_title">Power</string>
<string name="global_actions_advanced_reboot_title">Enable advanced restart</string>
<string name="global_actions_advanced_reboot_summary_new">Show more options in restart menu if not locked</string>
diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml
index 335c1f3..ead2a5a 100644
--- a/app/src/main/res/values/themes.xml
+++ b/app/src/main/res/values/themes.xml
@@ -2,14 +2,14 @@
<style name="Theme.OmniControl" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimary</item>
- <item name="android:windowBackground">@color/main_background_light</item>
+ <item name="android:windowBackground">@color/colorPrimary</item>
<item name="android:windowLightNavigationBar">true</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="alertDialogTheme">@style/Theme.AlertDialog</item>
- <item name="colorAccent">@*android:color/accent_device_default_light</item>
+ <item name="colorAccent">@color/colorAccent</item>
<item name="android:windowSplashScreenIconBackgroundColor">@color/ic_launcher_background</item>
</style>
@@ -25,16 +25,16 @@
</style>
<style name="Theme.AlertDialog" parent="Theme.MaterialComponents.DayNight.Dialog.Alert">
- <item name="colorAccent">@*android:color/accent_device_default_light</item>
+ <item name="colorAccent">@color/colorAccent</item>
<item name="buttonBarNegativeButtonStyle">@style/NegativeButtonStyle</item>
<item name="buttonBarPositiveButtonStyle">@style/PositiveButtonStyle</item>
</style>
<style name="NegativeButtonStyle" parent="Widget.MaterialComponents.Button.TextButton.Dialog">
- <item name="android:textColor">@*android:color/accent_device_default_light</item>
+ <item name="android:textColor">@color/colorAccent</item>
</style>
<style name="PositiveButtonStyle" parent="Widget.MaterialComponents.Button.TextButton.Dialog">
- <item name="android:textColor">@*android:color/accent_device_default_light</item>
+ <item name="android:textColor">@color/colorAccent</item>
</style>
</resources>
\ No newline at end of file