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

Commit 2050d39e authored by ztenghui's avatar ztenghui Committed by Android (Google) Code Review
Browse files

Merge "API Review: move the CreateRevealAnimator to ViewAnimationUtils" into lmp-preview-dev

parents cc15afbe 62f30e0b
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -31949,7 +31949,6 @@ package android.view {
    method protected int computeVerticalScrollRange();
    method public android.view.accessibility.AccessibilityNodeInfo createAccessibilityNodeInfo();
    method public void createContextMenu(android.view.ContextMenu);
    method public final android.animation.ValueAnimator createRevealAnimator(int, int, float, float);
    method public void destroyDrawingCache();
    method public android.view.WindowInsets dispatchApplyWindowInsets(android.view.WindowInsets);
    method public void dispatchConfigurationChanged(android.content.res.Configuration);
@@ -32597,6 +32596,10 @@ package android.view {
    method public abstract boolean onTouch(android.view.View, android.view.MotionEvent);
  }
  public class ViewAnimationUtils {
    method public static final android.animation.ValueAnimator createCircularReveal(android.view.View, int, int, float, float);
  }
  public class ViewConfiguration {
    ctor public deprecated ViewConfiguration();
    method public static android.view.ViewConfiguration get(android.content.Context);
+0 −18
Original line number Diff line number Diff line
@@ -10608,24 +10608,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        }
    }
    /**
     * Returns a ValueAnimator which can animate a clipping circle.
     * <p>
     * The View will be clipped to the animating circle.
     * <p>
     * Any shadow cast by the View will respect the circular clip from this animator.
     *
     * @param centerX The x coordinate of the center of the animating circle.
     * @param centerY The y coordinate of the center of the animating circle.
     * @param startRadius The starting radius of the animating circle.
     * @param endRadius The ending radius of the animating circle.
     */
    public final ValueAnimator createRevealAnimator(int centerX,  int centerY,
            float startRadius, float endRadius) {
        return RevealAnimator.ofRevealCircle(this, centerX, centerY,
                startRadius, endRadius, false);
    }
    /**
     * Returns a ValueAnimator which can animate a clearing circle.
     * <p>
+44 −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 android.view;

import android.animation.RevealAnimator;
import android.animation.ValueAnimator;

/**
 * Defines common utilities for working with View's animations.
 *
 */
public class ViewAnimationUtils {
    private ViewAnimationUtils() {}
    /**
     * Returns a ValueAnimator which can animate a clipping circle.
     *
     * Any shadow cast by the View will respect the circular clip from this animator.
     *
     * @param view The View will be clipped to the animating circle.
     * @param centerX The x coordinate of the center of the animating circle.
     * @param centerY The y coordinate of the center of the animating circle.
     * @param startRadius The starting radius of the animating circle.
     * @param endRadius The ending radius of the animating circle.
     */
    public static final ValueAnimator createCircularReveal(View view,
            int centerX,  int centerY, float startRadius, float endRadius) {
        return RevealAnimator.ofRevealCircle(view, centerX, centerY,
                startRadius, endRadius, false);
    }
}
+4 −1
Original line number Diff line number Diff line
@@ -33,11 +33,13 @@ import android.graphics.Shader;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewAnimationUtils;
import android.view.ViewConfiguration;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.view.animation.LinearInterpolator;
import android.view.animation.PathInterpolator;

import com.android.systemui.R;
import com.android.systemui.statusbar.stack.StackStateAnimator;

@@ -219,7 +221,8 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        int heightHalf = mBackgroundNormal.getActualHeight()/2;
        float radius = (float) Math.sqrt(widthHalf*widthHalf + heightHalf*heightHalf);
        ValueAnimator animator =
                mBackgroundNormal.createRevealAnimator(widthHalf, heightHalf, 0, radius);
                ViewAnimationUtils.createCircularReveal(mBackgroundNormal,
                        widthHalf, heightHalf, 0, radius);
        mBackgroundNormal.setVisibility(View.VISIBLE);
        Interpolator interpolator;
        Interpolator alphaInterpolator;
+3 −1
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewAnimationUtils;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.ViewPropertyAnimator;
@@ -757,7 +758,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                @Override
                public ValueAnimator createRevealAnimator(View v, int centerX, int centerY,
                        float startRadius, float endRadius) {
                    return v.createRevealAnimator(centerX, centerY, startRadius, endRadius);
                    return ViewAnimationUtils.createCircularReveal(v, centerX, centerY,
                            startRadius, endRadius);
                }
            });
            final QSTileHost qsh = new QSTileHost(mContext, this,