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

Commit 7e2f0fec authored by Josh's avatar Josh
Browse files

Disabled Animations for Brightness Dialog

Brightness dialog enter animations now disabled when trigerring the
brightnessdialog with keyboard shortcut. BrightnessDialog Activity will
now be started with the FLAG_ACTIVITY_NO_ANIMATION flag to disable enter
animation  and exit animation is an instant fade out.

Test: Change brightness using keyboard shortcut -> ensure brightness
slider appears without animation -> wait for brightness slider to
disappear -> ensure brightness slider disappears without animation.
Fixes: 304970950
Flag: NA

Change-Id: I18307df735a87cd222780e83e9cc09df2c7a692d
parent a493dc5c
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2015 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.
-->

<alpha xmlns:android="http://schemas.android.com/apk/res/android"
    android:fromAlpha="1.0"
    android:toAlpha="0.0"
    android:interpolator="@android:interpolator/linear_out_slow_in"
    android:duration="0"/>
+5 −0
Original line number Diff line number Diff line
@@ -420,6 +420,11 @@
    <!-- Cannot double inherit. Use Theme.SystemUI.QuickSettings in code to match -->
    <style name="BrightnessDialog" parent="@android:style/Theme.DeviceDefault.Dialog">
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:windowAnimationStyle">@style/Animation.BrightnessDialog</item>
    </style>

    <style name="Animation.BrightnessDialog">
        <item name="android:windowExitAnimation">@anim/instant_fade_out</item>
    </style>

    <style name="Theme.SystemUI.ContrastDialog" parent="@android:style/Theme.DeviceDefault.Dialog">
+2 −1
Original line number Diff line number Diff line
@@ -3500,7 +3500,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    mDisplayManager.setBrightness(screenDisplayId, adjustedLinearBrightness);

                    Intent intent = new Intent(Intent.ACTION_SHOW_BRIGHTNESS_DIALOG);
                    intent.addFlags(Intent.FLAG_ACTIVITY_NO_USER_ACTION);
                    intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION
                            | Intent.FLAG_ACTIVITY_NO_USER_ACTION);
                    intent.putExtra(EXTRA_FROM_BRIGHTNESS_KEY, true);
                    startActivityAsUser(intent, UserHandle.CURRENT_OR_SELF);
                    logKeyboardSystemsEvent(event, KeyboardLogEvent.getBrightnessEvent(keyCode));