Cherish: Implement cutout force full screen [2/2]

Inspired by MIUI and Essential

Squashed commits:

 commit e483acceb29cdd70bd649a732a03780dacf73a6c
 Author: LuK1337 <priv.luk@gmail.com>
 Date:   Sat Sep 29 01:02:32 2018 +0200

    LineageParts: Remove dividers from expanded desktop/long screen apps list

    Change-Id: I699f7c20d8313ad779165db336aed7bc72e68d28

 commit f9304f0cdc0e92dac787e6d414d36de51cdbed85
 Author: Tony Mantler <nicoya@google.com>
 Date:   Thu Sep 21 15:50:27 2017 -0700

    LineageParts: Make ApplicationsState.Session lifecycle-aware

    Bug: 66682989
    Test: RunSettingsRoboTests
    Change-Id: Idf56788fcae22639b7bf604a8c73cd5f0ff2da16

 commit 1b921f454a4d4c30317b72958251e83ff3792d81
 Author: LuK1337 <priv.luk@gmail.com>
 Date:   Mon Jun 4 16:01:00 2018 +0200

    LineageParts: Add an option to force pre-O apps to use full screen aspect ratio

    When an app target pre-O releases, the default max aspect ratio
    is 1.86:1 which leads to ugly black areas on devices that have
    screens with higher aspect ratio (for example Galaxy S8/S9).

    This change adds an option to allow users to change aspect ratio
    for pre-O apps to full screen aspect ratio.

    Change-Id: I20eeabf140c9d278d21d68675aed856d45b2f78a

Change-Id: I49f150df9d07f25794f4af4d43e560591fb9596d
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
jhenrique09
2020-10-03 20:05:46 +00:00
committed by Hưng Phan
parent 91127d47a7
commit 4537e0bb8c
6 changed files with 526 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 The LineageOS Project
Copyright (C) 2019 The PixelExperience 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.
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/cutout_force_fullscreen_prefs"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ListView
android:id="@+id/user_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@null" />
</RelativeLayout>

View File

@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 The LineageOS Project
Copyright (C) 2019 The PixelExperience 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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingTop="8dp"
android:paddingBottom="8dp">
<ImageView
android:id="@+id/app_icon"
android:layout_width="@android:dimen/app_icon_size"
android:layout_height="@android:dimen/app_icon_size"
android:layout_marginEnd="8dp"
android:scaleType="centerInside"
android:contentDescription="@null" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/app_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:textColor="?android:attr/textColorPrimary"
android:textAppearance="@style/TextAppearance.Medium"
android:singleLine="true"
android:ellipsize="marquee" />
</LinearLayout>
<Switch
android:id="@+id/state"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
</LinearLayout>

View File

@@ -700,5 +700,9 @@
<!-- Fingerprint Ripple Effect -->
<string name="enable_fingerprint_ripple_effect_title">Ripple effect</string>
<string name="enable_fingerprint_ripple_effect_summary">Show ripple effect on unlock with fingerprint</string>
<!-- Notch: Full screen apps -->
<string name="display_cutout_force_fullscreen_title">Full screen apps</string>
<string name="display_cutout_force_fullscreen_summary">Force apps to ignore notch space</string>
</resources>

View File

@@ -30,6 +30,16 @@
android:summary="@string/charging_animation_summary"
android:defaultValue="false" />
<!-- Display Cutout -->
<Preference
android:key="display_cutout_force_fullscreen_settings"
android:title="@string/display_cutout_force_fullscreen_title"
android:summary="@string/display_cutout_force_fullscreen_summary"
android:fragment="com.cherish.settings.fragments.DisplayCutoutForceFullscreenSettings"
settings:controller="com.cherish.settings.fragments.DisplayCutoutForceFullscreenPreferenceController"
app:allowDividerAbove="true" />
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="use_photos_spoof"
android:title="@string/use_photos_spoof_title"