aboutsummaryrefslogtreecommitdiffstats
path: root/main/res/values/themes.xml
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2014-04-20 21:38:19 +0200
committerArne Schwabe <arne@rfc2549.org>2014-05-17 13:08:14 +0200
commitbe26c1845210a1c8824677ed6e2d093073ea5c84 (patch)
tree81d02773f4fd9edc5d05b44c770be89994a9c207 /main/res/values/themes.xml
parent496878826d638367c129b02e66f992202e0d36c9 (diff)
downloadcgeo-be26c1845210a1c8824677ed6e2d093073ea5c84.zip
cgeo-be26c1845210a1c8824677ed6e2d093073ea5c84.tar.gz
cgeo-be26c1845210a1c8824677ed6e2d093073ea5c84.tar.bz2
Implement ActionBar using AppCompat in cgeo
This a first version of an ActionBar implementation with following properties: - The application should be usuable (there still might be bugs left from the conversation to Action) - Provides a more modern feeling on all devices - gets rid of the "dots of shame" on Android 3.0+ devices - The Maps classes MUST inherit from Activity instead of ActionBarActivity. There these classes use the old ActionBar on Android 2.3 devices and the real ActionBar on 3.0+ - This can be fixed when cgeo is ported to Google Maps API v2.0 API which usesFragment - The Dialog classes (CachePopup and WaypointPopup) have been converted to DialogFragments - The AppCombat themes provide no Theme.Dialog theme - this will later ease using these Fragment in other Activities - Use an almost empty activity which just shows the DialogFragment - Use the 'old' ActionBar but which overflow menu button to fit into Holo Design Style - Using a real ActionBar for Dialogs is not really support by Android and trying to force the frame into showing an Actionbar on a dialog leeds to strange bugs/effects - Most of the icon are still the Android 2.3 Menu Icon. These need to be replaced with Holo Style Icons - for most menu icon the ifRoom and/or withText attributes should be reviewed and set - The ActionBar of the main Activity is transparent. This is more or less by accident but looks good - Review Up Action of activities. Is going back to Main Activity always the semantically right thing to do? - Shortpress/Longpress on the Actionbars Compass Icon for primary/secondary Navigation clashes the normal ActionBar behaviour of long pressing to show the text of the action This commit contains many fixes and suggestions from rsudev
Diffstat (limited to 'main/res/values/themes.xml')
-rw-r--r--main/res/values/themes.xml63
1 files changed, 54 insertions, 9 deletions
diff --git a/main/res/values/themes.xml b/main/res/values/themes.xml
index ed64ef5..c5bdae1 100644
--- a/main/res/values/themes.xml
+++ b/main/res/values/themes.xml
@@ -1,15 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <style name="cgeo_main" parent="android:style/Theme.Wallpaper.NoTitleBar">
+
+ <style name="cgeo_main" parent="@style/Theme.AppCompat">
+
+ <!-- copy the style elements of the Wallpaper theme since AppCombat has no Wallpaper theme -->
+ <item name="android:windowBackground">@android:color/transparent</item>
+ <item name="android:colorBackgroundCacheHint">@null</item>
+ <item name="android:windowShowWallpaper">true</item>
+
<!-- system elements -->
<item name="android:windowContentOverlay">@null</item>
+
+ </style>
+
+ <style name="cgeo" parent="@style/Theme.AppCompat">
+
+
+ <item name="android:buttonStyle">@style/button</item>
+ <item name="android:editTextStyle">@style/edittext</item>
+ <item name="android:windowContentOverlay">@null</item>
+
+ <!-- own values: colors -->
+ <item name="just_color">@color/just_black</item>
+ <item name="text_color_link">@color/link</item>
+ <item name="button_color_enabled">@color/button_enabled</item>
+ <item name="button_color_disabled">@color/button_disabled</item>
</style>
- <style name="cgeo" parent="android:style/Theme.NoTitleBar">
- <!-- system elements -->
+ <!-- Identical to cgeo aside from different parent style -->
+ <style name="cgeo_light" parent="@style/Theme.AppCompat.Light.DarkActionBar">
+
+
<item name="android:buttonStyle">@style/button</item>
<item name="android:editTextStyle">@style/edittext</item>
<item name="android:windowContentOverlay">@null</item>
@@ -21,6 +45,8 @@
<item name="button_color_disabled">@color/button_disabled</item>
</style>
+
+
<style name="dark" parent="cgeo">
<!-- own values: colors -->
@@ -50,7 +76,7 @@
<item name="compass">0</item>
</style>
- <style name="light" parent="cgeo">
+ <style name="light" parent="cgeo_light">
<!-- own values: colors -->
<item name="android:windowBackground">@color/just_white</item>
@@ -80,16 +106,35 @@
<item name="compass">1</item>
</style>
- <style name="cgeo_popup" parent="android:style/Theme.Dialog">
+
+ <style name="Theme.AppCompat.Translucent.Light" parent="Theme.AppCompat.Light.DarkActionBar">
+ <item name="android:windowBackground">@android:color/transparent</item>
+ <item name="android:colorBackgroundCacheHint">@null</item>
+ <item name="android:windowIsTranslucent">true</item>
+ <item name="android:windowAnimationStyle">@android:style/Animation</item>
+ </style>
+
+ <style name="Theme.AppCompat.Translucent" parent="Theme.AppCompat">
+ <item name="android:windowBackground">@android:color/transparent</item>
+ <item name="android:colorBackgroundCacheHint">@null</item>
+ <item name="android:windowIsTranslucent">true</item>
+ <item name="android:windowAnimationStyle">@android:style/Animation</item>
+ </style>
+
+ <style name="cgeo_popup" parent="Theme.AppCompat.Translucent.Light">
<!-- system elements -->
<item name="android:buttonStyle">@style/button</item>
<item name="android:editTextStyle">@style/edittext</item>
<item name="android:windowNoTitle">true</item>
- </style>
+ </style>
<!-- TODO: Popup probably doesn't need all these fields set. Should delete unnecessary ones. -->
- <style name="popup_dark" parent="cgeo_popup">
+ <style name="popup_dark" parent="Theme.AppCompat.Translucent">
+ <!-- system elements -->
+ <item name="android:buttonStyle">@style/button</item>
+ <item name="android:editTextStyle">@style/edittext</item>
+ <item name="android:windowNoTitle">true</item>
<!-- own values: colors -->
<item name="just_color">@color/just_black</item>
@@ -153,7 +198,7 @@
<item name="compass">1</item>
</style>
- <style name="settings" parent="android:Theme">
+ <style name="settings" parent="@style/Theme.AppCompat">
<item name="settings_cloud">@drawable/settings_cloud_white</item>
<item name="settings_details">@drawable/settings_details_white</item>
<item name="settings_eye">@drawable/settings_eye_white</item>
@@ -165,7 +210,7 @@
<item name="settings_info_icon">@drawable/settings_info_icon_white</item>
</style>
- <style name="settings.light" parent="android:Theme.Light">
+ <style name="settings.light" parent="@style/Theme.AppCompat.Light">
<item name="settings_cloud">@drawable/settings_cloud_black</item>
<item name="settings_details">@drawable/settings_details_black</item>
<item name="settings_eye">@drawable/settings_eye_black</item>