Merge "isAtLeastQ should use CODENAME until SdkInt is ready Bug: 132340681" into ub-launcher3-qt-dev
diff --git a/res/drawable/button_over_thumbnail_background.xml b/res/drawable/button_over_thumbnail_background.xml
new file mode 100644
index 0000000..50a4510
--- /dev/null
+++ b/res/drawable/button_over_thumbnail_background.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ Copyright (C) 2019 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.
+-->
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="oval">
+ <solid android:color="@color/black_38_alpha" />
+</shape>
\ No newline at end of file
diff --git a/res/drawable/presentation_mode_content_protection.xml b/res/drawable/presentation_mode_content_protection.xml
new file mode 100644
index 0000000..bd5296b
--- /dev/null
+++ b/res/drawable/presentation_mode_content_protection.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ Copyright (C) 2019 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.
+-->
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+ <gradient
+ android:angle="90"
+ android:startColor="@color/material_black_100"
+ android:endColor="@android:color/transparent"
+ android:type="linear" />
+</shape>
\ No newline at end of file
diff --git a/res/layout/grid_item_both_metadata.xml b/res/layout/grid_item_both_metadata.xml
index 2a4d4d1..073ca74 100755
--- a/res/layout/grid_item_both_metadata.xml
+++ b/res/layout/grid_item_both_metadata.xml
@@ -15,354 +15,288 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/metadata"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/metadata"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
- <LinearLayout
+ <androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="wrap_content"
- android:layout_marginEnd="2dp"
- android:layout_marginRight="2dp"
android:layout_weight="1"
- android:background="@color/secondary_color"
- android:orientation="vertical">
+ android:layout_marginHorizontal="4dp"
+ app:cardCornerRadius="?android:dialogCornerRadius"
+ app:cardElevation="@dimen/single_metadata_card_elevation"
+ app:cardMaxElevation="@dimen/single_metadata_card_elevation"
+ app:cardPreventCornerOverlap="false"
+ app:cardUseCompatPadding="true"
+ app:contentPadding="0dp">
- <!-- Wraps the image and the "home screen" label overlapping it. -->
- <FrameLayout
- android:id="@+id/home_wallpaper_section"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content">
-
- <com.android.wallpaper.widget.WallpaperThumbnailView
- android:id="@+id/home_wallpaper_image"
- android:layout_width="match_parent"
- android:layout_height="@dimen/both_metadata_thumb_height"
- android:layout_gravity="top"
- android:clickable="true"
- android:contentDescription="@string/currently_set_home_wallpaper_thumbnail"
- android:focusable="true"
- android:foreground="?attr/selectableItemBackground"
- android:nextFocusForward="@+id/home_wallpaper_attribution_section" />
-
- <LinearLayout
- android:id="@+id/home_wallpaper_top_section"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@color/currently_set_both_header_scrim"
- android:focusable="true"
- android:nextFocusForward="@+id/home_wallpaper_explore_button_legacy"
- android:orientation="horizontal"
- android:visibility="invisible">
-
- <LinearLayout
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/home_wallpaper_label"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginEnd="@dimen/both_metadata_content_side_margin"
- android:layout_marginLeft="@dimen/both_metadata_content_side_margin"
- android:layout_marginRight="@dimen/both_metadata_content_side_margin"
- android:layout_marginStart="@dimen/both_metadata_content_side_margin"
- android:layout_marginTop="@dimen/both_metadata_scrim_content_top_margin"
- android:text="@string/home_screen_message"
- android:textColor="@color/currently_set_both_title_text_color"
- android:textSize="@dimen/abc_text_size_subhead_material"
- android:textStyle="bold" />
-
- <TextView
- android:id="@+id/home_wallpaper_presentation_mode"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginBottom="@dimen/both_metadata_scrim_content_bottom_margin"
- android:layout_marginEnd="@dimen/both_metadata_content_side_margin"
- android:layout_marginLeft="@dimen/both_metadata_content_side_margin"
- android:layout_marginRight="@dimen/both_metadata_content_side_margin"
- android:layout_marginStart="@dimen/both_metadata_content_side_margin"
- android:textColor="@color/currently_set_both_presentation_mode_text_color"
- android:textSize="@dimen/abc_text_size_body_2_material" />
-
- </LinearLayout>
-
- <ImageButton
- android:id="@+id/home_wallpaper_explore_button_legacy"
- style="?attr/borderlessButtonStyle"
- android:layout_width="@dimen/both_metadata_explore_button_size"
- android:layout_height="@dimen/both_metadata_explore_button_size"
- android:layout_gravity="center_vertical|end"
- android:clickable="true"
- android:contentDescription="@string/explore_home_screen"
- android:focusable="true"
- android:nextFocusForward="@id/home_wallpaper_image"
- android:src="@drawable/ic_explore_24px"
- android:visibility="gone" />
-
- <ImageButton
- android:id="@+id/skip_home_wallpaper"
- style="?attr/borderlessButtonStyle"
- android:layout_width="@dimen/both_metadata_explore_button_size"
- android:layout_height="@dimen/both_metadata_explore_button_size"
- android:layout_gravity="center_vertical|end"
- android:clickable="true"
- android:contentDescription="@string/refresh_daily_wallpaper_home_content_description"
- android:focusable="true"
- android:nextFocusForward="@id/home_wallpaper_image"
- android:src="@drawable/ic_refresh_24px"
- android:visibility="gone" />
-
- </LinearLayout>
-
- </FrameLayout>
-
- <!-- Wraps the attribution section. -->
- <FrameLayout
- android:id="@id/home_wallpaper_attribution_section"
+ <LinearLayout
android:layout_width="match_parent"
- android:layout_height="@dimen/both_metadata_attribution_section_height"
- android:focusable="true"
- android:nextFocusForward="@+id/lock_wallpaper_top_section">
+ android:layout_height="match_parent"
+ android:orientation="vertical">
- <LinearLayout
+ <!-- Wraps the image and the "lock screen" label overlapping it. -->
+ <FrameLayout
+ android:id="@+id/lock_wallpaper_section"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="top"
- android:orientation="horizontal">
+ android:layout_height="wrap_content">
- <TextView
- android:id="@+id/home_wallpaper_title"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginEnd="@dimen/both_metadata_content_side_margin"
- android:layout_marginLeft="@dimen/both_metadata_content_side_margin"
- android:layout_marginRight="@dimen/both_metadata_content_side_margin"
- android:layout_marginStart="@dimen/both_metadata_content_side_margin"
- android:layout_marginTop="@dimen/both_metadata_attribution_section_top_margin"
- android:layout_weight="1"
- android:ellipsize="end"
- android:maxLines="2"
- android:textColor="@color/currently_set_both_title_text_color"
- android:textSize="@dimen/both_metadata_title_text_size"
- android:textStyle="bold" />
+ <com.android.wallpaper.widget.WallpaperThumbnailView
+ android:id="@+id/lock_wallpaper_image"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/both_metadata_thumb_height"
+ android:layout_gravity="top"
+ android:clickable="true"
+ android:contentDescription="@string/currently_set_lock_wallpaper_thumbnail"
+ android:focusable="true"
+ android:foreground="?attr/selectableItemBackground"
+ android:nextFocusForward="@+id/lock_wallpaper_attribution_section" />
<ImageButton
- android:id="@+id/home_wallpaper_explore_button"
style="?attr/borderlessButtonStyle"
- android:layout_width="@dimen/both_metadata_explore_button_size"
- android:layout_height="@dimen/both_metadata_explore_button_size"
+ android:id="@+id/lock_wallpaper_explore_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/single_metadata_explore_button_margin"
+ android:layout_gravity="top|end"
+ android:background="@drawable/button_over_thumbnail_background"
android:clickable="true"
- android:contentDescription="@string/explore_home_screen"
+ android:contentDescription="@string/explore"
android:focusable="true"
- android:nextFocusForward="@id/home_wallpaper_image"
+ android:padding="@dimen/single_metadata_explore_section_button_padding"
android:src="@drawable/ic_explore_24px"
android:visibility="gone" />
+ </FrameLayout>
- </LinearLayout>
-
- <LinearLayout
+ <!-- Wraps the attribution section. -->
+ <FrameLayout
+ android:id="@id/lock_wallpaper_attribution_section"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom"
- android:layout_marginBottom="@dimen/both_metadata_attribution_section_bottom_margin"
- android:layout_marginEnd="@dimen/both_metadata_content_side_margin"
- android:layout_marginLeft="@dimen/both_metadata_content_side_margin"
- android:layout_marginRight="@dimen/both_metadata_content_side_margin"
- android:layout_marginStart="@dimen/both_metadata_content_side_margin"
- android:orientation="vertical">
+ android:layout_height="@dimen/both_metadata_attribution_section_height"
+ android:focusable="true">
- <TextView
- android:id="@+id/home_wallpaper_subtitle1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:ellipsize="end"
- android:maxLines="1"
- android:textColor="@color/currently_set_both_attribution_subtitle_text_color"
- android:textSize="@dimen/abc_text_size_caption_material" />
-
- <TextView
- android:id="@+id/home_wallpaper_subtitle2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:ellipsize="end"
- android:maxLines="1"
- android:textColor="@color/currently_set_both_attribution_subtitle_text_color"
- android:textSize="@dimen/abc_text_size_caption_material" />
-
- </LinearLayout>
-
- </FrameLayout>
-
- </LinearLayout>
-
- <LinearLayout
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginLeft="2dp"
- android:layout_weight="1"
- android:background="@color/secondary_color"
- android:orientation="vertical">
-
- <!-- Wraps the image and the "lock screen" label overlapping it. -->
- <FrameLayout
- android:id="@+id/lock_wallpaper_section"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content">
-
- <com.android.wallpaper.widget.WallpaperThumbnailView
- android:id="@+id/lock_wallpaper_image"
- android:layout_width="match_parent"
- android:layout_height="@dimen/both_metadata_thumb_height"
- android:layout_gravity="top"
- android:clickable="true"
- android:contentDescription="@string/currently_set_lock_wallpaper_thumbnail"
- android:focusable="true"
- android:foreground="?attr/selectableItemBackground"
- android:nextFocusForward="@+id/lock_wallpaper_attribution_section" />
-
- <LinearLayout
- android:id="@id/lock_wallpaper_top_section"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@color/currently_set_both_header_scrim"
- android:focusable="true"
- android:nextFocusForward="@+id/lock_wallpaper_explore_button_legacy"
- android:orientation="horizontal"
- android:visibility="invisible">
-
- <LinearLayout
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:orientation="vertical">
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginEnd="@dimen/single_metadata_pane_attributions_margin_right"
+ android:layout_marginStart="@dimen/single_metadata_pane_attributions_margin_left"
+ android:layout_marginBottom="@dimen/single_metadata_pane_wallpaper_subtitle_margin_bottom"
+ android:focusable="true">
<TextView
android:id="@+id/lock_wallpaper_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|top"
- android:layout_marginEnd="@dimen/both_metadata_content_side_margin"
- android:layout_marginLeft="@dimen/both_metadata_content_side_margin"
- android:layout_marginRight="@dimen/both_metadata_content_side_margin"
- android:layout_marginStart="@dimen/both_metadata_content_side_margin"
- android:layout_marginTop="@dimen/both_metadata_scrim_content_top_margin"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentStart="true"
+ android:layout_marginTop="@dimen/single_metadata_pane_wallpaper_label_margin_top"
android:text="@string/lock_screen_message"
- android:textColor="@color/currently_set_both_title_text_color"
+ android:textAppearance="@style/HeaderTextAppearance"
+ android:textColor="@color/currently_set_presentation_mode_text_color"
android:textSize="@dimen/abc_text_size_subhead_material"
android:textStyle="bold" />
<TextView
- android:id="@+id/lock_wallpaper_presentation_mode"
+ android:id="@+id/lock_wallpaper_title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_above="@+id/lock_wallpaper_subtitle1"
+ android:layout_alignParentStart="true"
+ android:ellipsize="end"
+ android:maxLines="1"
+ android:textAppearance="@android:style/TextAppearance.DeviceDefault.Small"
+ android:textColor="@color/currently_set_both_attribution_title_text_color"
+ android:textSize="@dimen/both_metadata_title_text_size"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/lock_wallpaper_subtitle1"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_above="@+id/lock_wallpaper_subtitle2"
+ android:layout_alignParentStart="true"
+ android:ellipsize="end"
+ android:maxLines="1"
+ android:textAppearance="@android:style/TextAppearance.DeviceDefault.Small"
+ android:textColor="@color/currently_set_both_attribution_subtitle_text_color"
+ android:textSize="@dimen/abc_text_size_caption_material" />
+
+ <TextView
+ android:id="@+id/lock_wallpaper_subtitle2"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentStart="true"
+ android:ellipsize="end"
+ android:maxLines="1"
+ android:textAppearance="@android:style/TextAppearance.DeviceDefault.Small"
+ android:textColor="@color/currently_set_both_attribution_subtitle_text_color"
+ android:textSize="@dimen/abc_text_size_caption_material" />
+
+ </RelativeLayout>
+
+ </FrameLayout>
+ </LinearLayout>
+ </androidx.cardview.widget.CardView>
+
+ <androidx.cardview.widget.CardView
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:layout_marginHorizontal="4dp"
+ app:cardCornerRadius="?android:dialogCornerRadius"
+ app:cardElevation="@dimen/single_metadata_card_elevation"
+ app:cardMaxElevation="@dimen/single_metadata_card_elevation"
+ app:cardPreventCornerOverlap="false"
+ app:cardUseCompatPadding="true"
+ app:contentPadding="0dp">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <!-- Wraps the image and the "home screen" label overlapping it. -->
+ <FrameLayout
+ android:id="@+id/home_wallpaper_section"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <com.android.wallpaper.widget.WallpaperThumbnailView
+ android:id="@+id/home_wallpaper_image"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/both_metadata_thumb_height"
+ android:layout_gravity="top"
+ android:clickable="true"
+ android:contentDescription="@string/currently_set_home_wallpaper_thumbnail"
+ android:focusable="true"
+ android:foreground="?attr/selectableItemBackground"
+ android:nextFocusForward="@+id/home_wallpaper_attribution_section" />
+
+ <ImageButton
+ style="?attr/borderlessButtonStyle"
+ android:id="@+id/home_wallpaper_explore_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/single_metadata_explore_button_margin"
+ android:layout_gravity="top|end"
+ android:background="@drawable/button_over_thumbnail_background"
+ android:clickable="true"
+ android:contentDescription="@string/explore_home_screen"
+ android:focusable="true"
+ android:padding="@dimen/single_metadata_explore_section_button_padding"
+ android:src="@drawable/ic_explore_24px"
+ android:visibility="gone" />
+
+ <FrameLayout
+ android:id="@+id/home_wallpaper_presentation_section"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom"
+ android:padding="@dimen/both_metadata_scrim_content_bottom_margin"
+ android:background="@drawable/presentation_mode_content_protection"
+ android:visibility="gone">
+ <TextView
+ android:id="@+id/home_wallpaper_presentation_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="start|bottom"
- android:layout_marginBottom="@dimen/both_metadata_scrim_content_bottom_margin"
- android:layout_marginEnd="@dimen/both_metadata_content_side_margin"
- android:layout_marginLeft="@dimen/both_metadata_content_side_margin"
- android:layout_marginRight="@dimen/both_metadata_content_side_margin"
- android:layout_marginStart="@dimen/both_metadata_content_side_margin"
- android:textColor="@color/currently_set_both_presentation_mode_text_color"
- android:textSize="@dimen/abc_text_size_body_2_material" />
+ android:layout_gravity="center_vertical|start"
+ android:gravity="start"
+ android:textColor="@color/material_white_100"
+ android:textSize="@dimen/abc_text_size_body_2_material"/>
- </LinearLayout>
+ <ImageButton
+ style="?attr/borderlessButtonStyle"
+ android:id="@+id/skip_home_wallpaper"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="0dp"
+ android:layout_gravity="center_vertical|end"
+ android:background="@android:color/transparent"
+ android:clickable="true"
+ android:contentDescription="@string/refresh_daily_wallpaper_home_content_description"
+ android:focusable="true"
+ android:nextFocusForward="@id/home_wallpaper_image"
+ android:padding="@dimen/single_metadata_explore_section_button_padding"
+ android:src="@drawable/ic_refresh_24px"
+ android:visibility="gone" />
+ </FrameLayout>
+ </FrameLayout>
- <ImageButton
- android:id="@+id/lock_wallpaper_explore_button_legacy"
- style="?attr/borderlessButtonStyle"
- android:layout_width="@dimen/both_metadata_explore_button_size"
- android:layout_height="@dimen/both_metadata_explore_button_size"
- android:layout_gravity="center_vertical|end"
- android:clickable="true"
- android:contentDescription="@string/explore_lock_screen"
- android:focusable="true"
- android:nextFocusForward="@id/lock_wallpaper_image"
- android:src="@drawable/ic_explore_24px"
- android:visibility="gone" />
-
- </LinearLayout>
-
- </FrameLayout>
-
- <!-- Wraps the attribution section. -->
- <FrameLayout
- android:id="@id/lock_wallpaper_attribution_section"
- android:layout_width="match_parent"
- android:layout_height="@dimen/both_metadata_attribution_section_height"
- android:focusable="true">
-
- <LinearLayout
+ <!-- Wraps the attribution section. -->
+ <FrameLayout
+ android:id="@id/home_wallpaper_attribution_section"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="top"
- android:orientation="horizontal">
+ android:layout_height="@dimen/both_metadata_attribution_section_height"
+ android:focusable="true">
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginEnd="@dimen/single_metadata_pane_attributions_margin_right"
+ android:layout_marginStart="@dimen/single_metadata_pane_attributions_margin_left"
+ android:layout_marginBottom="@dimen/single_metadata_pane_wallpaper_subtitle_margin_bottom"
+ android:focusable="true">
- <TextView
- android:id="@+id/lock_wallpaper_title"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginEnd="@dimen/both_metadata_content_side_margin"
- android:layout_marginLeft="@dimen/both_metadata_content_side_margin"
- android:layout_marginRight="@dimen/both_metadata_content_side_margin"
- android:layout_marginStart="@dimen/both_metadata_content_side_margin"
- android:layout_marginTop="@dimen/both_metadata_attribution_section_top_margin"
- android:layout_weight="1"
- android:ellipsize="end"
- android:maxLines="2"
- android:textColor="@color/currently_set_both_attribution_title_text_color"
- android:textSize="@dimen/both_metadata_title_text_size"
- android:textStyle="bold" />
+ <TextView
+ android:id="@+id/home_wallpaper_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="start|top"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentStart="true"
+ android:layout_marginTop="@dimen/single_metadata_pane_wallpaper_label_margin_top"
+ android:text="@string/home_screen_message"
+ android:textAppearance="@style/HeaderTextAppearance"
+ android:textColor="@color/currently_set_presentation_mode_text_color"
+ android:textSize="@dimen/abc_text_size_subhead_material"
+ android:textStyle="bold" />
- <ImageButton
- android:id="@+id/lock_wallpaper_explore_button"
- style="?attr/borderlessButtonStyle"
- android:layout_width="@dimen/both_metadata_explore_button_size"
- android:layout_height="@dimen/both_metadata_explore_button_size"
- android:clickable="true"
- android:contentDescription="@string/explore_lock_screen"
- android:focusable="true"
- android:nextFocusForward="@+id/lock_wallpaper_image"
- android:src="@drawable/ic_explore_24px"
- android:visibility="gone" />
+ <TextView
+ android:id="@+id/home_wallpaper_title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_above="@+id/home_wallpaper_subtitle1"
+ android:layout_alignParentStart="true"
+ android:ellipsize="end"
+ android:maxLines="1"
+ android:textAppearance="@android:style/TextAppearance.DeviceDefault.Small"
+ android:textColor="@color/currently_set_both_attribution_title_text_color"
+ android:textSize="@dimen/both_metadata_title_text_size"
+ android:textStyle="bold" />
- </LinearLayout>
+ <TextView
+ android:id="@+id/home_wallpaper_subtitle1"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_above="@+id/home_wallpaper_subtitle2"
+ android:layout_alignParentStart="true"
+ android:ellipsize="end"
+ android:maxLines="1"
+ android:textAppearance="@android:style/TextAppearance.DeviceDefault.Small"
+ android:textColor="@color/currently_set_both_attribution_subtitle_text_color"
+ android:textSize="@dimen/abc_text_size_caption_material" />
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom"
- android:layout_marginBottom="@dimen/both_metadata_attribution_section_bottom_margin"
- android:layout_marginEnd="@dimen/both_metadata_content_side_margin"
- android:layout_marginLeft="@dimen/both_metadata_content_side_margin"
- android:layout_marginRight="@dimen/both_metadata_content_side_margin"
- android:layout_marginStart="@dimen/both_metadata_content_side_margin"
- android:orientation="vertical">
+ <TextView
+ android:id="@+id/home_wallpaper_subtitle2"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentStart="true"
+ android:ellipsize="end"
+ android:maxLines="1"
+ android:textAppearance="@android:style/TextAppearance.DeviceDefault.Small"
+ android:textColor="@color/currently_set_both_attribution_subtitle_text_color"
+ android:textSize="@dimen/abc_text_size_caption_material" />
- <TextView
- android:id="@+id/lock_wallpaper_subtitle1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:ellipsize="end"
- android:maxLines="1"
- android:textColor="@color/currently_set_both_attribution_subtitle_text_color"
- android:textSize="@dimen/abc_text_size_caption_material" />
+ </RelativeLayout>
- <TextView
- android:id="@+id/lock_wallpaper_subtitle2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:ellipsize="end"
- android:maxLines="1"
- android:textColor="@color/currently_set_both_attribution_subtitle_text_color"
- android:textSize="@dimen/abc_text_size_caption_material" />
+ </FrameLayout>
- </LinearLayout>
-
- </FrameLayout>
-
- </LinearLayout>
+ </LinearLayout>
+ </androidx.cardview.widget.CardView>
</LinearLayout>
diff --git a/res/layout/grid_item_category.xml b/res/layout/grid_item_category.xml
index 24baf8e..8d3df82 100755
--- a/res/layout/grid_item_category.xml
+++ b/res/layout/grid_item_category.xml
@@ -15,37 +15,45 @@
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/tile"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:layout_margin="8dp"
android:clickable="true"
- android:focusable="true"
- android:foreground="?attr/selectableItemBackground">
-
- <ImageView
- android:id="@+id/image"
+ android:focusable="true">
+ <androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@color/secondary_color"
- android:scaleType="centerCrop" />
+ android:layout_above="@+id/category_title"
+ android:foreground="?attr/selectableItemBackground"
+ app:cardElevation="0dp"
+ app:cardCornerRadius="?android:dialogCornerRadius">
+ <ImageView
+ android:id="@+id/image"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/secondary_color"
+ android:scaleType="centerCrop" />
- <ImageView
- android:id="@+id/overlay_icon"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_centerInParent="true"
- android:layout_marginBottom="@dimen/grid_item_category_overlay_icon_margin_bottom" />
-
+ <ImageView
+ android:id="@+id/overlay_icon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:layout_marginBottom="@dimen/grid_item_category_overlay_icon_margin_bottom" />
+ </androidx.cardview.widget.CardView>
<TextView
android:id="@+id/category_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/category_title_scrim_color"
- android:gravity="center_vertical"
- android:padding="@dimen/grid_item_category_label_padding"
+ android:gravity="start"
+ android:paddingVertical="@dimen/grid_item_category_label_padding"
android:textColor="@color/category_title_text_color"
android:textSize="@dimen/abc_text_size_subhead_material"
+ android:textAppearance="@android:style/TextAppearance.DeviceDefault.Widget.ActionBar.Title"
tools:text="Wallpaper category" />
</RelativeLayout>
diff --git a/res/layout/grid_item_select_wallpaper_header.xml b/res/layout/grid_item_select_wallpaper_header.xml
index 4b74d52..5167abc 100755
--- a/res/layout/grid_item_select_wallpaper_header.xml
+++ b/res/layout/grid_item_select_wallpaper_header.xml
@@ -22,6 +22,6 @@
android:contentDescription="@string/select_wallpaper_label"
android:gravity="center_vertical"
android:text="@string/select_wallpaper_label"
+ android:textAppearance="@android:style/TextAppearance.DeviceDefault.Widget.ActionBar.Title"
android:textColor="@color/select_wallpaper_header_text_color"
- android:textSize="@dimen/abc_text_size_body_2_material"
- android:textStyle="bold" />
+ android:textSize="@dimen/abc_text_size_subhead_material"/>
diff --git a/res/layout/grid_item_single_metadata.xml b/res/layout/grid_item_single_metadata.xml
index 376e3c2..8c4e67e 100755
--- a/res/layout/grid_item_single_metadata.xml
+++ b/res/layout/grid_item_single_metadata.xml
@@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/metadata"
android:layout_width="match_parent"
@@ -23,154 +23,136 @@
android:layout_marginLeft="@dimen/single_metadata_pane_horizontal_offset"
android:layout_marginRight="@dimen/single_metadata_pane_horizontal_offset"
android:layout_marginStart="@dimen/single_metadata_pane_horizontal_offset"
- android:layout_marginTop="@dimen/single_metadata_pane_vertical_offset"
- android:orientation="vertical">
+ android:layout_marginTop="@dimen/single_metadata_pane_vertical_offset">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="@dimen/single_metadata_card_layout_height"
- app:cardCornerRadius="@dimen/single_metadata_card_corner_radius"
+ app:cardCornerRadius="?android:dialogCornerRadius"
app:cardElevation="@dimen/single_metadata_card_elevation"
app:cardMaxElevation="@dimen/single_metadata_card_elevation"
app:cardPreventCornerOverlap="false"
app:cardUseCompatPadding="true"
app:contentPadding="0dp">
- <View
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@color/secondary_color" />
-
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
- <com.android.wallpaper.widget.WallpaperThumbnailView
- android:id="@+id/wallpaper_image"
- android:layout_width="@dimen/single_metadata_pane_thumb_width"
- android:layout_height="match_parent"
- android:clickable="true"
- android:contentDescription="@string/currently_set_wallpaper_thumbnail"
- android:focusable="true"
- android:foreground="?attr/selectableItemBackground" />
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
+ <com.android.wallpaper.widget.WallpaperThumbnailView
+ android:id="@+id/wallpaper_image"
+ android:layout_width="@dimen/single_metadata_pane_thumb_width"
+ android:layout_height="match_parent"
+ android:clickable="true"
+ android:contentDescription="@string/currently_set_wallpaper_thumbnail"
+ android:focusable="true"
+ android:foreground="?attr/selectableItemBackground" />
+ <ImageButton
+ style="?attr/borderlessButtonStyle"
+ android:id="@+id/wallpaper_explore_button_notext"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/single_metadata_explore_button_margin"
+ android:layout_gravity="top|end"
+ android:background="@drawable/button_over_thumbnail_background"
+ android:clickable="true"
+ android:contentDescription="@string/explore"
+ android:focusable="true"
+ android:padding="@dimen/single_metadata_explore_section_button_padding"
+ android:src="@drawable/ic_explore_24px"
+ android:visibility="gone" />
+ </FrameLayout>
<RelativeLayout
android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:layout_marginEnd="@dimen/single_metadata_pane_attributions_margin_right"
+ android:layout_marginStart="@dimen/single_metadata_pane_attributions_margin_left"
+ android:focusable="true">
- <LinearLayout
+ <TextView
+ android:id="@+id/wallpaper_presentation_mode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
- android:layout_above="@+id/wallpaper_explore_section"
- android:layout_marginEnd="@dimen/single_metadata_pane_attributions_margin_right"
- android:layout_marginLeft="@dimen/single_metadata_pane_attributions_margin_left"
- android:layout_marginRight="@dimen/single_metadata_pane_attributions_margin_right"
- android:layout_marginStart="@dimen/single_metadata_pane_attributions_margin_left"
+ android:layout_alignParentStart="true"
+ android:layout_marginTop="@dimen/single_metadata_pane_wallpaper_label_margin_top"
+ android:textColor="@color/currently_set_presentation_mode_text_color"
+ android:textSize="@dimen/abc_text_size_subhead_material"
+ android:textAppearance="@style/HeaderTextAppearance"
+ android:textStyle="bold"
+ android:ellipsize="end"
+ android:text="@string/wallpaper_destination_both"/>
+ <TextView
+ android:id="@+id/wallpaper_presentation_mode_subtitle"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentStart="true"
+ android:layout_below="@+id/wallpaper_presentation_mode"
+ android:textColor="@color/currently_set_presentation_mode_text_color"
+ android:textAppearance="@android:style/TextAppearance.DeviceDefault.Widget.ActionBar.Subtitle"
+ android:textStyle="italic" />
+ <ImageButton
+ style="?attr/borderlessButtonStyle"
+ android:id="@+id/skip_wallpaper_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentEnd="true"
+ android:layout_marginEnd="0dp"
+ android:layout_marginStart="@dimen/single_metadata_skip_button_margin"
+ android:layout_marginVertical="@dimen/single_metadata_skip_button_margin"
+ android:background="@android:color/transparent"
+ android:clickable="true"
+ android:contentDescription="@string/refresh_daily_wallpaper_content_description"
android:focusable="true"
- android:orientation="vertical">
+ android:padding="@dimen/single_metadata_explore_section_button_padding"
+ android:src="@drawable/ic_refresh_24px"
+ android:tint="@color/currently_set_presentation_mode_text_color"
+ android:visibility="gone" />
- <TextView
- android:id="@+id/wallpaper_presentation_mode"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/single_metadata_pane_wallpaper_label_margin_top"
- android:textColor="@color/currently_set_presentation_mode_text_color"
- android:textSize="@dimen/abc_text_size_body_2_material"
- android:textStyle="bold" />
+ <TextView
+ android:id="@+id/wallpaper_title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentStart="true"
+ android:layout_above="@+id/wallpaper_subtitle"
+ android:layout_marginTop="@dimen/single_metadata_pane_wallpaper_title_margin_top"
+ android:ellipsize="end"
+ android:maxLines="2"
+ android:textAppearance="@android:style/TextAppearance.DeviceDefault.Widget.TextView" />
- <TextView
- android:id="@+id/wallpaper_title"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/single_metadata_pane_wallpaper_title_margin_top"
- android:ellipsize="end"
- android:maxLines="2"
- android:textColor="@color/currently_set_title_text_color"
- android:textSize="@dimen/single_metadata_pane_wallpaper_title_text_size" />
+ <TextView
+ android:id="@+id/wallpaper_subtitle"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentStart="true"
+ android:layout_above="@+id/wallpaper_subtitle2"
+ android:layout_marginTop="@dimen/single_metadata_pane_wallpaper_subtitle_margin_top"
+ android:ellipsize="end"
+ android:maxLines="1"
+ android:textAppearance="@android:style/TextAppearance.DeviceDefault.Small"
+ android:textColor="@color/currently_set_subtitle_text_color"
+ android:textSize="@dimen/single_metadata_pane_wallpaper_subtitle_text_size" />
- <TextView
- android:id="@+id/wallpaper_subtitle"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/single_metadata_pane_wallpaper_subtitle_margin_top"
- android:ellipsize="end"
- android:maxLines="2"
- android:textColor="@color/currently_set_subtitle_text_color"
- android:textSize="@dimen/single_metadata_pane_wallpaper_subtitle_text_size" />
-
- </LinearLayout>
-
- <LinearLayout
- android:id="@+id/wallpaper_explore_section"
+ <TextView
+ android:id="@+id/wallpaper_subtitle2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
- android:orientation="vertical"
- android:visibility="gone">
+ android:layout_alignParentStart="true"
+ android:layout_marginTop="@dimen/single_metadata_pane_wallpaper_subtitle_margin_top"
+ android:layout_marginBottom="@dimen/single_metadata_pane_wallpaper_subtitle_margin_bottom"
+ android:ellipsize="end"
+ android:maxLines="1"
+ android:textAppearance="@android:style/TextAppearance.DeviceDefault.Small"
+ android:textColor="@color/currently_set_subtitle_text_color"
+ android:textSize="@dimen/single_metadata_pane_wallpaper_subtitle_text_size" />
- <View
- android:layout_width="match_parent"
- android:layout_height="1dp"
- android:background="@color/currently_set_divider_background_color" />
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="@dimen/single_metadata_explore_section_height"
- android:orientation="horizontal">
-
- <ImageButton
- android:id="@+id/skip_wallpaper_button"
- style="?attr/borderlessButtonStyle"
- android:layout_width="@dimen/single_metadata_explore_section_height"
- android:layout_height="match_parent"
- android:layout_marginEnd="@dimen/single_metadata_skip_button_margin_end"
- android:layout_marginLeft="@dimen/single_metadata_skip_button_margin_start"
- android:layout_marginRight="@dimen/single_metadata_skip_button_margin_end"
- android:layout_marginStart="@dimen/single_metadata_skip_button_margin_start"
- android:clickable="true"
- android:contentDescription="@string/refresh_daily_wallpaper_content_description"
- android:focusable="true"
- android:padding="@dimen/single_metadata_explore_section_button_padding"
- android:src="@drawable/ic_refresh_24px"
- android:visibility="gone" />
-
- <ImageButton
- android:id="@+id/wallpaper_explore_button_notext"
- style="?attr/borderlessButtonStyle"
- android:layout_width="@dimen/single_metadata_explore_section_height"
- android:layout_height="match_parent"
- android:layout_marginLeft="@dimen/single_metadata_explore_button_margin_left"
- android:layout_marginStart="@dimen/single_metadata_explore_button_margin_left"
- android:clickable="true"
- android:contentDescription="@string/explore"
- android:focusable="true"
- android:padding="@dimen/single_metadata_explore_section_button_padding"
- android:src="@drawable/ic_explore_24px"
- android:visibility="gone" />
-
- <Button
- android:id="@+id/wallpaper_explore_button"
- style="?attr/borderlessButtonStyle"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/single_metadata_explore_button_margin_left"
- android:layout_marginStart="@dimen/single_metadata_explore_button_margin_left"
- android:clickable="true"
- android:contentDescription="@string/explore"
- android:drawablePadding="@dimen/explore_button_drawable_padding"
- android:ellipsize="end"
- android:focusable="true"
- android:maxLines="1"
- android:text="@string/explore"
- android:textColor="@color/currently_set_explore_button_color"
- android:visibility="gone" />
-
- </LinearLayout>
-
-
- </LinearLayout>
</RelativeLayout>
@@ -178,4 +160,4 @@
</androidx.cardview.widget.CardView>
-</LinearLayout>
+</FrameLayout>
diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml
index 6017fef..9b26ad0 100755
--- a/res/values-land/dimens.xml
+++ b/res/values-land/dimens.xml
@@ -19,4 +19,7 @@
<!-- Dimensions for "permissions needed" tile. -->
<dimen name="permissions_needed_metadata_warning_icon_margin_top">0dp</dimen>
+
+ <dimen name="grid_tile_aspect_height">182dp</dimen>
+ <dimen name="grid_tile_aspect_width">340dp</dimen>
</resources>
diff --git a/res/values-notnight-v26/picker_colors.xml b/res/values-notnight-v26/picker_colors.xml
index cb090a6..c8c8424 100755
--- a/res/values-notnight-v26/picker_colors.xml
+++ b/res/values-notnight-v26/picker_colors.xml
@@ -22,11 +22,10 @@
<color name="category_title_scrim_color_no_thumbnail">@color/material_grey_100</color>
<color name="category_title_text_color">@color/textColorPrimary</color>
- <color name="currently_set_presentation_mode_text_color">@color/textColorSecondary</color>
+ <color name="currently_set_presentation_mode_text_color">@color/category_title_text_color</color>
<color name="currently_set_title_text_color">@color/textColorPrimary</color>
<color name="currently_set_subtitle_text_color">@color/textColorSecondary</color>
<color name="currently_set_divider_background_color">@android:color/transparent</color>
- <color name="currently_set_explore_button_color">@color/accent_color</color>
<color name="currently_set_both_header_scrim">@color/white_80_alpha</color>
<color name="currently_set_both_refresh_button_color">@color/black_54_alpha</color>
diff --git a/res/values-sw720dp/dimens.xml b/res/values-sw720dp/dimens.xml
index 499254b..3289d1b 100755
--- a/res/values-sw720dp/dimens.xml
+++ b/res/values-sw720dp/dimens.xml
@@ -16,7 +16,7 @@
<resources>
<!-- Dimensions for "single metadata card" configuration. -->
<dimen name="single_metadata_card_layout_height">256dp</dimen>
- <dimen name="single_metadata_pane_wallpaper_title_text_size">
+ <dimen name="single_metadata_pane_wallpaper_collection_title_text_size">
@dimen/abc_text_size_headline_material
</dimen>
<dimen name="single_metadata_pane_wallpaper_subtitle_text_size">
diff --git a/res/values-v26/dimens.xml b/res/values-v26/dimens.xml
index f906bbe..5e0b6aa 100755
--- a/res/values-v26/dimens.xml
+++ b/res/values-v26/dimens.xml
@@ -15,6 +15,6 @@
-->
<resources>
<!-- Dimensions for "single metadata card" configuration. -->
- <dimen name="single_metadata_card_elevation">0dp</dimen>
- <dimen name="single_metadata_pane_bottom_offset">-2dp</dimen>
+ <dimen name="single_metadata_card_elevation">4dp</dimen>
+ <dimen name="single_metadata_pane_bottom_offset">12dp</dimen>
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index f43c7a7..d7a149b 100755
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -24,6 +24,8 @@
<dimen name="grid_item_category_label_padding">12dp</dimen>
<dimen name="grid_item_category_overlay_icon_margin_bottom">24dp</dimen>
<dimen name="grid_item_category_title_height">48dp</dimen>
+ <dimen name="grid_tile_aspect_height">340dp</dimen>
+ <dimen name="grid_tile_aspect_width">182dp</dimen>
<!-- Dimensions for individual wallpaper tiles. -->
<dimen name="grid_item_individual_wallpaper_selected_inset">14dp</dimen>
@@ -34,34 +36,32 @@
<dimen name="single_metadata_card_elevation">2dp</dimen>
<dimen name="single_metadata_card_corner_radius">0dp</dimen>
<dimen name="single_metadata_card_layout_height">192dp</dimen>
- <dimen name="single_metadata_pane_vertical_offset">-8dp</dimen>
- <dimen name="single_metadata_pane_horizontal_offset">-7dp</dimen>
- <dimen name="single_metadata_pane_bottom_offset">-4dp</dimen>
- <dimen name="single_metadata_pane_thumb_width">112dp</dimen>
- <dimen name="single_metadata_pane_attributions_margin_left">24dp</dimen>
- <dimen name="single_metadata_pane_attributions_margin_right">24dp</dimen>
+ <dimen name="single_metadata_pane_vertical_offset">8dp</dimen>
+ <dimen name="single_metadata_pane_horizontal_offset">8dp</dimen>
+ <dimen name="single_metadata_pane_bottom_offset">12dp</dimen>
+ <dimen name="single_metadata_pane_thumb_width">120dp</dimen>
+ <dimen name="single_metadata_pane_attributions_margin_left">16dp</dimen>
+ <dimen name="single_metadata_pane_attributions_margin_right">16dp</dimen>
<dimen name="single_metadata_pane_wallpaper_label_margin_top">16dp</dimen>
<dimen name="single_metadata_pane_wallpaper_title_margin_top">12dp</dimen>
- <dimen name="single_metadata_pane_wallpaper_title_text_size">
- @dimen/abc_text_size_subhead_material
- </dimen>
+
<dimen name="single_metadata_pane_wallpaper_subtitle_text_size">
@dimen/abc_text_size_caption_material
</dimen>
- <dimen name="single_metadata_pane_wallpaper_subtitle_margin_top">12dp</dimen>
- <dimen name="single_metadata_explore_button_margin_left">10dp</dimen>
- <dimen name="single_metadata_explore_section_height">52dp</dimen>
- <dimen name="single_metadata_skip_button_margin_start">6dp</dimen>
- <dimen name="single_metadata_skip_button_margin_end">-10dp</dimen>
- <dimen name="single_metadata_explore_section_button_padding">14dp</dimen>
+ <dimen name="single_metadata_pane_wallpaper_subtitle_margin_top">3dp</dimen>
+ <dimen name="single_metadata_pane_wallpaper_subtitle_margin_bottom">16dp</dimen>
+ <dimen name="single_metadata_explore_button_margin">12dp</dimen>
+ <dimen name="single_metadata_explore_section_height">48dp</dimen>
+ <dimen name="single_metadata_skip_button_margin">10dp</dimen>
+ <dimen name="single_metadata_explore_section_button_padding">5dp</dimen>
<!-- Dimensions for "both metadata tiles" configuration. -->
- <dimen name="both_metadata_thumb_height">304dp</dimen>
+ <dimen name="both_metadata_thumb_height">208dp</dimen>
<dimen name="both_metadata_content_side_margin">12dp</dimen>
<dimen name="both_metadata_scrim_height">68dp</dimen>
<dimen name="both_metadata_scrim_content_top_margin">9dp</dimen>
<dimen name="both_metadata_scrim_content_bottom_margin">16dp</dimen>
- <dimen name="both_metadata_attribution_section_height">120dp</dimen>
+ <dimen name="both_metadata_attribution_section_height">132dp</dimen>
<dimen name="both_metadata_attribution_section_top_margin">12dp</dimen>
<dimen name="both_metadata_attribution_section_bottom_margin">16dp</dimen>
<dimen name="both_metadata_title_text_size">@dimen/abc_text_size_body_2_material</dimen>
@@ -79,7 +79,7 @@
<dimen name="categories_loading_indicator_margin_top">16dp</dimen>
<!-- Dimensions for "Select wallpaper" header. -->
- <dimen name="select_wallpaper_header_height">40dp</dimen>
+ <dimen name="select_wallpaper_header_height">48dp</dimen>
<dimen name="select_wallpaper_header_margin_left">12dp</dimen>
<!-- Dimensions for "daily refresh" rotation tile in individual picker. -->
diff --git a/res/values/picker_colors.xml b/res/values/picker_colors.xml
index f3686de..f6c85c5 100755
--- a/res/values/picker_colors.xml
+++ b/res/values/picker_colors.xml
@@ -40,11 +40,11 @@
<color name="category_title_scrim_color_no_thumbnail">@color/translucent_black</color>
<color name="category_title_text_color">@color/material_white_100</color>
- <color name="currently_set_presentation_mode_text_color">@color/accent_color</color>
+ <color name="currently_set_presentation_mode_text_color">@color/category_title_text_color</color>
<color name="currently_set_title_text_color">@color/material_white_text</color>
<color name="currently_set_subtitle_text_color">@color/white_70_alpha</color>
<color name="currently_set_divider_background_color">@color/material_white_divider</color>
- <color name="currently_set_explore_button_color">@color/material_white_text</color>
+ <color name="currently_set_explore_button_color">@color/white_80_alpha</color>
<color name="currently_set_both_header_scrim">@color/translucent_black</color>
<color name="currently_set_both_refresh_button_color">@color/material_white_100</color>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2c355d1..83bea72 100755
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -21,8 +21,8 @@
<string name="app_name">@string/wallpaper_app_name</string>
<!-- UI Strings -->
- <!-- Label which asks the user to select a wallpaper from the given choices. [CHAR LIMIT=50] -->
- <string name="select_wallpaper_label">Select wallpaper</string>
+ <!-- Label which asks the user to select a wallpaper category from the given choices. [CHAR LIMIT=50] -->
+ <string name="select_wallpaper_label">Wallpaper categories</string>
<!-- Label for a button which lets user set the displayed image as wallpaper. [CHAR LIMIT=30] -->
<string name="set_wallpaper_button_text">Set Wallpaper</string>
@@ -52,6 +52,10 @@
set on the device and is part of a daily rotation of wallpapers. [CHAR LIMIT=100] -->
<string name="rotating_wallpaper_presentation_mode_message">Daily wallpaper</string>
+ <!-- Label indicating that the wallpaper being shown is set both on home screen and on lock
+ screen [CHAR LIMIT=100] -->
+ <string name="wallpaper_destination_both">Home & Lock screen</string>
+
<!-- Label referring to the home screen of the device, i.e. shown behind the launcher.
[CHAR LIMIT=30] -->
<string name="home_screen_message">Home screen</string>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index bc1e5a7..0c66ab1 100755
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -103,5 +103,7 @@
<item name="textAllCaps">false</item>
</style>
- <style name="HeaderTextAppearance" parent="TextAppearance.AppCompat.Widget.ActionBar.Title"/>
+ <style name="HeaderTextAppearance" parent="@android:style/TextAppearance.DeviceDefault.Widget.ActionBar.Title">
+ <item name="android:textFontWeight">400</item>
+ </style>
</resources>
diff --git a/src/com/android/wallpaper/picker/AttributionFormatter.java b/src/com/android/wallpaper/picker/AttributionFormatter.java
index 2476bfd..dcd6888 100755
--- a/src/com/android/wallpaper/picker/AttributionFormatter.java
+++ b/src/com/android/wallpaper/picker/AttributionFormatter.java
@@ -58,13 +58,13 @@
switch (presentationMode) {
case WallpaperPreferences.PRESENTATION_MODE_STATIC:
- return resources.getString(R.string.static_wallpaper_presentation_mode_message);
+ return "";
case WallpaperPreferences.PRESENTATION_MODE_ROTATING:
return resources.getString(R.string.rotating_wallpaper_presentation_mode_message);
default:
Log.e(TAG, "No matching human-readable string for wallpaper presentation mode: "
+ presentationMode);
- return resources.getString(R.string.static_wallpaper_presentation_mode_message);
+ return "";
}
}
}
diff --git a/src/com/android/wallpaper/picker/CategoryFragment.java b/src/com/android/wallpaper/picker/CategoryFragment.java
index 76f857b..0e3c36d 100755
--- a/src/com/android/wallpaper/picker/CategoryFragment.java
+++ b/src/com/android/wallpaper/picker/CategoryFragment.java
@@ -23,13 +23,11 @@
import android.content.pm.PackageManager;
import android.graphics.Point;
import android.graphics.PorterDuff.Mode;
-import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
import android.os.Bundle;
import android.provider.Settings;
-import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Display;
@@ -41,7 +39,6 @@
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ImageView;
-import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
@@ -55,7 +52,6 @@
import com.android.wallpaper.R;
import com.android.wallpaper.asset.Asset;
-import com.android.wallpaper.compat.ButtonDrawableSetterCompat;
import com.android.wallpaper.config.Flags;
import com.android.wallpaper.model.Category;
import com.android.wallpaper.model.WallpaperInfo;
@@ -148,7 +144,7 @@
View view = inflater.inflate(
R.layout.fragment_category_picker, container, /* attachToRoot */ false);
- mImageGrid = (RecyclerView) view.findViewById(R.id.category_grid);
+ mImageGrid = view.findViewById(R.id.category_grid);
GridMarginDecoration.applyTo(mImageGrid);
mTileSizePx = TileSizeCalculator.getCategoryTileSize(getActivity());
@@ -482,45 +478,29 @@
implements MetadataHolder {
private WallpaperInfo mWallpaperInfo;
private ImageView mWallpaperImage;
- private TextView mWallpaperPresentationMode;
+ private TextView mWallpaperPresentationModeSubtitle;
private TextView mWallpaperTitle;
private TextView mWallpaperSubtitle;
- private ViewGroup mWallpaperExploreSection;
- private Button mWallpaperExploreButton;
+ private TextView mWallpaperSubtitle2;
private ImageButton mWallpaperExploreButtonNoText;
private ImageButton mSkipWallpaperButton;
public SingleWallpaperMetadataHolder(View metadataView) {
super(metadataView);
- mWallpaperImage = (ImageView) metadataView.findViewById(R.id.wallpaper_image);
+ mWallpaperImage = metadataView.findViewById(R.id.wallpaper_image);
mWallpaperImage.getLayoutParams().width = getSingleWallpaperImageWidth();
- mWallpaperPresentationMode =
- (TextView) metadataView.findViewById(R.id.wallpaper_presentation_mode);
- mWallpaperTitle = (TextView) metadataView.findViewById(R.id.wallpaper_title);
- mWallpaperSubtitle = (TextView) metadataView.findViewById(R.id.wallpaper_subtitle);
+ mWallpaperPresentationModeSubtitle =
+ metadataView.findViewById(R.id.wallpaper_presentation_mode_subtitle);
+ mWallpaperTitle = metadataView.findViewById(R.id.wallpaper_title);
+ mWallpaperSubtitle = metadataView.findViewById(R.id.wallpaper_subtitle);
+ mWallpaperSubtitle2 = metadataView.findViewById(R.id.wallpaper_subtitle2);
- mWallpaperExploreSection =
- (ViewGroup) metadataView.findViewById(R.id.wallpaper_explore_section);
- mWallpaperExploreButton =
- (Button) metadataView.findViewById(R.id.wallpaper_explore_button);
- mWallpaperExploreButtonNoText = (ImageButton)
+ mWallpaperExploreButtonNoText =
metadataView.findViewById(R.id.wallpaper_explore_button_notext);
- mSkipWallpaperButton = (ImageButton) metadataView.findViewById(R.id.skip_wallpaper_button);
-
- if (Flags.skipDailyWallpaperButtonEnabled) {
- Drawable exploreButtonDrawable = getContext().getDrawable(
- R.drawable.ic_explore_24px);
- // This Drawable's state is shared across the app, so make a copy of it before applying a
- // color tint as not to affect other clients elsewhere in the app.
- exploreButtonDrawable = exploreButtonDrawable.getConstantState().newDrawable().mutate();
- exploreButtonDrawable.setColorFilter(
- getResources().getColor(R.color.currently_set_explore_button_color), Mode.SRC_IN);
- ButtonDrawableSetterCompat.setDrawableToButtonStart(
- mWallpaperExploreButton, exploreButtonDrawable);
- }
+ mSkipWallpaperButton = metadataView.findViewById(R.id.skip_wallpaper_button);
}
/**
@@ -528,7 +508,7 @@
*/
@Override
public void bindWallpapers(WallpaperInfo homeWallpaper, WallpaperInfo lockWallpaper,
- @PresentationMode int presentationMode) {
+ @PresentationMode int presentationMode) {
mWallpaperInfo = homeWallpaper;
bindWallpaperAsset();
@@ -555,7 +535,7 @@
private void bindWallpaperText(@PresentationMode int presentationMode) {
Context appContext = getActivity().getApplicationContext();
- mWallpaperPresentationMode.setText(
+ mWallpaperPresentationModeSubtitle.setText(
AttributionFormatter.getHumanReadableWallpaperPresentationMode(
appContext, presentationMode));
@@ -563,13 +543,15 @@
if (!attributions.isEmpty()) {
mWallpaperTitle.setText(attributions.get(0));
}
- String subtitleText =
- AttributionFormatter.formatWallpaperSubtitle(appContext, mWallpaperInfo);
- if (!TextUtils.isEmpty(subtitleText)) {
- mWallpaperSubtitle.setText(subtitleText);
- mWallpaperSubtitle.setVisibility(View.VISIBLE);
+ if (attributions.size() > 1) {
+ mWallpaperSubtitle.setText(attributions.get(1));
} else {
- mWallpaperSubtitle.setVisibility(View.GONE);
+ mWallpaperSubtitle.setVisibility(View.INVISIBLE);
+ }
+ if (attributions.size() > 2) {
+ mWallpaperSubtitle2.setText(attributions.get(2));
+ } else {
+ mWallpaperSubtitle2.setVisibility(View.INVISIBLE);
}
}
@@ -612,53 +594,26 @@
boolean showSkipWallpaperButton = Flags.skipDailyWallpaperButtonEnabled
&& presentationMode == WallpaperPreferences.PRESENTATION_MODE_ROTATING;
- if (exploreIntent != null || showSkipWallpaperButton) {
- mWallpaperExploreSection.setVisibility(View.VISIBLE);
-
- if (exploreIntent != null) {
- View exploreButton;
-
- if (showSkipWallpaperButton) {
- exploreButton = mWallpaperExploreButtonNoText;
- mWallpaperExploreButtonNoText.setImageDrawable(getContext().getDrawable(
+ if (exploreIntent != null) {
+ mWallpaperExploreButtonNoText.setImageDrawable(getContext().getDrawable(
mWallpaperInfo.getActionIconRes(appContext)));
- mWallpaperExploreButtonNoText.setContentDescription(
+ mWallpaperExploreButtonNoText.setContentDescription(
getString(mWallpaperInfo.getActionLabelRes(appContext)));
- mWallpaperExploreButtonNoText.setColorFilter(
- getResources().getColor(R.color.currently_set_explore_button_color),
+ mWallpaperExploreButtonNoText.setColorFilter(
+ getResources().getColor(R.color.currently_set_explore_button_color,
+ getContext().getTheme()),
Mode.SRC_IN);
- mWallpaperExploreButton.setVisibility(View.GONE);
- } else {
- exploreButton = mWallpaperExploreButton;
+ mWallpaperExploreButtonNoText.setVisibility(View.VISIBLE);
+ mWallpaperExploreButtonNoText.setOnClickListener((View view) -> {
+ eventLogger.logActionClicked(mWallpaperInfo.getCollectionId(appContext),
+ mWallpaperInfo.getActionLabelRes(appContext));
+ startActivity(exploreIntent);
+ });
+ }
- Drawable drawable = getContext().getDrawable(
- mWallpaperInfo.getActionIconRes(appContext)).getConstantState()
- .newDrawable().mutate();
- // Color the "compass" icon with the accent color.
- drawable.setColorFilter(
- getResources().getColor(R.color.accent_color), Mode.SRC_IN);
- ButtonDrawableSetterCompat.setDrawableToButtonStart(
- mWallpaperExploreButton, drawable);
- mWallpaperExploreButton.setText(
- mWallpaperInfo.getActionLabelRes(appContext));
- mWallpaperExploreButtonNoText.setVisibility(View.GONE);
- }
- exploreButton.setVisibility(View.VISIBLE);
- exploreButton.setOnClickListener((View view) -> {
- eventLogger.logActionClicked(mWallpaperInfo.getCollectionId(appContext),
- mWallpaperInfo.getActionLabelRes(appContext));
- startActivity(exploreIntent);
- });
- }
-
- if (showSkipWallpaperButton) {
- mSkipWallpaperButton.setVisibility(View.VISIBLE);
- mSkipWallpaperButton.setColorFilter(
- getResources().getColor(R.color.currently_set_explore_button_color), Mode.SRC_IN);
- mSkipWallpaperButton.setOnClickListener((View view) -> refreshDailyWallpaper());
- }
- } else {
- mWallpaperExploreSection.setVisibility(View.GONE);
+ if (showSkipWallpaperButton) {
+ mSkipWallpaperButton.setVisibility(View.VISIBLE);
+ mSkipWallpaperButton.setOnClickListener((View view) -> refreshDailyWallpaper());
}
}
}
@@ -670,28 +625,22 @@
private class TwoWallpapersMetadataHolder extends RecyclerView.ViewHolder
implements MetadataHolder {
private WallpaperInfo mHomeWallpaperInfo;
- private FrameLayout mHomeWallpaperSection;
private ImageView mHomeWallpaperImage;
- private LinearLayout mHomeWallpaperTopSection;
private TextView mHomeWallpaperPresentationMode;
private TextView mHomeWallpaperTitle;
private TextView mHomeWallpaperSubtitle1;
private TextView mHomeWallpaperSubtitle2;
- private ImageButton mHomeWallpaperExploreButtonLegacy;
private ImageButton mHomeWallpaperExploreButton;
private ImageButton mSkipWallpaperButton;
+ private ViewGroup mHomeWallpaperPresentationSection;
- private FrameLayout mLockWallpaperSection;
private WallpaperInfo mLockWallpaperInfo;
private ImageView mLockWallpaperImage;
- private LinearLayout mLockWallpaperTopSection;
- private TextView mLockWallpaperPresentationMode;
private TextView mLockWallpaperTitle;
private TextView mLockWallpaperSubtitle1;
private TextView mLockWallpaperSubtitle2;
- private ImageButton mLockWallpaperExploreButtonLegacy;
private ImageButton mLockWallpaperExploreButton;
public TwoWallpapersMetadataHolder(View metadataView) {
@@ -708,41 +657,37 @@
int bothWallpaperImageWidth = getBothWallpaperImageWidth();
- mHomeWallpaperSection = (FrameLayout) metadataView.findViewById(R.id.home_wallpaper_section);
- mHomeWallpaperSection.setMinimumWidth(bothWallpaperImageWidth);
- mHomeWallpaperImage = (ImageView) metadataView.findViewById(R.id.home_wallpaper_image);
- mHomeWallpaperTopSection =
- (LinearLayout) metadataView.findViewById(R.id.home_wallpaper_top_section);
- mHomeWallpaperPresentationMode =
- (TextView) metadataView.findViewById(R.id.home_wallpaper_presentation_mode);
- mHomeWallpaperTitle = (TextView) metadataView.findViewById(R.id.home_wallpaper_title);
- mHomeWallpaperSubtitle1 = (TextView) metadataView.findViewById(R.id.home_wallpaper_subtitle1);
- mHomeWallpaperSubtitle2 = (TextView) metadataView.findViewById(R.id.home_wallpaper_subtitle2);
- mHomeWallpaperExploreButtonLegacy =
- (ImageButton) metadataView.findViewById(R.id.home_wallpaper_explore_button_legacy);
- mHomeWallpaperExploreButton =
- (ImageButton) metadataView.findViewById(R.id.home_wallpaper_explore_button);
- mSkipWallpaperButton = (ImageButton) metadataView.findViewById(R.id.skip_home_wallpaper);
+ FrameLayout homeWallpaperSection = metadataView.findViewById(
+ R.id.home_wallpaper_section);
+ homeWallpaperSection.setMinimumWidth(bothWallpaperImageWidth);
+ mHomeWallpaperImage = metadataView.findViewById(R.id.home_wallpaper_image);
- mLockWallpaperSection = (FrameLayout) metadataView.findViewById(R.id.lock_wallpaper_section);
- mLockWallpaperSection.setMinimumWidth(bothWallpaperImageWidth);
- mLockWallpaperImage = (ImageView) metadataView.findViewById(R.id.lock_wallpaper_image);
- mLockWallpaperTopSection =
- (LinearLayout) metadataView.findViewById(R.id.lock_wallpaper_top_section);
- mLockWallpaperPresentationMode =
- (TextView) metadataView.findViewById(R.id.lock_wallpaper_presentation_mode);
- mLockWallpaperTitle = (TextView) metadataView.findViewById(R.id.lock_wallpaper_title);
- mLockWallpaperSubtitle1 = (TextView) metadataView.findViewById(R.id.lock_wallpaper_subtitle1);
- mLockWallpaperSubtitle2 = (TextView) metadataView.findViewById(R.id.lock_wallpaper_subtitle2);
- mLockWallpaperExploreButtonLegacy =
- (ImageButton) metadataView.findViewById(R.id.lock_wallpaper_explore_button_legacy);
+ mHomeWallpaperPresentationMode =
+ metadataView.findViewById(R.id.home_wallpaper_presentation_mode);
+ mHomeWallpaperTitle = metadataView.findViewById(R.id.home_wallpaper_title);
+ mHomeWallpaperSubtitle1 = metadataView.findViewById(R.id.home_wallpaper_subtitle1);
+ mHomeWallpaperSubtitle2 = metadataView.findViewById(R.id.home_wallpaper_subtitle2);
+ mHomeWallpaperPresentationSection = metadataView.findViewById(
+ R.id.home_wallpaper_presentation_section);
+ mHomeWallpaperExploreButton =
+ metadataView.findViewById(R.id.home_wallpaper_explore_button);
+ mSkipWallpaperButton = metadataView.findViewById(R.id.skip_home_wallpaper);
+
+ FrameLayout lockWallpaperSection = metadataView.findViewById(
+ R.id.lock_wallpaper_section);
+ lockWallpaperSection.setMinimumWidth(bothWallpaperImageWidth);
+ mLockWallpaperImage = metadataView.findViewById(R.id.lock_wallpaper_image);
+
+ mLockWallpaperTitle = metadataView.findViewById(R.id.lock_wallpaper_title);
+ mLockWallpaperSubtitle1 = metadataView.findViewById(R.id.lock_wallpaper_subtitle1);
+ mLockWallpaperSubtitle2 = metadataView.findViewById(R.id.lock_wallpaper_subtitle2);
mLockWallpaperExploreButton =
- (ImageButton) metadataView.findViewById(R.id.lock_wallpaper_explore_button);
+ metadataView.findViewById(R.id.lock_wallpaper_explore_button);
}
@Override
public void bindWallpapers(WallpaperInfo homeWallpaper, WallpaperInfo lockWallpaper,
- @PresentationMode int presentationMode) {
+ @PresentationMode int presentationMode) {
bindHomeWallpaper(homeWallpaper, presentationMode);
bindLockWallpaper(lockWallpaper);
}
@@ -756,8 +701,9 @@
mHomeWallpaperInfo = homeWallpaper;
homeWallpaper.getThumbAsset(appContext).loadDrawable(
- getActivity(), mHomeWallpaperImage, getResources().getColor(R.color.secondary_color));
- mHomeWallpaperTopSection.setVisibility(View.VISIBLE);
+ getActivity(), mHomeWallpaperImage,
+ getResources().getColor(R.color.secondary_color, getContext().getTheme()));
+
mHomeWallpaperPresentationMode.setText(
AttributionFormatter.getHumanReadableWallpaperPresentationMode(
appContext, presentationMode));
@@ -775,9 +721,6 @@
final String homeActionUrl = homeWallpaper.getActionUrl(appContext);
- ImageButton exploreButton = Flags.skipDailyWallpaperButtonEnabled
- ? mHomeWallpaperExploreButton
- : mHomeWallpaperExploreButtonLegacy;
if (homeActionUrl != null && !homeActionUrl.isEmpty()) {
Uri homeExploreUri = Uri.parse(homeActionUrl);
@@ -785,53 +728,49 @@
InjectorProvider.getInjector().getExploreIntentChecker(appContext);
intentChecker.fetchValidActionViewIntent(
- homeExploreUri, (@Nullable Intent exploreIntent) -> {
- if (exploreIntent == null || getActivity() == null) {
- return;
- }
+ homeExploreUri, (@Nullable Intent exploreIntent) -> {
+ if (exploreIntent == null || getActivity() == null) {
+ return;
+ }
- exploreButton.setVisibility(View.VISIBLE);
- exploreButton.setImageDrawable(getContext().getDrawable(
- homeWallpaper.getActionIconRes(appContext)));
- exploreButton.setContentDescription(getString(homeWallpaper
- .getActionLabelRes(appContext)));
- exploreButton.setColorFilter(
- getResources().getColor(R.color.currently_set_explore_button_color), Mode.SRC_IN);
- exploreButton.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- eventLogger.logActionClicked(
- mHomeWallpaperInfo.getCollectionId(appContext),
- mHomeWallpaperInfo.getActionLabelRes(appContext));
- startActivity(exploreIntent);
- }
- });
+ mHomeWallpaperExploreButton.setVisibility(View.VISIBLE);
+ mHomeWallpaperExploreButton.setImageDrawable(getContext().getDrawable(
+ homeWallpaper.getActionIconRes(appContext)));
+ mHomeWallpaperExploreButton.setContentDescription(getString(homeWallpaper
+ .getActionLabelRes(appContext)));
+ mHomeWallpaperExploreButton.setColorFilter(
+ getResources().getColor(R.color.currently_set_explore_button_color,
+ getContext().getTheme()),
+ Mode.SRC_IN);
+ mHomeWallpaperExploreButton.setOnClickListener(v -> {
+ eventLogger.logActionClicked(
+ mHomeWallpaperInfo.getCollectionId(appContext),
+ mHomeWallpaperInfo.getActionLabelRes(appContext));
+ startActivity(exploreIntent);
});
+ });
} else {
- exploreButton.setVisibility(View.GONE);
+ mHomeWallpaperExploreButton.setVisibility(View.GONE);
}
- if (Flags.skipDailyWallpaperButtonEnabled
- && presentationMode == WallpaperPreferences.PRESENTATION_MODE_ROTATING) {
- mSkipWallpaperButton.setVisibility(View.VISIBLE);
- mSkipWallpaperButton.setColorFilter(
- getResources().getColor(R.color.currently_set_explore_button_color), Mode.SRC_IN);
- mSkipWallpaperButton.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View view) {
- refreshDailyWallpaper();
- }
- });
- } else {
- mSkipWallpaperButton.setVisibility(View.GONE);
- }
-
- mHomeWallpaperImage.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- eventLogger.logCurrentWallpaperPreviewed();
- getFragmentHost().showViewOnlyPreview(mHomeWallpaperInfo);
+ if (presentationMode == WallpaperPreferences.PRESENTATION_MODE_ROTATING) {
+ mHomeWallpaperPresentationSection.setVisibility(View.VISIBLE);
+ if (Flags.skipDailyWallpaperButtonEnabled) {
+ mSkipWallpaperButton.setVisibility(View.VISIBLE);
+ mSkipWallpaperButton.setColorFilter(
+ getResources().getColor(R.color.currently_set_explore_button_color,
+ getContext().getTheme()), Mode.SRC_IN);
+ mSkipWallpaperButton.setOnClickListener(view -> refreshDailyWallpaper());
+ } else {
+ mSkipWallpaperButton.setVisibility(View.GONE);
}
+ } else {
+ mHomeWallpaperPresentationSection.setVisibility(View.GONE);
+ }
+
+ mHomeWallpaperImage.setOnClickListener(v -> {
+ eventLogger.logCurrentWallpaperPreviewed();
+ getFragmentHost().showViewOnlyPreview(mHomeWallpaperInfo);
});
}
@@ -849,13 +788,6 @@
lockWallpaper.getThumbAsset(appContext).loadDrawable(
getActivity(), mLockWallpaperImage, getResources().getColor(R.color.secondary_color));
- mLockWallpaperTopSection.setVisibility(View.VISIBLE);
-
- // Daily wallpaper rotation can't be in effect on only the lock screen, so if there's a
- // separate lock screen, it must be presented as "Currently set".
- mLockWallpaperPresentationMode.setText(
- AttributionFormatter.getHumanReadableWallpaperPresentationMode(
- appContext, WallpaperPreferences.PRESENTATION_MODE_STATIC));
List<String> lockAttributions = lockWallpaper.getAttributions(appContext);
if (!lockAttributions.isEmpty()) {
@@ -870,9 +802,6 @@
final String lockActionUrl = lockWallpaper.getActionUrl(appContext);
- ImageButton exploreButton = Flags.skipDailyWallpaperButtonEnabled
- ? mLockWallpaperExploreButton
- : mLockWallpaperExploreButtonLegacy;
if (lockActionUrl != null && !lockActionUrl.isEmpty()) {
Uri lockExploreUri = Uri.parse(lockActionUrl);
@@ -883,16 +812,16 @@
if (exploreIntent == null || getActivity() == null) {
return;
}
- exploreButton.setImageDrawable(getContext().getDrawable(
+ mLockWallpaperExploreButton.setImageDrawable(getContext().getDrawable(
lockWallpaper.getActionIconRes(appContext)));
- exploreButton.setContentDescription(getString(
+ mLockWallpaperExploreButton.setContentDescription(getString(
lockWallpaper.getActionLabelRes(appContext)));
- exploreButton.setVisibility(View.VISIBLE);
- exploreButton.setColorFilter(
+ mLockWallpaperExploreButton.setVisibility(View.VISIBLE);
+ mLockWallpaperExploreButton.setColorFilter(
getResources().getColor(
R.color.currently_set_explore_button_color),
Mode.SRC_IN);
- exploreButton.setOnClickListener(new OnClickListener() {
+ mLockWallpaperExploreButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
eventLogger.logActionClicked(
@@ -903,7 +832,7 @@
});
});
} else {
- exploreButton.setVisibility(View.GONE);
+ mLockWallpaperExploreButton.setVisibility(View.GONE);
}
mLockWallpaperImage.setOnClickListener(new OnClickListener() {
@@ -930,10 +859,10 @@
super(itemView);
itemView.setOnClickListener(this);
- mTileLayout = (RelativeLayout) itemView.findViewById(R.id.tile);
- mImageView = (ImageView) itemView.findViewById(R.id.image);
- mOverlayIconView = (ImageView) itemView.findViewById(R.id.overlay_icon);
- mTitleView = (TextView) itemView.findViewById(R.id.category_title);
+ mTileLayout = itemView.findViewById(R.id.tile);
+ mImageView = itemView.findViewById(R.id.image);
+ mOverlayIconView = itemView.findViewById(R.id.overlay_icon);
+ mTitleView = itemView.findViewById(R.id.category_title);
mTileLayout.getLayoutParams().height = mTileSizePx.y;
}
@@ -1000,8 +929,6 @@
.load(nullObj)
.into(mImageView);
- mTitleView.setBackgroundColor(getResources().getColor(
- R.color.category_title_scrim_color_no_thumbnail));
}
}
}
@@ -1013,7 +940,7 @@
private class LoadingIndicatorHolder extends RecyclerView.ViewHolder {
public LoadingIndicatorHolder(View view) {
super(view);
- ProgressBar progressBar = (ProgressBar) view.findViewById(R.id.loading_indicator);
+ ProgressBar progressBar = view.findViewById(R.id.loading_indicator);
progressBar.getIndeterminateDrawable().setColorFilter(
getResources().getColor(R.color.accent_color), Mode.SRC_IN);
}
@@ -1029,8 +956,7 @@
public PermissionNeededHolder(View view) {
super(view);
- mAllowAccessButton =
- (Button) view.findViewById(R.id.permission_needed_allow_access_button);
+ mAllowAccessButton = view.findViewById(R.id.permission_needed_allow_access_button);
mAllowAccessButton.setOnClickListener((View v) -> {
getFragmentHost().requestExternalStoragePermission(mAdapter);
});
@@ -1039,8 +965,7 @@
// placeholder.
String appName = getString(R.string.app_name);
String explanation = getString(R.string.permission_needed_explanation, appName);
- TextView explanationTextView =
- (TextView) view.findViewById(R.id.permission_needed_explanation);
+ TextView explanationTextView = view.findViewById(R.id.permission_needed_explanation);
explanationTextView.setText(explanation);
}
}
diff --git a/src/com/android/wallpaper/util/TileSizeCalculator.java b/src/com/android/wallpaper/util/TileSizeCalculator.java
index 1c2de19..f1c76b2 100755
--- a/src/com/android/wallpaper/util/TileSizeCalculator.java
+++ b/src/com/android/wallpaper/util/TileSizeCalculator.java
@@ -17,6 +17,7 @@
import android.app.Activity;
import android.content.Context;
+import android.content.res.Resources;
import android.graphics.Point;
import android.util.DisplayMetrics;
import android.view.Display;
@@ -147,7 +148,8 @@
* in units of px.
*/
private static Point getTileSize(Context context, int columnCount, int windowWidthPx) {
- WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
+ WindowManager windowManager = (WindowManager)
+ context.getSystemService(Context.WINDOW_SERVICE);
Display display = windowManager.getDefaultDisplay();
Point screenSizePx = ScreenSizeCalculator.getInstance().getScreenSize(display);
@@ -156,10 +158,11 @@
@FormFactor int formFactor = formFactorChecker.getFormFactor();
int gridPaddingPx;
+ Resources res = context.getResources();
if (formFactor == FormFactorChecker.FORM_FACTOR_MOBILE) {
- gridPaddingPx = context.getResources().getDimensionPixelSize(R.dimen.grid_padding);
+ gridPaddingPx = res.getDimensionPixelSize(R.dimen.grid_padding);
} else { // DESKTOP
- gridPaddingPx = context.getResources().getDimensionPixelSize(R.dimen.grid_padding_desktop);
+ gridPaddingPx = res.getDimensionPixelSize(R.dimen.grid_padding_desktop);
}
// Note: don't need to multiply by density because getting the dimension from resources already
@@ -169,7 +172,9 @@
int widthPx = Math.round((float) availableWidthPx / columnCount);
int heightPx = Math.round(((float) availableWidthPx / columnCount)
- * screenSizePx.y / screenSizePx.x);
+ //* screenSizePx.y / screenSizePx.x);
+ * res.getDimensionPixelSize(R.dimen.grid_tile_aspect_height)
+ / res.getDimensionPixelSize(R.dimen.grid_tile_aspect_width));
return new Point(widthPx, heightPx);
}