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

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

Refactored the notification animations, improved stack scroller

Animations are now only triggered when absolutely needed.
In addition, the notifications are now not clipped anymore when starting
a drag on them and the notification below the dragged one is fadded in if
necessary.

Change-Id: I80e8b3ea8fb48505edfb3cace6176dfa00c5a659
parent 59b5a356
Loading
Loading
Loading
Loading
+30 −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
  -->

<resources>
    <item type="id" name="translation_y_animator_tag"/>
    <item type="id" name="translation_z_animator_tag"/>
    <item type="id" name="alpha_animator_tag"/>
    <item type="id" name="top_inset_animator_tag"/>
    <item type="id" name="height_animator_tag"/>
    <item type="id" name="translation_y_animator_end_value_tag"/>
    <item type="id" name="translation_z_animator_end_value_tag"/>
    <item type="id" name="alpha_animator_end_value_tag"/>
    <item type="id" name="top_inset_animator_end_value_tag"/>
    <item type="id" name="height_animator_end_value_tag"/>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -322,6 +322,7 @@ public class SwipeHelper implements Gefingerpoken {
        anim.addListener(new AnimatorListenerAdapter() {
            public void onAnimationEnd(Animator animator) {
                updateAlphaFromOffset(animView, canAnimViewBeDismissed);
                mCallback.onChildSnappedBack(animView);
            }
        });
        anim.start();
@@ -407,5 +408,7 @@ public class SwipeHelper implements Gefingerpoken {
        void onChildDismissed(View v);

        void onDragCancelled(View v);

        void onChildSnappedBack(View animView);
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -217,6 +217,10 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView
    public void onDragCancelled(View v) {
    }

    @Override
    public void onChildSnappedBack(View animView) {
    }

    public View getChildAtPosition(MotionEvent ev) {
        final float x = ev.getX() + getScrollX();
        final float y = ev.getY() + getScrollY();
+4 −0
Original line number Diff line number Diff line
@@ -225,6 +225,10 @@ public class RecentsVerticalScrollView extends ScrollView
    public void onDragCancelled(View v) {
    }

    @Override
    public void onChildSnappedBack(View animView) {
    }

    public View getChildAtPosition(MotionEvent ev) {
        final float x = ev.getX() + getScrollX();
        final float y = ev.getY() + getScrollY();
+4 −5
Original line number Diff line number Diff line
@@ -17,11 +17,6 @@
package com.android.systemui.statusbar;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Outline;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.InsetDrawable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
@@ -98,6 +93,10 @@ public abstract class ExpandableView extends FrameLayout {
        mClipTopAmount = clipTopAmount;
    }

    public int getClipTopAmount() {
        return mClipTopAmount;
    }

    public void setOnHeightChangedListener(OnHeightChangedListener listener) {
        mOnHeightChangedListener = listener;
    }
Loading