aboutsummaryrefslogtreecommitdiffstats
path: root/res/layout
diff options
context:
space:
mode:
authorFlorian Edelmann <florian-edelmann@online.de>2014-02-23 17:58:18 +0100
committerJorge Ruesga <jorge@ruesga.com>2014-03-10 11:04:36 +0100
commit00f1ea75b0a01eee3d5ece23e59610d6b4586c60 (patch)
treea8b50dbcdbc2d6db5f13f70feb19c103ff67c1e3 /res/layout
parentb3f536b0a36f4b76283a038cce29acb27e17fd6d (diff)
downloadandroid_packages_apps_CMFileManager-00f1ea75b0a01eee3d5ece23e59610d6b4586c60.tar.gz
android_packages_apps_CMFileManager-00f1ea75b0a01eee3d5ece23e59610d6b4586c60.tar.bz2
android_packages_apps_CMFileManager-00f1ea75b0a01eee3d5ece23e59610d6b4586c60.zip
[CMFM] bookmarks and history in a navigation drawer
* used a modified version of DrawerLayout from the Support Library * moved bookmarks and history there -> always accessible * added a drawer icon * made all themeable * removed the BookmarksActivity and HistoryActivity * removed the BookmarksAdapter and HistoryAdapter as they are useless for LinearLayouts. I couldn't use ListViews because they scroll vertically - as well as the drawer itself. * removed the layouts for bookmarks and history Patch Set 2: tab cleanup and reset code I didn't touch Patch Set 3: fixed a FC after changing the theme when settings were opened by the drawer's overflow menu Patch Set 4: updated commit message Patch Set 5: updated commit message Patch Set 6: disabled "clear history" ActionBar action when history is empty Patch Set 7: fixed code style, fixed theme change issue with history items in the drawer, updated theme previews Patch Set 8: remove trailing whitespaces Change-Id: I215211e771ec7c96a2a669cdcc440556c310d6db
Diffstat (limited to 'res/layout')
-rw-r--r--res/layout/bookmarks.xml36
-rw-r--r--res/layout/bookmarks_item.xml94
-rw-r--r--res/layout/history.xml56
-rw-r--r--res/layout/history_item.xml99
-rw-r--r--res/layout/navigation.xml68
-rw-r--r--res/layout/navigation_drawer.xml62
-rw-r--r--res/layout/navigation_view_statusbar.xml20
7 files changed, 193 insertions, 242 deletions
diff --git a/res/layout/bookmarks.xml b/res/layout/bookmarks.xml
deleted file mode 100644
index 5ae41a9c..00000000
--- a/res/layout/bookmarks.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 The CyanogenMod Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <com.cyanogenmod.filemanager.ui.widgets.FlingerListView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/bookmarks_listview"
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
-
- <ProgressBar
- android:id="@+id/bookmarks_waiting"
- android:layout_width="@dimen/default_row_height"
- android:layout_height="@dimen/default_row_height"
- android:layout_centerInParent="true"
- android:indeterminate="true"
- android:indeterminateOnly="true"
- android:visibility="gone" />
-
-</RelativeLayout> \ No newline at end of file
diff --git a/res/layout/bookmarks_item.xml b/res/layout/bookmarks_item.xml
index fc8e4be5..2070494a 100644
--- a/res/layout/bookmarks_item.xml
+++ b/res/layout/bookmarks_item.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 The CyanogenMod Project
+<!--
+ Copyright (C) 2012 The CyanogenMod Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -12,58 +13,53 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
- -->
+-->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="@dimen/default_row_height"
- android:background="@drawable/holo_list_selector_deselected" >
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="48dp"
+ android:background="@drawable/holo_list_selector_deselected"
+ android:orientation="horizontal"
+ android:focusable="true"
+ android:clickable="true" >
- <ImageView
- android:id="@+id/bookmarks_item_icon"
- android:layout_width="@dimen/default_row_height"
- android:layout_height="match_parent"
- android:contentDescription="@null"
- android:gravity="center_horizontal|center_vertical"
- android:paddingLeft="@dimen/extra_margin"
- android:src="@null" />
+ <ImageView
+ android:id="@+id/bookmarks_item_icon"
+ android:layout_width="48dp"
+ android:layout_height="match_parent"
+ android:layout_marginRight="2dp"
+ android:contentDescription="@null"
+ android:padding="8dp"
+ android:src="@null" />
- <com.cyanogenmod.filemanager.ui.widgets.NonFocusableButtonItem
- android:id="@+id/bookmarks_item_action"
- android:layout_width="@dimen/default_buttom_width"
- android:layout_height="match_parent"
- android:layout_alignParentRight="true"
- android:contentDescription="@null"
- android:gravity="center_horizontal|center_vertical"
- android:src="@null" />
+ <LinearLayout
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:gravity="center"
+ android:orientation="vertical" >
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_toLeftOf="@id/bookmarks_item_action"
- android:layout_toRightOf="@id/bookmarks_item_icon" >
+ <TextView
+ android:id="@+id/bookmarks_item_name"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:textAppearance="@style/primary_text_appearance" />
- <TextView
- android:id="@+id/bookmarks_item_name"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:layout_marginLeft="@dimen/default_margin"
- android:layout_marginTop="@dimen/default_margin"
- android:singleLine="true"
- android:textAppearance="@style/primary_text_appearance" />
+ <TextView
+ android:id="@+id/bookmarks_item_path"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:textAppearance="@style/secondary_text_appearance" />
+ </LinearLayout>
- <TextView
- android:id="@+id/bookmarks_item_path"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_alignParentLeft="true"
- android:layout_marginBottom="@dimen/default_margin"
- android:layout_marginLeft="@dimen/default_margin"
- android:singleLine="true"
- android:textAppearance="@style/secondary_text_appearance" />
- </RelativeLayout>
+ <com.cyanogenmod.filemanager.ui.widgets.NonFocusableButtonItem
+ android:id="@+id/bookmarks_item_action"
+ android:layout_width="@dimen/default_buttom_width"
+ android:layout_height="match_parent"
+ android:contentDescription="@null"
+ android:gravity="center_horizontal|center_vertical"
+ android:src="@null" />
-</RelativeLayout> \ No newline at end of file
+</LinearLayout> \ No newline at end of file
diff --git a/res/layout/history.xml b/res/layout/history.xml
deleted file mode 100644
index 45a2993b..00000000
--- a/res/layout/history.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 The CyanogenMod Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <TextView
- android:id="@+id/history_empty_msg"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_alignParentTop="true"
- android:layout_alignParentBottom="true"
- android:layout_margin="@dimen/extra_margin"
- android:gravity="center_horizontal|center_vertical"
- android:text="@string/msgs_history_empty"
- android:textAppearance="@style/primary_text_appearance_nohighlight"
- android:textSize="@dimen/title_text_size"
- android:visibility="gone" />
-
- <ListView
- android:id="@+id/history_listview"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_alignParentTop="true" />
-
- <View
- android:id="@+id/history_status"
- android:layout_width="match_parent"
- android:layout_height="1dp"
- android:layout_alignParentBottom="true"
- android:visibility="invisible"/>
-
- <ProgressBar
- android:id="@+id/history_waiting"
- android:layout_width="@dimen/default_row_height"
- android:layout_height="@dimen/default_row_height"
- android:layout_centerInParent="true"
- android:indeterminate="true"
- android:indeterminateOnly="true"
- android:visibility="gone" />
-
-</RelativeLayout> \ No newline at end of file
diff --git a/res/layout/history_item.xml b/res/layout/history_item.xml
index 2ef5fe97..ad987140 100644
--- a/res/layout/history_item.xml
+++ b/res/layout/history_item.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 The CyanogenMod Project
+<!--
+ Copyright (C) 2012 The CyanogenMod Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -12,62 +13,56 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
- -->
+-->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="@dimen/default_row_height"
- android:background="@drawable/holo_list_selector_deselected" >
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="48dp"
+ android:background="@drawable/holo_list_selector_deselected"
+ android:clickable="true"
+ android:focusable="true"
+ android:orientation="horizontal" >
- <ImageView
- android:id="@+id/history_item_icon"
- android:layout_width="@dimen/default_row_height"
- android:layout_height="match_parent"
- android:contentDescription="@null"
- android:gravity="center_horizontal|center_vertical"
- android:paddingLeft="@dimen/extra_margin"
- android:src="@null" />
+ <ImageView
+ android:id="@+id/history_item_icon"
+ android:layout_width="48dp"
+ android:layout_height="48dp"
+ android:layout_marginRight="2dp"
+ android:contentDescription="@null"
+ android:padding="8dp"
+ android:src="@null" />
- <TextView
- android:id="@+id/history_item_position"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_centerVertical="true"
- android:layout_marginLeft="@dimen/default_margin"
- android:layout_marginTop="@dimen/default_margin"
- android:paddingRight="@dimen/extra_margin"
- android:singleLine="true"
- android:textAppearance="@style/primary_text_appearance"
- android:textStyle="normal" />
+ <LinearLayout
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:gravity="center"
+ android:orientation="vertical" >
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_toLeftOf="@id/history_item_position"
- android:layout_toRightOf="@id/history_item_icon" >
+ <TextView
+ android:id="@+id/history_item_name"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:textAppearance="@style/primary_text_appearance" />
- <TextView
- android:id="@+id/history_item_name"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:layout_marginLeft="@dimen/default_margin"
- android:layout_marginTop="@dimen/default_margin"
- android:singleLine="true"
- android:textAppearance="@style/primary_text_appearance" />
+ <TextView
+ android:id="@+id/history_item_directory"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:textAppearance="@style/secondary_text_appearance" />
+ </LinearLayout>
<TextView
- android:id="@+id/history_item_directory"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_alignParentLeft="true"
- android:layout_marginBottom="@dimen/default_margin"
- android:layout_marginLeft="@dimen/default_margin"
- android:singleLine="true"
- android:textAppearance="@style/secondary_text_appearance" />
- </RelativeLayout>
+ android:id="@+id/history_item_position"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:layout_marginLeft="@dimen/default_margin"
+ android:paddingRight="@dimen/extra_margin"
+ android:singleLine="true"
+ android:textAppearance="@style/primary_text_appearance"
+ android:textStyle="normal" />
-</RelativeLayout> \ No newline at end of file
+</LinearLayout> \ No newline at end of file
diff --git a/res/layout/navigation.xml b/res/layout/navigation.xml
index 68df9c4f..051f35d6 100644
--- a/res/layout/navigation.xml
+++ b/res/layout/navigation.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 The CyanogenMod Project
+<!--
+ Copyright (C) 2012 The CyanogenMod Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -12,33 +13,42 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
- -->
-
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:filemanager="http://schemas.android.com/apk/res/com.cyanogenmod.filemanager"
- android:id="@+id/navigation_layout"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
-
- <!-- Navigation View -->
- <com.cyanogenmod.filemanager.ui.widgets.NavigationView
- android:id="@+id/navigation_view"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- filemanager:navigation="browsable" />
+-->
- <!-- SelectionBar -->
- <com.cyanogenmod.filemanager.ui.widgets.SelectionView
- android:id="@+id/navigation_selectionbar"
+<com.cyanogenmod.filemanager.ui.widgets.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:filemanager="http://schemas.android.com/apk/res/com.cyanogenmod.filemanager"
+ android:id="@+id/drawer_layout"
android:layout_width="match_parent"
- android:layout_height="@dimen/small_row_height"
- android:background="@drawable/bg_holo_selectionbar"
- android:visibility="invisible" />
-
- <!-- StatusBar -->
- <include layout="@layout/navigation_view_statusbar" />
-
-</LinearLayout>
+ android:layout_height="match_parent" >
+
+ <!-- The main content view -->
+ <LinearLayout
+ android:id="@+id/navigation_layout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
+
+ <!-- Navigation View -->
+ <com.cyanogenmod.filemanager.ui.widgets.NavigationView
+ android:id="@+id/navigation_view"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ filemanager:navigation="browsable" />
+
+ <!-- SelectionBar -->
+ <com.cyanogenmod.filemanager.ui.widgets.SelectionView
+ android:id="@+id/navigation_selectionbar"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/small_row_height"
+ android:background="@drawable/bg_holo_selectionbar"
+ android:visibility="invisible" />
+
+ <!-- StatusBar -->
+ <include layout="@layout/navigation_view_statusbar" />
+ </LinearLayout>
+
+ <!-- The navigation drawer -->
+ <include layout="@layout/navigation_drawer" />
+
+</com.cyanogenmod.filemanager.ui.widgets.DrawerLayout> \ No newline at end of file
diff --git a/res/layout/navigation_drawer.xml b/res/layout/navigation_drawer.xml
new file mode 100644
index 00000000..9398ede5
--- /dev/null
+++ b/res/layout/navigation_drawer.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/drawer"
+ android:layout_width="240dp"
+ android:layout_height="match_parent"
+ android:layout_gravity="start"
+ android:background="@android:color/background_light" >
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/bookmarks_header"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/bookmarks"
+ style="@style/drawer_header" />
+
+ <ProgressBar
+ android:id="@+id/bookmarks_loading"
+ android:layout_width="@dimen/default_row_height"
+ android:layout_height="@dimen/default_row_height"
+ android:indeterminate="true"
+ android:indeterminateOnly="true"
+ android:visibility="gone" />
+
+ <LinearLayout
+ android:id="@+id/bookmarks_list"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="@dimen/extra_margin"
+ android:orientation="vertical" >
+
+ </LinearLayout>
+
+ <TextView
+ android:id="@+id/history_header"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/history"
+ style="@style/drawer_header" />
+
+ <TextView
+ android:id="@+id/history_empty"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/msgs_history_empty"
+ android:paddingLeft="@dimen/extra_margin"
+ style="@style/secondary_text_appearance" />
+
+ <LinearLayout
+ android:id="@+id/history_list"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="@dimen/extra_margin"
+ android:orientation="vertical" >
+ </LinearLayout>
+ </LinearLayout>
+
+</ScrollView> \ No newline at end of file
diff --git a/res/layout/navigation_view_statusbar.xml b/res/layout/navigation_view_statusbar.xml
index 3474265c..47ba2ac9 100644
--- a/res/layout/navigation_view_statusbar.xml
+++ b/res/layout/navigation_view_statusbar.xml
@@ -60,26 +60,6 @@
android:src="@drawable/ic_holo_light_search"
android:visibility="invisible" />
- <com.cyanogenmod.filemanager.ui.widgets.ButtonItem
- android:id="@+id/ab_bookmarks"
- android:layout_width="@dimen/default_buttom_width"
- android:layout_height="match_parent"
- android:layout_toLeftOf="@id/ab_search"
- android:contentDescription="@string/actionbar_button_bookmarks_cd"
- android:onClick="onActionBarItemClick"
- android:src="@drawable/ic_holo_light_bookmarks"
- android:visibility="invisible" />
-
- <com.cyanogenmod.filemanager.ui.widgets.ButtonItem
- android:id="@+id/ab_history"
- android:layout_width="@dimen/default_buttom_width"
- android:layout_height="match_parent"
- android:layout_toLeftOf="@id/ab_bookmarks"
- android:contentDescription="@string/actionbar_button_history_cd"
- android:onClick="onActionBarItemClick"
- android:src="@drawable/ic_holo_light_history"
- android:visibility="invisible" />
-
</RelativeLayout>
</RelativeLayout>