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

Commit f54090e9 authored by Selim Cinek's avatar Selim Cinek
Browse files

Scrimming the notifications when QS is open.

Bug: 15394230
Change-Id: I4234bde0259ef296db73a43f69a765dbde5ddacd
parent ca481601
Loading
Loading
Loading
Loading
+22 −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="#34000000" />
    <corners android:radius="@*android:dimen/notification_material_rounded_rect_radius" />
</shape>
 No newline at end of file
+6 −0
Original line number Diff line number Diff line
@@ -49,4 +49,10 @@
        android:layout_width="120dp"
        android:layout_height="wrap_content"
        />

    <com.android.systemui.statusbar.NotificationScrimView
        android:id="@+id/scrim_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</com.android.systemui.statusbar.NotificationOverflowContainer>
+5 −0
Original line number Diff line number Diff line
@@ -48,4 +48,9 @@
        android:padding="2dp"
        />

    <com.android.systemui.statusbar.NotificationScrimView
        android:id="@+id/scrim_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</com.android.systemui.statusbar.ExpandableNotificationRow>
+3 −0
Original line number Diff line number Diff line
@@ -320,6 +320,9 @@
         device. -->
    <dimen name="unlock_move_distance">75dp</dimen>

    <!-- Distance after which the scrim starts fading in when dragging down the quick settings -->
    <dimen name="notification_scrim_wait_distance">100dp</dimen>

    <!-- Move distance for the unlock hint animation on the lockscreen -->
    <dimen name="hint_move_distance">75dp</dimen>

+9 −0
Original line number Diff line number Diff line
@@ -119,6 +119,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView

    private NotificationBackgroundView mBackgroundNormal;
    private NotificationBackgroundView mBackgroundDimmed;
    private NotificationScrimView mScrimView;
    private ObjectAnimator mBackgroundAnimator;
    private RectF mAppearAnimationRect = new RectF();
    private PorterDuffColorFilter mAppearAnimationFilter;
@@ -153,6 +154,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        mBackgroundDimmed = (NotificationBackgroundView) findViewById(R.id.backgroundDimmed);
        updateBackground();
        updateBackgroundResources();
        mScrimView = (NotificationScrimView) findViewById(R.id.scrim_view);
    }

    private final Runnable mTapTimeoutRunnable = new Runnable() {
@@ -379,6 +381,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        setPivotY(actualHeight / 2);
        mBackgroundNormal.setActualHeight(actualHeight);
        mBackgroundDimmed.setActualHeight(actualHeight);
        mScrimView.setActualHeight(actualHeight);
    }

    @Override
@@ -386,6 +389,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        super.setClipTopAmount(clipTopAmount);
        mBackgroundNormal.setClipTopAmount(clipTopAmount);
        mBackgroundDimmed.setClipTopAmount(clipTopAmount);
        mScrimView.setClipTopAmount(clipTopAmount);
    }

    @Override
@@ -405,6 +409,11 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        }
    }

    @Override
    public void setScrimAmount(float scrimAmount) {
        mScrimView.setAlpha(scrimAmount);
    }

    private void startAppearAnimation(boolean isAppearing,
            float translationDirection, long delay, final Runnable onFinishedRunnable) {
        if (mAppearAnimator != null) {
Loading