ThemePickerLeaf: Import themed_icon_section_view from android-13.0.0_r63
Change-Id: I1ec20819065278ca6e162f28d5f79f3ab40ec7f7
diff --git a/Android.bp b/Android.bp
index b648693..cd949c3 100644
--- a/Android.bp
+++ b/Android.bp
@@ -21,6 +21,18 @@
],
}
+genrule {
+ name: "ThemePickerLeaf_res_overrides",
+ tools: ["soong_zip"],
+ srcs: [
+ "res_override/**/*",
+ ],
+ out: ["ThemePickerLeaf_res_overrides.zip"],
+ cmd: "INPUTS=($(in)) && "
+ + "RES_DIR=$$(dirname $$(dirname $${INPUTS[0]})) && "
+ + "$(location soong_zip) -o $(out) -C $$RES_DIR -D $$RES_DIR"
+}
+
android_library {
name: "ThemePickerLeaf-core",
defaults: ["ThemePicker_defaults"],
@@ -47,6 +59,7 @@
":WallpaperPicker2_res",
":ThemePicker_res",
":ThemePicker_res_overrides",
+ ":ThemePickerLeaf_res_overrides",
],
optimize: {
diff --git a/res_override/layout/themed_icon_section_view.xml b/res_override/layout/themed_icon_section_view.xml
new file mode 100644
index 0000000..95be207
--- /dev/null
+++ b/res_override/layout/themed_icon_section_view.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2021 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.
+-->
+<com.android.customization.picker.themedicon.ThemedIconSectionView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="?selectableItemBackground"
+ android:clickable="true"
+ android:orientation="vertical"
+ android:paddingHorizontal="@dimen/section_horizontal_padding"
+ android:paddingVertical="@dimen/section_vertical_padding">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center_vertical"
+ android:orientation="horizontal">
+
+ <TextView
+ android:id="@+id/themed_icon_title"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:paddingEnd="12dp"
+ android:text="@string/themed_icon_title"
+ style="@style/SectionTitleTextStyle" />
+
+ <Switch
+ android:id="@+id/themed_icon_toggle"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="@null"
+ android:clickable="false"
+ android:focusable="false"
+ android:minHeight="0dp"
+ style="@style/Switch.SettingsLib"/>
+
+ </LinearLayout>
+
+ <Space
+ android:layout_width="0dp"
+ android:layout_height="8dp" />
+
+ <TextView
+ android:id="@+id/beta_tag"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingHorizontal="8dp"
+ android:paddingVertical="4dp"
+ android:text="@string/beta_title"
+ android:textColor="@color/text_color_on_accent"
+ style="@style/BetaTagTextStyle" />
+
+</com.android.customization.picker.themedicon.ThemedIconSectionView>