Snap for 9647254 from b05b6ad99abb4c0d4320945d93a32ddd256df09f to tm-qpr3-release
Change-Id: Ia54b1498dc96671ed71f7fd4dc0143d84a75b97e
diff --git a/res/drawable/ic_share.xml b/res/drawable/ic_share.xml
new file mode 100644
index 0000000..5b8b29d
--- /dev/null
+++ b/res/drawable/ic_share.xml
@@ -0,0 +1,26 @@
+<!--
+ Copyright (C) 2023 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="@dimen/wallpaper_control_icon_size"
+ android:height="@dimen/wallpaper_control_icon_size"
+ android:viewportWidth="@dimen/wallpaper_control_icon_viewport_size"
+ android:viewportHeight="@dimen/wallpaper_control_icon_viewport_size"
+ android:tintMode="multiply"
+ android:tint="@color/wallpaper_control_button_ic_color_tint">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M18,16c-0.79,0 -1.5,0.31 -2.03,0.81L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.53,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.48 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.05,4.12c-0.05,0.22 -0.09,0.45 -0.09,0.69 0,1.66 1.34,3 3,3s3,-1.34 3,-3 -1.34,-3 -3,-3zM18,4c0.55,0 1,0.45 1,1s-0.45,1 -1,1 -1,-0.45 -1,-1 0.45,-1 1,-1zM6,13c-0.55,0 -1,-0.45 -1,-1s0.45,-1 1,-1 1,0.45 1,1 -0.45,1 -1,1zM18,20c-0.55,0 -1,-0.45 -1,-1s0.45,-1 1,-1 1,0.45 1,1 -0.45,1 -1,1z"/>
+</vector>
diff --git a/res/drawable/wallpaper_control_button_share.xml b/res/drawable/wallpaper_control_button_share.xml
new file mode 100644
index 0000000..39c29dd
--- /dev/null
+++ b/res/drawable/wallpaper_control_button_share.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2023 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.
+-->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/wallpaper_control_button_background" />
+ <item android:drawable="@drawable/ic_share" />
+</layer-list>
\ No newline at end of file
diff --git a/res/layout/wallpaper_control_button_group.xml b/res/layout/wallpaper_control_button_group.xml
index 68e5c4c..966aa18 100644
--- a/res/layout/wallpaper_control_button_group.xml
+++ b/res/layout/wallpaper_control_button_group.xml
@@ -70,6 +70,17 @@
android:visibility="gone" />
<ToggleButton
+ android:id="@+id/share_button"
+ android:layout_width="@dimen/wallpaper_control_button_size"
+ android:layout_height="@dimen/wallpaper_control_button_size"
+ android:background="@android:color/transparent"
+ android:contentDescription="@string/tab_share"
+ android:foreground="@drawable/wallpaper_control_button_share"
+ android:textOff=""
+ android:textOn=""
+ android:visibility="gone" />
+
+ <ToggleButton
android:id="@+id/information_button"
android:layout_width="@dimen/wallpaper_control_button_size"
android:layout_height="@dimen/wallpaper_control_button_size"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index f26607c..0f439c8 100755
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -303,6 +303,10 @@
[CHAR_LIMIT=25] -->
<string name="tab_effects">Effects</string>
+ <!-- Label for the 'Share' tab of view pager in wallpaper preview activity.
+ [CHAR_LIMIT=25] -->
+ <string name="tab_share">Share</string>
+
<!-- Generic label for the my photos action [CHAR_LIMIT=20] -->
<string name="my_photos">My Photos</string>
diff --git a/src/com/android/wallpaper/widget/WallpaperControlButtonGroup.java b/src/com/android/wallpaper/widget/WallpaperControlButtonGroup.java
index 042f3eb..c5c8f7e 100644
--- a/src/com/android/wallpaper/widget/WallpaperControlButtonGroup.java
+++ b/src/com/android/wallpaper/widget/WallpaperControlButtonGroup.java
@@ -39,20 +39,22 @@
public static final int CUSTOMIZE = 2;
public static final int EFFECTS = 3;
public static final int INFORMATION = 4;
+ public static final int SHARE = 5;
/**
* Overlay tab
*/
- @IntDef({DELETE, EDIT, CUSTOMIZE, EFFECTS, INFORMATION})
+ @IntDef({DELETE, EDIT, CUSTOMIZE, EFFECTS, SHARE, INFORMATION})
public @interface WallpaperControlType {
}
- final int[] mFloatingSheetControlButtonTypes = { CUSTOMIZE, EFFECTS, INFORMATION };
+ final int[] mFloatingSheetControlButtonTypes = { CUSTOMIZE, EFFECTS, SHARE, INFORMATION };
ToggleButton mDeleteButton;
ToggleButton mEditButton;
ToggleButton mCustomizeButton;
ToggleButton mEffectsButton;
+ ToggleButton mShareButton;
ToggleButton mInformationButton;
/**
@@ -65,6 +67,7 @@
mEditButton = findViewById(R.id.edit_button);
mCustomizeButton = findViewById(R.id.customize_button);
mEffectsButton = findViewById(R.id.effects_button);
+ mShareButton = findViewById(R.id.share_button);
mInformationButton = findViewById(R.id.information_button);
}
@@ -90,6 +93,8 @@
return mCustomizeButton;
case EFFECTS:
return mEffectsButton;
+ case SHARE:
+ return mShareButton;
case INFORMATION:
return mInformationButton;
default:
@@ -123,6 +128,7 @@
mEditButton.setForeground(null);
mCustomizeButton.setForeground(null);
mEffectsButton.setForeground(null);
+ mShareButton.setForeground(null);
mInformationButton.setForeground(null);
mDeleteButton.setForeground(AppCompatResources.getDrawable(context,
R.drawable.wallpaper_control_button_delete));
@@ -132,6 +138,8 @@
R.drawable.wallpaper_control_button_customize));
mEffectsButton.setForeground(AppCompatResources.getDrawable(context,
R.drawable.wallpaper_control_button_effect));
+ mShareButton.setForeground(AppCompatResources.getDrawable(context,
+ R.drawable.wallpaper_control_button_share));
mInformationButton.setForeground(
AppCompatResources.getDrawable(context, R.drawable.wallpaper_control_button_info));
}