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

Commit 2580a976 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Improve motion when expanding/collapsing status bar.

- Don't fade the whole panel anymore.
- Parallax effect for QS header translation, fade on keyguard.
- Improve fling curve for dismissing the panel.
- Improve peeking behavior.

Bug: 14804452
Bug: 15407838
Change-Id: I34b7bcd457cb8a037e0bb06e9802ec66d2b39b73
parent 605f1902
Loading
Loading
Loading
Loading
+22 −14
Original line number Diff line number Diff line
@@ -48,13 +48,20 @@
        android:orientation="horizontal"
        >

        <LinearLayout
        <com.android.systemui.statusbar.AlphaOptimizedLinearLayout
            android:id="@+id/notification_icon_area"
            android:layout_width="0dip"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:orientation="horizontal"
            >
            <!-- The alpha of this area is both controlled from PhoneStatusBarTransitions and
                 PhoneStatusBar (DISABLE_NOTIFICATION_ICONS), so we need two views here. -->
            <com.android.systemui.statusbar.AlphaOptimizedFrameLayout
                android:id="@+id/notification_icon_area_inner"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                >
                <com.android.systemui.statusbar.StatusBarIconView android:id="@+id/moreIcon"
                    android:layout_width="@dimen/status_bar_icon_size"
                    android:layout_height="match_parent"
@@ -67,9 +74,10 @@
                    android:layout_alignParentStart="true"
                    android:gravity="center_vertical"
                    android:orientation="horizontal"/>
        </LinearLayout>
            </com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
        </com.android.systemui.statusbar.AlphaOptimizedLinearLayout>

        <LinearLayout android:id="@+id/system_icon_area"
        <com.android.systemui.statusbar.AlphaOptimizedLinearLayout android:id="@+id/system_icon_area"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:orientation="horizontal"
@@ -109,7 +117,7 @@
                android:paddingStart="6dip"
                android:gravity="center_vertical|start"
                />
        </LinearLayout>
        </com.android.systemui.statusbar.AlphaOptimizedLinearLayout>
    </LinearLayout>

    <ViewStub
+6 −6
Original line number Diff line number Diff line
@@ -56,6 +56,12 @@
        android:clipToPadding="false"
        android:clipChildren="false">

        <com.android.systemui.statusbar.stack.NotificationStackScrollLayout
            android:id="@+id/notification_stack_scroller"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginBottom="@dimen/close_handle_underlap"/>

        <com.android.systemui.statusbar.phone.ObservableScrollView
            android:id="@+id/scroll_view"
            android:layout_width="match_parent"
@@ -82,12 +88,6 @@
            </LinearLayout>
        </com.android.systemui.statusbar.phone.ObservableScrollView>

        <com.android.systemui.statusbar.stack.NotificationStackScrollLayout
            android:id="@+id/notification_stack_scroller"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginBottom="@dimen/close_handle_underlap"/>

    </com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer>

    <include layout="@layout/status_bar_expanded_header" />
+0 −4
Original line number Diff line number Diff line
@@ -155,10 +155,6 @@
    <!-- The size of the gesture span needed to activate the "pull" notification expansion -->
    <dimen name="pull_span_min">25dp</dimen>

    <!-- How far to slide the panel out when you touch it -->
    <!-- For phones, this is close_handle_height + header_height -->
    <dimen name="peek_height">84dp</dimen>

    <dimen name="qs_tile_height">88dp</dimen>
    <dimen name="qs_tile_icon_size">28dp</dimen>
    <dimen name="qs_tile_text_size">12sp</dimen>
+51 −0
Original line number Diff line number Diff line
/*
 * 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
 */

package com.android.systemui.statusbar;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import android.widget.LinearLayout;

/**
 * A frame layout which does not have overlapping renderings commands and therefore does not need a
 * layer when alpha is changed.
 */
public class AlphaOptimizedFrameLayout extends FrameLayout
{
    public AlphaOptimizedFrameLayout(Context context) {
        super(context);
    }

    public AlphaOptimizedFrameLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public AlphaOptimizedFrameLayout(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public AlphaOptimizedFrameLayout(Context context, AttributeSet attrs, int defStyleAttr,
            int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    @Override
    public boolean hasOverlappingRendering() {
        return false;
    }
}
+51 −0
Original line number Diff line number Diff line
/*
 * 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
 */

package com.android.systemui.statusbar;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;

/**
 * A linear layout which does not have overlapping renderings commands and therefore does not need a
 * layer when alpha is changed.
 */
public class AlphaOptimizedLinearLayout extends LinearLayout
{
    public AlphaOptimizedLinearLayout(Context context) {
        super(context);
    }

    public AlphaOptimizedLinearLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public AlphaOptimizedLinearLayout(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public AlphaOptimizedLinearLayout(Context context, AttributeSet attrs, int defStyleAttr,
            int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    @Override
    public boolean hasOverlappingRendering() {
        return false;
    }
}
Loading