summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorAndy Mast <andy@cyngn.com>2014-05-12 11:05:33 -0700
committerAndy Mast <andy@cyngn.com>2014-05-15 14:42:56 +0000
commitcf8f5e7f8c7195ae14827caa71e291d52d3e236e (patch)
tree515aac6ccfb101c1abb014218ccce1750a73b451 /res
parentf3684875dbc8dcaa74c588cd0ec3ef603c058208 (diff)
downloadpackages_apps_ThemeChooser-cf8f5e7f8c7195ae14827caa71e291d52d3e236e.zip
packages_apps_ThemeChooser-cf8f5e7f8c7195ae14827caa71e291d52d3e236e.tar.gz
packages_apps_ThemeChooser-cf8f5e7f8c7195ae14827caa71e291d52d3e236e.tar.bz2
Replace sliding panel with scrollview
This allows 1) Sliding of the drawer to happen in the theme viewpager 2) Seamless sliding from viewpager all the way to the bottom most theme component checkbox (sounds). Also clicking the viewpager now expands/minimizes the "drawer". Before this patch the UX was a little awkward since the theme components were in their own scrollview. A user could not scroll down at all in the theme preview viewpager and would have to use two swipes to get to the very bottom. Change-Id: I1a0a30edfdd29d56db0aa40d06114f8bbaa39331
Diffstat (limited to 'res')
-rw-r--r--res/layout/fragment_chooser_theme_pager_item.xml213
1 files changed, 113 insertions, 100 deletions
diff --git a/res/layout/fragment_chooser_theme_pager_item.xml b/res/layout/fragment_chooser_theme_pager_item.xml
index 9ae6f35..9fdc37c 100644
--- a/res/layout/fragment_chooser_theme_pager_item.xml
+++ b/res/layout/fragment_chooser_theme_pager_item.xml
@@ -15,123 +15,136 @@
* limitations under the License.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:themes="http://schemas.android.com/apk/res/org.cyanogenmod.theme.chooser"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical" >
+ xmlns:themes="http://schemas.android.com/apk/res/org.cyanogenmod.theme.chooser"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
- <com.sothree.slidinguppanel.SlidingupPanelLayout
+ <org.cyanogenmod.theme.util.ChooserDetailScrollView
android:id="@+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/apply"
android:layout_gravity="bottom"
- android:clickable="false"
- themes:parallaxDistance="@dimen/sliding_up_panel_parallax_distance"
- themes:anchorPoint="0.5" >
+ android:scrollbars="none"
+ android:clickable="false">
- <android.support.v4.view.ViewPager
- android:id="@+id/pager"
+ <!-- Note: Do not change the child order
+ without reviewing ChooserDetailLinearLayout -->
+ <org.cyanogenmod.theme.util.ChooserDetailLinearLayout
android:layout_width="match_parent"
- android:layout_height="match_parent" />
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@color/detailedview_pager_background"
- android:paddingLeft="24dp"
- android:paddingRight="10dp" >
+ <!-- The viewpager cannot be parallax scrolled directly (weird things happen)
+ so we wrap it in this frame layout -->
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ >
+ <org.cyanogenmod.theme.util.ClickableViewPager
+ android:id="@+id/pager"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+ </FrameLayout>
- <TextView
- android:id="@+id/title"
+ <!-- Drawer Handle -->
+ <RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:ellipsize="end"
- android:maxLines="1"
- android:paddingTop="6dp"
- android:textSize="28sp" />
-
- <TextView
- android:id="@+id/author"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_below="@id/title"
- android:layout_marginTop="-2dp"
- android:text="@string/unknown_author"
- android:textSize="12sp" />
+ android:background="@color/detailedview_pager_background"
+ android:paddingLeft="24dp"
+ android:paddingRight="10dp"
+ android:paddingBottom="4dp">
+
+ <TextView
+ android:id="@+id/title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:ellipsize="end"
+ android:maxLines="1"
+ android:paddingTop="6dp"
+ android:textSize="28sp"/>
+
+ <TextView
+ android:id="@+id/author"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_below="@id/title"
+ android:layout_marginTop="-2dp"
+ android:text="@string/unknown_author"
+ android:textSize="12sp"/>
+
+ </RelativeLayout>
- <ScrollView
+ <!-- Drawer Contents -->
+ <LinearLayout
+ android:id="@+id/details"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_below="@id/author" >
- <LinearLayout
- android:id="@+id/details"
+ android:orientation="vertical"
+ android:background="@color/detailedview_pager_background"
+ android:paddingTop="6dp">
+
+ <CheckBox
+ android:id="@+id/chk_overlays"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/style"/>
+
+ <CheckBox
+ android:id="@+id/chk_wallpaper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:orientation="vertical"
- android:paddingTop="6dp" >
-
- <CheckBox
- android:id="@+id/chk_overlays"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/style" />
-
- <CheckBox
- android:id="@+id/chk_wallpaper"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/wallpapers" />
-
- <CheckBox
- android:id="@+id/chk_lockscreen"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/lock_screen" />
-
- <CheckBox
- android:id="@+id/chk_fonts"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/fonts" />
-
- <CheckBox
- android:id="@+id/chk_icons"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/icons" />
-
- <CheckBox
- android:id="@+id/chk_boot_anims"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/boot_anims" />
-
- <CheckBox
- android:id="@+id/chk_ringtones"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/ringtones" />
-
- <CheckBox
- android:id="@+id/chk_notifications"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/notifications" />
-
- <CheckBox
- android:id="@+id/chk_alarms"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/alarms" />
- </LinearLayout>
- </ScrollView>
- </RelativeLayout>
- </com.sothree.slidinguppanel.SlidingupPanelLayout>
+ android:text="@string/wallpapers"/>
+ <CheckBox
+ android:id="@+id/chk_lockscreen"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/lock_screen"/>
+
+ <CheckBox
+ android:id="@+id/chk_fonts"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/fonts"/>
+
+ <CheckBox
+ android:id="@+id/chk_icons"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/icons"/>
+
+ <CheckBox
+ android:id="@+id/chk_boot_anims"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/boot_anims"/>
+
+ <CheckBox
+ android:id="@+id/chk_ringtones"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/ringtones"/>
+
+ <CheckBox
+ android:id="@+id/chk_notifications"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/notifications"/>
+
+ <CheckBox
+ android:id="@+id/chk_alarms"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/alarms"/>
+ </LinearLayout>
+ </org.cyanogenmod.theme.util.ChooserDetailLinearLayout>
+ </org.cyanogenmod.theme.util.ChooserDetailScrollView>
<Button
android:id="@+id/apply"
android:layout_width="match_parent"
@@ -141,6 +154,6 @@
android:background="@drawable/apply_button_bg"
android:text="@string/apply"
android:textColor="@drawable/apply_button_text"
- android:textStyle="bold" />
+ android:textStyle="bold"/>
</RelativeLayout>