diff options
author | Jorim Jaggi <jjaggi@google.com> | 2016-05-24 00:30:00 -0700 |
---|---|---|
committer | Jorim Jaggi <jjaggi@google.com> | 2016-06-02 19:09:51 -0700 |
commit | 7d98c8fca6d1edd51178a65847687d81562d7d6e (patch) | |
tree | cc8136cfcfb660fb73c026faf9bd1b514fa984fc /res/layout | |
parent | b30b95f9db068faf294e43fb7927d911ecfaf892 (diff) | |
download | android_packages_wallpapers_LivePicker-7d98c8fca6d1edd51178a65847687d81562d7d6e.tar.gz android_packages_wallpapers_LivePicker-7d98c8fca6d1edd51178a65847687d81562d7d6e.tar.bz2 android_packages_wallpapers_LivePicker-7d98c8fca6d1edd51178a65847687d81562d7d6e.zip |
Adjust wallpaper picker to match static wallpaper picker
- Implement new action bar
- Use BottomSheet behavior from design lib
- Fill in values from live wallpaper if desired
- Don't use separate dialog for loading state
Bug: 28770685
Change-Id: I8dd862fe4c83f702e249f7f3644df89fee771f4f
Diffstat (limited to 'res/layout')
-rw-r--r-- | res/layout/live_wallpaper_loading.xml | 24 | ||||
-rw-r--r-- | res/layout/live_wallpaper_preview.xml | 157 |
2 files changed, 134 insertions, 47 deletions
diff --git a/res/layout/live_wallpaper_loading.xml b/res/layout/live_wallpaper_loading.xml deleted file mode 100644 index dff8b86..0000000 --- a/res/layout/live_wallpaper_loading.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2009 The Android Open Source 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. ---> - -<TextView xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - - android:gravity="center" - - android:text="@string/live_wallpaper_loading" - android:textAppearance="?android:attr/textAppearanceMedium" /> diff --git a/res/layout/live_wallpaper_preview.xml b/res/layout/live_wallpaper_preview.xml index 6dcb644..fb8ab5c 100644 --- a/res/layout/live_wallpaper_preview.xml +++ b/res/layout/live_wallpaper_preview.xml @@ -1,25 +1,136 @@ -<?xml version="1.0" encoding="utf-8"?> <!-- - Copyright (C) 2009 The Android Open Source 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. ---> -<Button xmlns:android="http://schemas.android.com/apk/res/android" - style="@style/ActionBarSetWallpaperStyle" + ~ Copyright (C) 2016 The Android Open Source 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 + --> + +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" - android:layout_height="match_parent" - android:drawablePadding="8dp" - android:drawableStart="@drawable/ic_tick" - android:gravity="start|center_vertical" - android:onClick="setLiveWallpaper" - android:text="@string/wallpaper_instructions" /> + android:layout_height="match_parent"> + + <FrameLayout + android:id="@+id/loading" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="#ff000000" + android:forceHasOverlappingRendering="false"> + + <ProgressBar + style="@android:style/Widget.Material.ProgressBar" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:indeterminate="true"/> + + </FrameLayout> + + <FrameLayout android:layout_width="match_parent" + android:layout_height="match_parent" + android:fitsSystemWindows="true"> + + <android.support.design.widget.CoordinatorLayout + android:id="@+id/coordinator_layout" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom"> + + <RelativeLayout android:id="@+id/bottom_sheet" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + android:minHeight="@dimen/preview_attribution_pane_expanded_height" + android:orientation="vertical" + android:background="@color/translucent_black" + app:behavior_peekHeight="@dimen/preview_attribution_pane_collapsed_height" + app:layout_behavior="android.support.design.widget.BottomSheetBehavior"> + + <ImageButton android:id="@+id/preview_attribution_pane_arrow" + android:contentDescription="@string/expand_attribution_panel" + android:layout_width="48dp" + android:layout_height="48dp" + android:layout_alignParentEnd="true" + android:focusable="true" + android:clickable="true" + android:src="@drawable/ic_keyboard_arrow_up_white_24dp" + style="?android:attr/borderlessButtonStyle"/> + + <TextView + android:id="@+id/preview_attribution_pane_title" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="start" + android:layout_marginStart="@dimen/preview_attribution_pane_content_side_margin" + android:layout_marginEnd="@dimen/preview_attribution_pane_content_side_margin" + android:layout_marginTop="@dimen/preview_attribution_pane_title_top_margin" + android:layout_toStartOf="@id/preview_attribution_pane_arrow" + android:ellipsize="end" + android:textAppearance="@style/AttributionPaneTitle" + android:forceHasOverlappingRendering="false"/> + + <TextView android:id="@+id/preview_attribution_pane_subtitle1" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginStart="@dimen/preview_attribution_pane_content_side_margin" + android:layout_marginEnd="@dimen/preview_attribution_pane_content_side_margin" + android:layout_marginTop="@dimen/preview_attribution_pane_subtitle1_top_margin" + android:layout_below="@id/preview_attribution_pane_title" + android:layout_toStartOf="@id/preview_attribution_pane_arrow" + android:textAppearance="@android:style/TextAppearance.Material.Body1" + android:forceHasOverlappingRendering="false"/> + + <TextView android:id="@+id/preview_attribution_pane_subtitle2" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textSize="@dimen/abc_text_size_caption_material" + android:layout_marginStart="@dimen/preview_attribution_pane_content_side_margin" + android:layout_marginEnd="@dimen/preview_attribution_pane_content_side_margin" + android:layout_marginTop="@dimen/preview_attribution_pane_subtitle2_top_margin" + android:layout_below="@id/preview_attribution_pane_subtitle1" + android:layout_toStartOf="@id/preview_attribution_pane_arrow" + android:textAppearance="@android:style/TextAppearance.Material.Caption" + android:forceHasOverlappingRendering="false"/> + + <Button android:id="@+id/preview_attribution_pane_explore_button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="?android:attr/colorAccent" + android:layout_marginLeft="@dimen/preview_attribution_pane_explore_left_margin" + android:layout_marginStart="@dimen/preview_attribution_pane_explore_left_margin" + android:layout_marginTop="@dimen/preview_attribution_pane_explore_top_margin" + android:layout_marginBottom="@dimen/preview_attribution_pane_explore_bottom_margin" + android:layout_below="@id/preview_attribution_pane_subtitle2" + android:layout_gravity="center_vertical" + style="?android:attr/borderlessButtonStyle" + android:forceHasOverlappingRendering="false"/> + + <View android:id="@id/spacer" + android:layout_width="match_parent" + android:layout_height="@dimen/preview_attribution_pane_spacer_height" + android:layout_below="@id/preview_attribution_pane_subtitle2" + android:visibility="gone"/> + + </RelativeLayout> + + </android.support.design.widget.CoordinatorLayout> + + <android.widget.Toolbar android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="top" + android:paddingStart="@dimen/preview_toolbar_up_button_padding" + android:paddingEnd="@dimen/preview_toolbar_set_wallpaper_button_end_padding" + style="@style/TranslucentToolbarStyle"/> + + </FrameLayout> +</FrameLayout> |