From be26c1845210a1c8824677ed6e2d093073ea5c84 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Sun, 20 Apr 2014 21:38:19 +0200 Subject: 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 --- main/res/layout/actionbar.xml | 7 ----- main/res/layout/actionbar_button_compass.xml | 15 --------- main/res/layout/actionbar_button_map.xml | 13 -------- main/res/layout/actionbar_button_myposition.xml | 12 -------- main/res/layout/actionbar_button_search.xml | 13 -------- main/res/layout/actionbar_maps.xml | 41 +++++++++++++++++++++++++ main/res/layout/actionbar_popup.xml | 32 +++++++++++++++++++ main/res/layout/actionbar_progress.xml | 5 --- main/res/layout/actionbar_title.xml | 16 ---------- main/res/layout/actionbar_title_no_home.xml | 10 ------ main/res/layout/addresslist_activity.xml | 2 +- main/res/layout/authorization_activity.xml | 2 -- main/res/layout/cachedetail_activity.xml | 7 ----- main/res/layout/cachelist_spinneritem.xml | 32 +++++++++++++++++++ main/res/layout/cacheslist_activity.xml | 9 ------ main/res/layout/cacheslist_item.xml | 4 +-- main/res/layout/compass_activity.xml | 2 -- main/res/layout/editwaypoint_activity.xml | 2 -- main/res/layout/gpx.xml | 2 -- main/res/layout/images_activity.xml | 2 -- main/res/layout/imageselect_activity.xml | 7 ----- main/res/layout/logcache_activity.xml | 7 ----- main/res/layout/logtrackable_activity.xml | 7 ----- main/res/layout/main_activity.xml | 11 ------- main/res/layout/map_google.xml | 7 +---- main/res/layout/map_mapsforge.xml | 9 +----- main/res/layout/map_mapsforge_old.xml | 9 +----- main/res/layout/navigateanypoint_activity.xml | 2 -- main/res/layout/popup.xml | 17 +++++----- main/res/layout/search_activity.xml | 2 -- main/res/layout/staticmaps_activity.xml | 2 -- main/res/layout/usefulapps_activity.xml | 2 -- main/res/layout/viewpager_activity.xml | 2 -- main/res/layout/waypoint_popup.xml | 7 +---- 34 files changed, 119 insertions(+), 200 deletions(-) delete mode 100644 main/res/layout/actionbar.xml delete mode 100644 main/res/layout/actionbar_button_compass.xml delete mode 100644 main/res/layout/actionbar_button_map.xml delete mode 100644 main/res/layout/actionbar_button_myposition.xml delete mode 100644 main/res/layout/actionbar_button_search.xml create mode 100644 main/res/layout/actionbar_maps.xml create mode 100644 main/res/layout/actionbar_popup.xml delete mode 100644 main/res/layout/actionbar_progress.xml delete mode 100644 main/res/layout/actionbar_title.xml delete mode 100644 main/res/layout/actionbar_title_no_home.xml create mode 100644 main/res/layout/cachelist_spinneritem.xml (limited to 'main/res/layout') diff --git a/main/res/layout/actionbar.xml b/main/res/layout/actionbar.xml deleted file mode 100644 index 098120c..0000000 --- a/main/res/layout/actionbar.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/res/layout/actionbar_button_compass.xml b/main/res/layout/actionbar_button_compass.xml deleted file mode 100644 index 932444b..0000000 --- a/main/res/layout/actionbar_button_compass.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/main/res/layout/actionbar_button_map.xml b/main/res/layout/actionbar_button_map.xml deleted file mode 100644 index 9b2138a..0000000 --- a/main/res/layout/actionbar_button_map.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/main/res/layout/actionbar_button_myposition.xml b/main/res/layout/actionbar_button_myposition.xml deleted file mode 100644 index 1e91419..0000000 --- a/main/res/layout/actionbar_button_myposition.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/main/res/layout/actionbar_button_search.xml b/main/res/layout/actionbar_button_search.xml deleted file mode 100644 index 2aa1a50..0000000 --- a/main/res/layout/actionbar_button_search.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/main/res/layout/actionbar_maps.xml b/main/res/layout/actionbar_maps.xml new file mode 100644 index 0000000..61e3acc --- /dev/null +++ b/main/res/layout/actionbar_maps.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/main/res/layout/actionbar_popup.xml b/main/res/layout/actionbar_popup.xml new file mode 100644 index 0000000..0cab165 --- /dev/null +++ b/main/res/layout/actionbar_popup.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/main/res/layout/actionbar_progress.xml b/main/res/layout/actionbar_progress.xml deleted file mode 100644 index 54b5875..0000000 --- a/main/res/layout/actionbar_progress.xml +++ /dev/null @@ -1,5 +0,0 @@ - - diff --git a/main/res/layout/actionbar_title.xml b/main/res/layout/actionbar_title.xml deleted file mode 100644 index 4fa5348..0000000 --- a/main/res/layout/actionbar_title.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/main/res/layout/actionbar_title_no_home.xml b/main/res/layout/actionbar_title_no_home.xml deleted file mode 100644 index 6295bdc..0000000 --- a/main/res/layout/actionbar_title_no_home.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/main/res/layout/addresslist_activity.xml b/main/res/layout/addresslist_activity.xml index c48c28f..e5c6491 100644 --- a/main/res/layout/addresslist_activity.xml +++ b/main/res/layout/addresslist_activity.xml @@ -4,7 +4,7 @@ android:layout_height="fill_parent" android:orientation="vertical" > - + - - - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/main/res/layout/cacheslist_activity.xml b/main/res/layout/cacheslist_activity.xml index c267f60..a12adad 100644 --- a/main/res/layout/cacheslist_activity.xml +++ b/main/res/layout/cacheslist_activity.xml @@ -4,15 +4,6 @@ android:layout_height="fill_parent" android:orientation="vertical" > - - - - - - - - - - - - - - -