Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 04f713a8 authored by Candice Lo's avatar Candice Lo Committed by Automerger Merge Worker
Browse files

Merge "Disabling the Done button when system applying new font size" into...

Merge "Disabling the Done button when system applying new font size" into udc-qpr-dev am: 85d3b4b6

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24002131



Change-Id: I314a4700d5e5a33001d68e49b4c6197ec1a18f10
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 25e04c20 85d3b4b6
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
<?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.
  -->
<selector xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
    <item android:state_enabled="false"
          android:color="?androidprv:attr/materialColorPrimary"
          android:alpha="0.30"/>
    <item android:color="?androidprv:attr/materialColorPrimary"/>
</selector>
 No newline at end of file
+23 −0
Original line number Diff line number Diff line
<?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.
  -->
<selector xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
    <item android:state_enabled="false"
          android:color="?androidprv:attr/materialColorOnPrimary"
          android:alpha="0.30"/>
    <item android:color="?androidprv:attr/materialColorOnPrimary"/>
</selector>
 No newline at end of file
+1 −2
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@
  ~ limitations under the License.
  -->
<inset xmlns:android="http://schemas.android.com/apk/res/android"
       xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
       android:insetTop="@dimen/dialog_button_vertical_inset"
       android:insetBottom="@dimen/dialog_button_vertical_inset">
    <ripple android:color="?android:attr/colorControlHighlight">
@@ -28,7 +27,7 @@
        <item>
            <shape android:shape="rectangle">
                <corners android:radius="?android:attr/buttonCornerRadius"/>
                <solid android:color="?androidprv:attr/materialColorPrimary"/>
                <solid android:color="@color/qs_dialog_btn_filled_background"/>
                <padding android:left="@dimen/dialog_button_horizontal_padding"
                         android:top="@dimen/dialog_button_vertical_padding"
                         android:right="@dimen/dialog_button_horizontal_padding"
+1 −1
Original line number Diff line number Diff line
@@ -1116,7 +1116,7 @@
    <style name="Widget.Dialog.Button">
        <item name="android:buttonCornerRadius">28dp</item>
        <item name="android:background">@drawable/qs_dialog_btn_filled</item>
        <item name="android:textColor">?androidprv:attr/materialColorOnPrimary</item>
        <item name="android:textColor">@color/qs_dialog_btn_filled_text_color</item>
        <item name="android:textSize">14sp</item>
        <item name="android:lineHeight">20sp</item>
        <item name="android:fontFamily">@*android:string/config_bodyFontFamilyMedium</item>
+12 −5
Original line number Diff line number Diff line
@@ -145,6 +145,8 @@ class FontScalingDialog(
     */
    @MainThread
    fun updateFontScaleDelayed(delayMsFromSource: Long) {
        doneButton.isEnabled = false

        var delayMs = delayMsFromSource
        if (systemClock.elapsedRealtime() - lastUpdateTime < MIN_UPDATE_INTERVAL_MS) {
            delayMs += MIN_UPDATE_INTERVAL_MS
@@ -197,17 +199,22 @@ class FontScalingDialog(
            title.post {
                title.setTextAppearance(R.style.TextAppearance_Dialog_Title)
                doneButton.setTextAppearance(R.style.Widget_Dialog_Button)
                doneButton.isEnabled = true
            }
        }
    }

    @WorkerThread
    fun updateFontScale() {
        systemSettings.putStringForUser(
        if (
            !systemSettings.putStringForUser(
                Settings.System.FONT_SCALE,
                strEntryValues[lastProgress.get()],
                userTracker.userId
            )
        ) {
            title.post { doneButton.isEnabled = true }
        }
    }

    @WorkerThread
Loading