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

Commit 4ffd6361 authored by Selim Cinek's avatar Selim Cinek
Browse files

Changed the transformation from when switching notification views

Change-Id: I2af3c2f36787d208be7745dabae96903df256156
parent b65c6dbb
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -305,4 +305,13 @@ public class NotificationHeaderView extends LinearLayout {
        }
        return this;
    }

    public ImageView getExpandButton() {
        return mExpandButton;
    }

    @Override
    public boolean hasOverlappingRendering() {
        return false;
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -50,6 +50,10 @@

    <!-- For notification icons for which targetSdk < L, this caches whether the icon is grayscale -->
    <item type="id" name="icon_is_grayscale" />
    <item type="id" name="clip_children_tag" />
    <item type="id" name="clip_children_set_tag" />
    <item type="id" name="clip_to_padding_tag" />
    <item type="id" name="image_icon_tag" />
    <item type="id" name="is_clicked_heads_up_tag" />
</resources>
+64 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 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.view.View;

import com.android.systemui.statusbar.phone.PhoneStatusBar;

/**
 * A helper to fade views in and out.
 */
public class CrossFadeHelper {
    public static final long ANIMATION_DURATION_LENGTH = 210;

    public static void fadeOut(final View view, final Runnable endRunnable) {
        view.animate().cancel();
        view.animate()
                .alpha(0f)
                .setDuration(ANIMATION_DURATION_LENGTH)
                .setInterpolator(PhoneStatusBar.ALPHA_OUT)
                .withEndAction(new Runnable() {
                    @Override
                    public void run() {
                        if (endRunnable != null) {
                            endRunnable.run();
                        }
                        view.setVisibility(View.INVISIBLE);
                    }
                });
        if (view.hasOverlappingRendering()) {
            view.animate().withLayer();
        }

    }

    public static void fadeIn(final View view) {
        view.animate().cancel();
        if (view.getVisibility() == View.INVISIBLE) {
            view.setAlpha(0.0f);
            view.setVisibility(View.VISIBLE);
        }
        view.animate()
                .alpha(1f)
                .setDuration(ANIMATION_DURATION_LENGTH)
                .setInterpolator(PhoneStatusBar.ALPHA_IN);
        if (view.hasOverlappingRendering()) {
            view.animate().withLayer();
        }
    }
}
+7 −1
Original line number Diff line number Diff line
@@ -635,6 +635,12 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
        mPrivateLayout.updateExpandButtons(isExpandable());
    }

    @Override
    public void setClipToActualHeight(boolean clipToActualHeight) {
        super.setClipToActualHeight(clipToActualHeight);
        getShowingLayout().setClipToActualHeight(clipToActualHeight);
    }

    /**
     * @return whether the user has changed the expansion state
     */
@@ -1040,7 +1046,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
            addView(mNotificationHeader, indexOfChild(mChildrenContainer) + 1);
        } else {
            header.reapply(getContext(), mNotificationHeader);
            mNotificationHeaderWrapper.notifyContentUpdated();
            mNotificationHeaderWrapper.notifyContentUpdated(mEntry.notification);
        }
        updateHeaderExpandButton();
        updateChildrenHeaderAppearance();
+15 −5
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ public abstract class ExpandableView extends FrameLayout {
    private static Rect mClipRect = new Rect();
    private boolean mWillBeGone;
    private int mMinClipTopAmount = 0;
    private boolean mClipToActualHeight = true;

    public ExpandableView(Context context, AttributeSet attrs) {
        super(context, attrs);
@@ -326,12 +327,21 @@ public abstract class ExpandableView extends FrameLayout {
    }

    private void updateClipping() {
        if (mClipToActualHeight) {
            int top = mClipTopOptimization;
            if (top >= getActualHeight()) {
                top = getActualHeight() - 1;
            }
            mClipRect.set(0, top, getWidth(), getActualHeight());
            setClipBounds(mClipRect);
        } else {
            setClipBounds(null);
        }
    }

    public void setClipToActualHeight(boolean clipToActualHeight) {
        mClipToActualHeight = clipToActualHeight;
        updateClipping();
    }

    public int getClipTopOptimization() {
Loading