diff options
-rw-r--r-- | main/res/menu/map_activity.xml | 5 | ||||
-rw-r--r-- | main/res/values-v11/themes.xml | 22 | ||||
-rw-r--r-- | main/res/values-v14/themes.xml | 9 | ||||
-rw-r--r-- | main/res/values/attrs.xml | 3 | ||||
-rw-r--r-- | main/res/values/themes.xml | 77 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/activity/ActivityMixin.java | 5 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/maps/CGeoMap.java | 4 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/ui/dialog/CoordinatesInputDialog.java | 5 |
8 files changed, 86 insertions, 44 deletions
diff --git a/main/res/menu/map_activity.xml b/main/res/menu/map_activity.xml index f232fc4..2b2f1eb 100644 --- a/main/res/menu/map_activity.xml +++ b/main/res/menu/map_activity.xml @@ -11,6 +11,7 @@ <item android:id="@+id/menu_select_mapview" android:icon="@drawable/ic_menu_mapmode" + android:showAsAction="ifRoom|withText" android:title="@string/map_view_map" app:showAsAction="ifRoom|withText"> <menu> @@ -23,18 +24,21 @@ <item android:id="@+id/menu_map_live" android:icon="@drawable/ic_menu_refresh" + android:showAsAction="ifRoom|withText" android:title="@string/map_live_disable" app:showAsAction="ifRoom|withText"> </item> <item android:id="@+id/menu_store_caches" android:icon="@drawable/ic_menu_set_as" + android:showAsAction="ifRoom|withText" android:title="@string/caches_store_offline" app:showAsAction="ifRoom|withText"> </item> <item android:id="@+id/submenu_modes" android:icon="@drawable/ic_menu_mark" + android:showAsAction="ifRoom|withText" android:title="@string/map_modes" app:showAsAction="ifRoom|withText"> <menu> @@ -64,6 +68,7 @@ <item android:id="@+id/menu_theme_mode" android:icon="@drawable/ic_menu_preferences" + android:showAsAction="ifRoom|withText" android:title="@string/map_theme_select" app:showAsAction="ifRoom|withText"> </item> diff --git a/main/res/values-v11/themes.xml b/main/res/values-v11/themes.xml new file mode 100644 index 0000000..585f669 --- /dev/null +++ b/main/res/values-v11/themes.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Holo Style is only available for ICS+ --> + + <style name="cgeo.Widget.AppCompat.Base.ProgressBar.Medium" parent="android:Widget.Holo.ProgressBar"> + <item name="android:minWidth">32dip</item> + <item name="android:maxWidth">32dip</item> + <item name="android:minHeight">32dip</item> + <item name="android:maxHeight">32dip</item> + </style> + + <style name="cgeo_light" parent="cgeo.base.light"> + <item name="actionBarStyle">@style/cgeo.ActionBarStyle.Light.Inverse</item> + <item name="android:actionBarStyle" >@style/cgeo.ActionBarStyle.Light.Inverse</item> + </style> + + <style name="cgeo" parent="cgeo.base"> + <item name="android:actionBarStyle">@style/cgeo.ActionBarStyle</item> + </style> + + +</resources>
\ No newline at end of file diff --git a/main/res/values-v14/themes.xml b/main/res/values-v14/themes.xml deleted file mode 100644 index 1c45e26..0000000 --- a/main/res/values-v14/themes.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <!-- Holo Style is only available for ICS+ --> - - <style name="cgeo.ActionBarStyle" parent="Widget.AppCompat.Base.ActionBar"> - <item name="android:indeterminateProgressStyle">@android:style/Widget.Holo.ProgressBar.Small</item> - </style> - -</resources>
\ No newline at end of file diff --git a/main/res/values/attrs.xml b/main/res/values/attrs.xml index be33f09..d4050c9 100644 --- a/main/res/values/attrs.xml +++ b/main/res/values/attrs.xml @@ -24,9 +24,6 @@ <attr name="input" format="integer" /> <attr name="inventory" format="integer" /> <attr name="favorite" format="integer" /> - <attr name="favorite_r" format="integer" /> - <attr name="favorite_o" format="integer" /> - <attr name="favorite_g" format="integer" /> <attr name="close" format="integer" /> <attr name="log_img_icon" format="integer" /> <attr name="actionbar_compass" format="integer" /> diff --git a/main/res/values/themes.xml b/main/res/values/themes.xml index 6c76a8b..749cd48 100644 --- a/main/res/values/themes.xml +++ b/main/res/values/themes.xml @@ -18,7 +18,10 @@ <item name="android:windowContentOverlay">@null</item> <item name="actionBarStyle">@style/cgeo_main.ActionBarStyle</item> - </style> + <!-- KitKat's transperent navigation --> + <item name="android:fitsSystemWindows">true</item> + <item name="android:windowTranslucentNavigation" tools:ignore="NewApi">true</item> + </style> <style name="cgeo_main" parent="cgeo_main.base"> @@ -26,42 +29,40 @@ <item name="android:actionBarStyle" tools:ignore="NewApi">@style/cgeo_main.ActionBarStyle</item> </style> - <style name="cgeo.Widget.AppCompat.Base.ProgressBar.Small" parent="android:Widget.ProgressBar.Small"> - <item name="background">@color/just_white</item> + <style name="cgeo.Widget.AppCompat.Base.ProgressBar.Medium" parent="android:Widget.ProgressBar"> + <item name="android:minWidth">32dip</item> + <item name="android:maxWidth">32dip</item> + <item name="android:minHeight">32dip</item> + <item name="android:maxHeight">32dip</item> </style> <style name="cgeo.ActionBarStyle" parent="Widget.AppCompat.Base.ActionBar"> - <item name="indeterminateProgressStyle">@style/cgeo.Widget.AppCompat.Base.ProgressBar.Small</item> - <item name="android:indeterminateProgressStyle" tools:ignore="NewApi">@style/cgeo.Widget.AppCompat.Base.ProgressBar.Small</item> - + <item name="indeterminateProgressStyle">@style/cgeo.Widget.AppCompat.Base.ProgressBar.Medium</item> + <item name="android:indeterminateProgressStyle" tools:ignore="NewApi">@style/cgeo.Widget.AppCompat.Base.ProgressBar.Medium</item> </style> - <style name="cgeo.base" parent="@style/Theme.AppCompat"> + <style name="cgeo.ActionBarStyle.Light.Inverse" parent="Widget.AppCompat.Light.Base.ActionBar.Solid.Inverse"> + <item name="indeterminateProgressStyle">@style/cgeo.Widget.AppCompat.Base.ProgressBar.Medium</item> + <item name="android:indeterminateProgressStyle" tools:ignore="NewApi">@style/cgeo.Widget.AppCompat.Base.ProgressBar.Medium</item> + </style> + <style name="cgeo.base" parent="@style/Theme.AppCompat"> <item name="android:buttonStyle">@style/button</item> <item name="android:editTextStyle">@style/edittext</item> <item name="android:windowContentOverlay">@null</item> + <item name="actionBarStyle">@style/cgeo.ActionBarStyle</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="cgeo.base"> - <item name="actionBarStyle">@style/cgeo.ActionBarStyle</item> - <item name="android:actionBarStyle" tools:ignore="NewApi">@style/cgeo.ActionBarStyle</item> - </style> - - - - - <!-- Identical to cgeo aside from different parent style --> - <style name="cgeo_light" parent="@style/Theme.AppCompat.Light.DarkActionBar"> + <!-- Identical to cgeo.base aside from different parent style and bug fixes--> + <style name="cgeo.base.light" parent="@style/Theme.AppCompat.Light.DarkActionBar"> <!-- For some reason we get the non inversed texts here (bug in abc?), explicitly set text styles --> <item name="titleTextStyle">@style/TextAppearance.AppCompat.Widget.ActionMode.Title.Inverse</item> @@ -71,18 +72,46 @@ <item name="android:buttonStyle">@style/button</item> <item name="android:editTextStyle">@style/edittext</item> <item name="android:windowContentOverlay">@null</item> + <item name="actionBarStyle">@style/cgeo.ActionBarStyle.Light.Inverse</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="cgeo.base"> + </style> + + <style name="cgeo_light" parent="cgeo.base.light"> + + </style> + + <!-- Gingerbreads' Dialog style without the colors but with white backgound --> + <style name="DialogWindowTitle"> + <item name="android:maxLines">1</item> + <item name="android:scrollHorizontally">true</item> + <item name="android:textAppearance">@android:style/TextAppearance.DialogWindowTitle</item> + </style> + + <style name="DialogFixGingerbread"> + <item name="android:windowFrame">@null</item> + <item name="android:windowTitleStyle">@style/DialogWindowTitle</item> + <item name="android:windowIsFloating">true</item> + + <item name="android:windowBackground">@color/just_white</item> + <item name="android:windowContentOverlay">@null</item> + <item name="android:colorBackgroundCacheHint">@null</item> + <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item> + <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item> </style> - <style name="dark" parent="cgeo"> + <style name="dark" parent="cgeo"> <!-- own values: colors --> <item name="text_color">@color/text_dark</item> <item name="text_color_headline">@color/text_headline_dark</item> @@ -98,9 +127,6 @@ <item name="input">@drawable/input_bcg_dark</item> <item name="inventory">@drawable/inventory_background_dark</item> <item name="favorite">@drawable/favorite_background_dark</item> - <item name="favorite_r">@drawable/favorite_background_red_dark</item> - <item name="favorite_o">@drawable/favorite_background_orange_dark</item> - <item name="favorite_g">@drawable/favorite_background_green_dark</item> <item name="close">@drawable/map_close_dark</item> <item name="log_img_icon">@drawable/log_img_dark</item> <item name="actionbar_compass">@drawable/actionbar_compass_dark</item> @@ -113,7 +139,6 @@ <style name="light" parent="cgeo_light"> <!-- own values: colors --> - <item name="android:windowBackground">@color/just_white</item> <item name="text_color">@color/text_light</item> <item name="text_color_headline">@color/text_headline_light</item> <item name="text_color_grey">@color/text_grey_light</item> @@ -128,9 +153,6 @@ <item name="input">@drawable/input_bcg_light</item> <item name="inventory">@drawable/inventory_background_light</item> <item name="favorite">@drawable/favorite_background_light</item> - <item name="favorite_r">@drawable/favorite_background_red_light</item> - <item name="favorite_o">@drawable/favorite_background_orange_light</item> - <item name="favorite_g">@drawable/favorite_background_green_light</item> <item name="close">@drawable/map_close_light</item> <item name="log_img_icon">@drawable/log_img_light</item> <item name="actionbar_compass">@drawable/actionbar_compass_light</item> @@ -154,6 +176,7 @@ <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="cgeo.Translucent.Light"> @@ -189,5 +212,5 @@ <item name="settings_sdcard">@drawable/settings_sdcard_black</item> <item name="settings_info_icon">@drawable/settings_info_icon_black</item> </style> - + </resources>
\ No newline at end of file diff --git a/main/src/cgeo/geocaching/activity/ActivityMixin.java b/main/src/cgeo/geocaching/activity/ActivityMixin.java index e2181d0..769082d 100644 --- a/main/src/cgeo/geocaching/activity/ActivityMixin.java +++ b/main/src/cgeo/geocaching/activity/ActivityMixin.java @@ -8,6 +8,8 @@ import org.eclipse.jdt.annotation.NonNull; import android.app.Activity; import android.content.Intent; +import android.os.Build.VERSION; +import android.os.Build.VERSION_CODES; import android.support.v4.app.ActivityCompat; import android.support.v4.app.NavUtils; import android.support.v4.app.TaskStackBuilder; @@ -52,8 +54,7 @@ public final class ActivityMixin { public static int getDialogTheme() { // Light theme dialogs don't work on Android Api < 11 - // The compat theme should fix this - if (Settings.isLightSkin()) { + if (Settings.isLightSkin() && VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB) { return R.style.popup_light; } return R.style.popup_dark; diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java index d0a9e5e..e0366c4 100644 --- a/main/src/cgeo/geocaching/maps/CGeoMap.java +++ b/main/src/cgeo/geocaching/maps/CGeoMap.java @@ -483,10 +483,8 @@ public class CGeoMap extends AbstractMap implements ViewFactory { // set layout - //ActivityMixin.setTheme(activity); - // TODO: set a proper theme + ActivityMixin.setTheme(activity); if (Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB) { - activity.setTheme(android.R.style.Theme_Holo); activity.getActionBar().setDisplayHomeAsUpEnabled(true); } activity.setContentView(mapProvider.getMapLayoutId()); diff --git a/main/src/cgeo/geocaching/ui/dialog/CoordinatesInputDialog.java b/main/src/cgeo/geocaching/ui/dialog/CoordinatesInputDialog.java index 00b5abe..0ad820a 100644 --- a/main/src/cgeo/geocaching/ui/dialog/CoordinatesInputDialog.java +++ b/main/src/cgeo/geocaching/ui/dialog/CoordinatesInputDialog.java @@ -3,6 +3,7 @@ package cgeo.geocaching.ui.dialog; import cgeo.geocaching.Geocache; import cgeo.geocaching.R; import cgeo.geocaching.activity.AbstractActivity; +import cgeo.geocaching.activity.ActivityMixin; import cgeo.geocaching.geopoint.Geopoint; import cgeo.geocaching.geopoint.GeopointFormatter; import cgeo.geocaching.sensors.IGeoData; @@ -12,6 +13,8 @@ import cgeo.geocaching.utils.EditUtils; import org.apache.commons.lang3.StringUtils; +import android.os.Build.VERSION; +import android.os.Build.VERSION_CODES; import android.os.Bundle; import android.support.v4.app.DialogFragment; import android.text.Editable; @@ -81,6 +84,8 @@ public class CoordinatesInputDialog extends DialogFragment { if (savedInstanceState != null && savedInstanceState.getParcelable(GEOPOINT_ARG)!=null) gp = savedInstanceState.getParcelable(GEOPOINT_ARG); + if (VERSION.SDK_INT < VERSION_CODES.HONEYCOMB && Settings.isLightSkin()) + setStyle(STYLE_NORMAL, R.style.DialogFixGingerbread); } @Override |