diff options
author | Joey Rizzoli <joey@cyanogenmoditalia.it> | 2016-06-01 14:04:38 +0200 |
---|---|---|
committer | LuK1337 <priv.luk@gmail.com> | 2019-10-21 21:42:08 +0200 |
commit | 0a42172d7a33f78c9598fe7a8b47ca622482a43f (patch) | |
tree | b7967e68a83d1774aec51f597f4938fb366a0652 /res | |
parent | f4f030b0267e33d8f88144c2e540a2fd294b645f (diff) | |
download | android_packages_apps_Gallery2-0a42172d7a33f78c9598fe7a8b47ca622482a43f.tar.gz android_packages_apps_Gallery2-0a42172d7a33f78c9598fe7a8b47ca622482a43f.tar.bz2 android_packages_apps_Gallery2-0a42172d7a33f78c9598fe7a8b47ca622482a43f.zip |
Gallery2: Replace hamburger menu with bottom bar
Change-Id: I20caa58fe11ee6f4148cb0bcb0ccbcdcf3a9612e
Signed-off-by: Joey Rizzoli <joey@cyanogenmoditalia.it>
Diffstat (limited to 'res')
-rw-r--r-- | res/drawable/ic_album.xml | 9 | ||||
-rw-r--r-- | res/drawable/ic_timeline.xml | 14 | ||||
-rw-r--r-- | res/drawable/ic_video.xml | 13 | ||||
-rw-r--r-- | res/drawable/item_bg.xml | 5 | ||||
-rwxr-xr-x | res/layout/gallery_main.xml | 72 | ||||
-rw-r--r-- | res/layout/gl_root_group.xml | 12 | ||||
-rw-r--r-- | res/menu/navigation_items.xml | 11 | ||||
-rw-r--r-- | res/values/attrs.xml | 10 | ||||
-rw-r--r-- | res/values/cm_colors.xml | 7 | ||||
-rw-r--r-- | res/values/codeaurora_strings.xml | 12 | ||||
-rwxr-xr-x | res/values/colors.xml | 3 | ||||
-rw-r--r-- | res/values/styles.xml | 2 |
12 files changed, 100 insertions, 70 deletions
diff --git a/res/drawable/ic_album.xml b/res/drawable/ic_album.xml new file mode 100644 index 000000000..3f0cfa2fb --- /dev/null +++ b/res/drawable/ic_album.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:fillColor="@color/tab_icon_2" + android:pathData="M17.999,2h-12c-1.1,0 -2,0.9 -2,2v16c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V4C19.999,2.9 19.099,2 17.999,2zM5.999,4h5v8l-2.5,-1.5l-2.5,1.5V4zM5.999,19l3,-3.859l2.141,2.58l3,-3.861L17.999,19H5.999z"/> +</vector> diff --git a/res/drawable/ic_timeline.xml b/res/drawable/ic_timeline.xml new file mode 100644 index 000000000..7c30ffa4e --- /dev/null +++ b/res/drawable/ic_timeline.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + + <path + android:fillColor="@color/tab_icon_1" + android:pathData="M9.45605,12.4586 L16.2515,12.4586 L16.2515,19.7214 L9.45608,19.7214 Z M20,8 L4,8 +L4,6 L20,6 L20,8 Z M18,2 L6,2 L6,4 L18,4 L18,2 Z M22,12 L22,20 +C22,21.1,21.1,22,20,22 L4,22 C2.9,22,2,21.1,2,20 L2,12 C2,10.9,2.9,10,4,10 +L20,10 C21.1,10,22,10.9,22,12 Z M16,16 L10,12.73 L10,19.26 L16,16 Z" /> +</vector> diff --git a/res/drawable/ic_video.xml b/res/drawable/ic_video.xml new file mode 100644 index 000000000..1904d8b68 --- /dev/null +++ b/res/drawable/ic_video.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + + <path + android:fillColor="@color/tab_icon_3" + android:pathData="M18,4 L20,8 L17,8 L15,4 L13,4 L15,8 L12,8 L10,4 L8,4 L10,8 L7,8 L5,4 L4,4 +C2.9,4,2.01,4.9,2.01,6 L2,18 C2,19.1,2.9,20,4,20 L20,20 C21.1,20,22,19.1,22,18 +L22,4 L18,4 Z" /> +</vector> diff --git a/res/drawable/item_bg.xml b/res/drawable/item_bg.xml new file mode 100644 index 000000000..d518cbfef --- /dev/null +++ b/res/drawable/item_bg.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:color="@color/navigation_accent_enabled" android:state_checked="true" /> + <item android:color="@color/navigation_accent_disabled" /> +</selector> diff --git a/res/layout/gallery_main.xml b/res/layout/gallery_main.xml index 677c5b6d7..cd47ee32d 100755 --- a/res/layout/gallery_main.xml +++ b/res/layout/gallery_main.xml @@ -28,68 +28,42 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> -<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawerLayout" + android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> - <!-- MAIN CONTENT --> - <RelativeLayout - android:id="@+id/gallery_root" - android:layout_width="match_parent" - android:layout_height="match_parent" > - - <include layout="@layout/gl_root_group" /> - </RelativeLayout> - - <LinearLayout android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical" > - - <include - android:id="@+id/toolbar" - layout="@layout/toolbar" /> - </LinearLayout> - - <RelativeLayout - android:id="@+id/drawerPane" - android:layout_width="270dp" - android:layout_height="match_parent" - android:layout_gravity="start" - android:background="@color/white" - android:clickable="true" > - - <!-- Header --> + android:layout_height="match_parent"> + <!-- MAIN CONTENT --> <RelativeLayout - android:id="@+id/header" + android:id="@+id/gallery_root" android:layout_width="match_parent" - android:layout_height="150dp" - android:background="@drawable/drawer_bg" > + android:layout_height="match_parent"> - <TextView - android:id="@+id/appName" - android:layout_width="wrap_content" + <android.support.design.widget.BottomNavigationView + android:id="@+id/bottom_navigation" + android:elevation="8dp" + android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" - android:layout_marginBottom="16dp" - android:layout_marginStart="16dp" - android:fontFamily="sans-serif" - android:text="@string/navigation_drawer_title" - android:textColor="@color/white" - android:textSize="24sp" /> + app:menu="@menu/navigation_items" + app:itemBackground="@color/primary" + app:itemIconTint="@drawable/item_bg" + app:itemTextColor="@drawable/item_bg" /> + + <include layout="@layout/gl_root_group"/> </RelativeLayout> - <ListView - android:id="@+id/navList" - android:layout_width="270dp" - android:layout_height="match_parent" - android:layout_below="@id/header" - android:layout_marginTop="4dp" - android:divider="@android:color/transparent" /> + <!-- This layout will overlap all the others --> + <include + android:id="@+id/toolbar" + layout="@layout/toolbar" /> </RelativeLayout> - -</android.support.v4.widget.DrawerLayout>
\ No newline at end of file +</LinearLayout> diff --git a/res/layout/gl_root_group.xml b/res/layout/gl_root_group.xml index de0f66afe..eee2b49f8 100644 --- a/res/layout/gl_root_group.xml +++ b/res/layout/gl_root_group.xml @@ -15,13 +15,19 @@ --> <merge xmlns:android="http://schemas.android.com/apk/res/android"> - <com.android.gallery3d.ui.GLRootView + + <RelativeLayout + android:id="@+id/gl_parent_layout" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginBottom="56dp"> + <com.android.gallery3d.ui.GLRootView android:id="@+id/gl_root_view" android:layout_width="match_parent" android:layout_height="match_parent"/> + </RelativeLayout> <View android:id="@+id/gl_root_cover" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="#fafafa" - /> + android:background="#fafafa"/> </merge> diff --git a/res/menu/navigation_items.xml b/res/menu/navigation_items.xml new file mode 100644 index 000000000..b4f39dc1c --- /dev/null +++ b/res/menu/navigation_items.xml @@ -0,0 +1,11 @@ +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:id="@+id/action_timeline" + android:title="@string/timeline_title" + android:icon="@drawable/ic_timeline" /> + <item android:id="@+id/action_album" + android:title="@string/albums_title" + android:icon="@drawable/ic_album" /> + <item android:id="@+id/action_videos" + android:title="@string/videos_title" + android:icon="@drawable/ic_video" /> +</menu> diff --git a/res/values/attrs.xml b/res/values/attrs.xml index 80079dd46..52ac78ff9 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -14,16 +14,11 @@ limitations under the License. --> <resources> - <declare-styleable name="Theme.GalleryBase"> - <attr name="listPreferredItemHeightSmall" format="dimension" /> - <attr name="switchStyle" format="reference" /> - </declare-styleable> + <declare-styleable name="Theme.GalleryBase"/> <!-- Camera resources below --> - <declare-styleable name="CameraPreference"> - <attr name="title" format="string" /> - </declare-styleable> + <declare-styleable name="CameraPreference"/> <declare-styleable name="ListPreference"> <attr name="key" format="string" /> <attr name="defaultValue" format="string|reference" /> @@ -44,7 +39,6 @@ </declare-styleable> <declare-styleable name="Knob"> <attr name="label" format="string" /> - <attr name="background" format="integer" /> <attr name="foreground" format="integer" /> </declare-styleable> <declare-styleable name="FillColor"> diff --git a/res/values/cm_colors.xml b/res/values/cm_colors.xml index 70fc269a8..4eb65aead 100644 --- a/res/values/cm_colors.xml +++ b/res/values/cm_colors.xml @@ -24,6 +24,13 @@ <color name="light_black">#424242</color> + <color name="tab_1">@color/primary</color> + <color name="tab_2">@color/primary</color> + <color name="tab_3">@color/primary</color> + <color name="tab_icon_1">@color/white</color> + <color name="tab_icon_2">@color/white</color> + <color name="tab_icon_3">@color/white</color> + <color name="black_transparent_1">#1a000000</color> <color name="black_transparent_2">#26000000</color> <color name="black_transparent_3">#75000000</color> diff --git a/res/values/codeaurora_strings.xml b/res/values/codeaurora_strings.xml index b05aaf45c..540707e3a 100644 --- a/res/values/codeaurora_strings.xml +++ b/res/values/codeaurora_strings.xml @@ -122,19 +122,13 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. <string name="drm_license_info">DRM license info</string> - <string-array name="title_array_nav_items"> - <item>Timeline</item> - <item>Albums</item> - <item>Videos</item> - </string-array> - - <string name="navigation_drawer_title" translatable="false">@string/app_name</string> <!-- Timeline screen title --> <string name="timeline_title">Timeline</string> <!-- Albums screen title --> - <string name="albums_title" translatable="false">@string/tab_albums</string> + <string name="albums_title">Albums</string> <!-- Videos screen title --> <string name="videos_title">Videos</string> + <string name="action_viewtype_list">List view</string> <string name="action_viewtype_grid" translatable="false">@string/switch_photo_grid</string> <string name="tvEmptyAlbum">No photos found</string> @@ -144,7 +138,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. <string name="text_makeup_Soften">Soften</string> <string name="text_makeup_trimface">Trimface</string> <string name="text_makeup_bigeye">Bigeye</string> - <string name="drawer_desc" translatable="false">drawer</string> + <string name="truescanner_normal">Normal</string> <string name="truescanner_white">Whiteboard</string> <string name="truescanner">TrueScanner</string> diff --git a/res/values/colors.xml b/res/values/colors.xml index d509fe8d4..429348e35 100755 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -88,4 +88,7 @@ <color name="timeline_title_text_color">@color/black_transparent_4</color> <color name="timeline_title_number_text_color">@color/black_transparent_3</color> <color name="timeline_title_background_color">@color/white</color> + + <color name="navigation_accent_disabled">#747474</color> + <color name="navigation_accent_enabled">@color/white</color> </resources> diff --git a/res/values/styles.xml b/res/values/styles.xml index 28af6c702..1bc7fbeed 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -315,7 +315,7 @@ <item name="android:background">@drawable/bg_pressed</item> </style> - <style name="AppTheme" parent="android:Theme.Material.Light"> + <style name="AppTheme" parent="Theme.AppCompat.Light"> <item name="android:windowDrawsSystemBarBackgrounds">true</item> <item name="android:windowBackground">@android:color/black</item> <item name="android:statusBarColor">@android:color/transparent</item> |