LineageParts: Add color mode preview from AOSP Settings
Change-Id: Ie69134a7148053e93e3aba528eefd858ae660ccd
diff --git a/res/drawable-nodpi/color_mode_preview.jpg b/res/drawable-nodpi/color_mode_preview.jpg
new file mode 100644
index 0000000..804bcf1
--- /dev/null
+++ b/res/drawable-nodpi/color_mode_preview.jpg
Binary files differ
diff --git a/res/layout/color_mode_preview.xml b/res/layout/color_mode_preview.xml
new file mode 100644
index 0000000..88b8281
--- /dev/null
+++ b/res/layout/color_mode_preview.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2018 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"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <ImageView
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/color_mode_preview_height"
+ android:scaleType="centerCrop"
+ android:cropToPadding="true"
+ android:src="@drawable/color_mode_preview"
+ android:contentDescription="@null" />
+
+</FrameLayout>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 6820040..0f3ed33 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -64,5 +64,7 @@
<dimen name="trust_logo_width">-1px</dimen>
<dimen name="package_list_padding_top">16dp</dimen>
+
+ <dimen name="color_mode_preview_height">320dp</dimen>
</resources>
diff --git a/res/xml/livedisplay.xml b/res/xml/livedisplay.xml
index c993fe9..435f809 100644
--- a/res/xml/livedisplay.xml
+++ b/res/xml/livedisplay.xml
@@ -19,6 +19,11 @@
android:key="livedisplay"
android:title="@*lineageos.platform:string/live_display_title">
+ <!-- Color mode preview -->
+ <com.android.settingslib.widget.LayoutPreference
+ android:layout="@layout/color_mode_preview"
+ android:selectable="false" />
+
<!-- Color profile -->
<ListPreference
android:key="live_display_color_profile"