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

Commit 1fbc1247 authored by Adrian Roos's avatar Adrian Roos Committed by Android (Google) Code Review
Browse files

Merge "Hide panel while changing brightness" into lmp-dev

parents bd3409c1 5fd872e8
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2014 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
  -->
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="@color/system_primary_color" />
    <corners
        android:topLeftRadius="@dimen/notification_material_rounded_rect_radius"
        android:topRightRadius="@dimen/notification_material_rounded_rect_radius"
        android:bottomLeftRadius="@dimen/notification_material_rounded_rect_radius"
        android:bottomRightRadius="@dimen/notification_material_rounded_rect_radius"/>
</shape>
+1 −2
Original line number Diff line number Diff line
@@ -15,8 +15,7 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
    style="@style/BrightnessDialogContainer"
    android:clickable="true">
    style="@style/BrightnessDialogContainer">

    <ImageView
        android:id="@+id/brightness_icon"
+16 −0
Original line number Diff line number Diff line
@@ -26,6 +26,22 @@
    android:fitsSystemWindows="true"
    android:descendantFocusability="afterDescendants">

    <FrameLayout android:id="@+id/brightness_mirror"
            android:layout_width="@dimen/notification_panel_width"
            android:layout_height="wrap_content"
            android:layout_gravity="@integer/notification_panel_layout_gravity"
            android:paddingLeft="@dimen/notification_side_padding"
            android:paddingRight="@dimen/notification_side_padding"
            android:visibility="gone">
        <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:elevation="2dp"
                android:background="@drawable/brightness_mirror_background">
            <include layout="@layout/quick_settings_brightness_dialog" />
        </FrameLayout>
    </FrameLayout>

    <com.android.systemui.statusbar.AlphaOptimizedFrameLayout
            android:id="@+id/backdrop"
            android:layout_width="match_parent"
+9 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import com.android.systemui.qs.QSTile.DetailAdapter;
import com.android.systemui.settings.BrightnessController;
import com.android.systemui.settings.ToggleSlider;
import com.android.systemui.statusbar.phone.QSTileHost;
import com.android.systemui.statusbar.policy.BrightnessMirrorController;

import java.util.ArrayList;
import java.util.Collection;
@@ -105,6 +106,14 @@ public class QSPanel extends ViewGroup {
        });
    }

    public void setBrightnessMirror(BrightnessMirrorController c) {
        super.onFinishInflate();
        ToggleSlider brightnessSlider = (ToggleSlider) findViewById(R.id.brightness_slider);
        ToggleSlider mirror = (ToggleSlider) c.getMirror().findViewById(R.id.brightness_slider);
        brightnessSlider.setMirror(mirror);
        brightnessSlider.setMirrorController(c);
    }

    public void setCallback(Callback callback) {
        mCallback = callback;
    }
+1 −0
Original line number Diff line number Diff line
@@ -188,6 +188,7 @@ public class BrightnessController implements ToggleSlider.Listener {
        mListening = false;
    }

    @Override
    public void onChanged(ToggleSlider view, boolean tracking, boolean automatic, int value) {
        updateIcon(mAutomatic);
        if (!mAutomatic) {
Loading