Cherish: notch-city: Add 3 mode display cutout handler [3/3]

[AgentFabulous - POSP]
- Add the respective control in here
- Also add a little video illustration I made to go along with it :)

Signed-off-by: Kshitij Gupta <kshitijgm@gmail.com>
Signed-off-by: Arghya Chanda <arghyac35@gmail.com>
Change-Id: I8fe68610a50e2a430363dc09f4a9adb8a4563ad0
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
Kshitij Gupta
2019-01-04 04:01:57 +05:30
committed by Hưng Phan
parent 0f1e289798
commit 7c352e5482
7 changed files with 182 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="30dp"
android:height="30dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?android:attr/colorAccent">
<path
android:fillColor="?android:attr/colorPrimary"
android:pathData="M17,1L7,1C5.9,1,5,1.9,5,3v18c0,1.1,0.9,2,2,2h10c1.1,0,2-0.9,2-2V3C19,1.9,18.1,1,17,1z M17,5v1.6h0V20c0,0.6-0.4,1-1,1H8 c-0.6,0-1-0.4-1-1V6.6V5l0-0.9c0-0.6,0.4-1,1-1h1.7v1.1c0,0.3,0.3,0.6,0.6,0.6h3.5c0.3,0,0.6-0.3,0.6-0.6V3.1H16c0.6,0,1,0.4,1,1 L17,5z" />
</vector>

View File

@@ -1242,4 +1242,16 @@
<item>0</item>
<item>1</item>
</string-array>
<string-array name="display_cutout_style_entries" translatable="false">
<item>@string/display_cutout_style_normal</item>
<item>@string/display_cutout_style_immerse</item>
<item>@string/display_cutout_style_hide</item>
</string-array>
<string-array name="display_cutout_style_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
</resources>

View File

@@ -1158,4 +1158,14 @@
<!-- Status Bar Lyric -->
<string name="status_bar_show_lyric_title">Status bar lyric</string>
<string name="status_bar_show_lyric_summary">Show lyric in status bar (need App support)</string>
<!-- Display cutout options -->
<string name="cutout_main">Display Cutout</string>
<string name="cutout_main_summary">They really cut corners with this one</string>
<string name="display_cutout_style_title">Cutout style</string>
<string name="display_cutout_style_normal">Normal</string>
<string name="display_cutout_style_immerse">Immerse</string>
<string name="display_cutout_style_hide">Hide</string>
<string name="stock_statusbar_in_hide">Stock statusbar height</string>
<string name="stock_statusbar_in_hide_summary">Use default statusbar height in Hide</string>
</resources>

View File

@@ -83,6 +83,12 @@
android:summary="@string/carrier_label_settings_summary"
android:fragment="com.cherish.settings.fragments.CustomCarrierLabel" />
<Preference
android:key="cutout_settings"
android:icon="@drawable/ic_cutout"
android:fragment="com.cherish.settings.fragments.CutoutFragment"
android:title="@string/cutout_main" />
<com.cherish.settings.preferences.SystemSettingListPreference
android:key="status_bar_show_ticker"
android:title="@string/ticker_screen_title"

37
res/xml/cutout.xml Normal file
View File

@@ -0,0 +1,37 @@
<?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.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/cutout_main"
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="cutout_settings">
<ListPreference
android:key="display_cutout_style"
android:title="@string/display_cutout_style_title"
android:persistent="false"
android:entries="@array/display_cutout_style_entries"
android:entryValues="@array/display_cutout_style_values" />
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="stock_statusbar_in_hide"
android:title="@string/stock_statusbar_in_hide"
android:summary="@string/stock_statusbar_in_hide_summary"
android:defaultValue="true" />
</PreferenceScreen>