ztenghui | 62f30e0 | 2014-06-05 09:55:04 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.view; |
| 18 | |
| 19 | import android.animation.RevealAnimator; |
| 20 | import android.animation.ValueAnimator; |
| 21 | |
| 22 | /** |
| 23 | * Defines common utilities for working with View's animations. |
| 24 | * |
| 25 | */ |
ztenghui | 1c2ebed | 2014-06-12 13:35:38 -0700 | [diff] [blame] | 26 | public final class ViewAnimationUtils { |
ztenghui | 62f30e0 | 2014-06-05 09:55:04 -0700 | [diff] [blame] | 27 | private ViewAnimationUtils() {} |
| 28 | /** |
| 29 | * Returns a ValueAnimator which can animate a clipping circle. |
| 30 | * |
| 31 | * Any shadow cast by the View will respect the circular clip from this animator. |
| 32 | * |
| 33 | * @param view The View will be clipped to the animating circle. |
| 34 | * @param centerX The x coordinate of the center of the animating circle. |
| 35 | * @param centerY The y coordinate of the center of the animating circle. |
| 36 | * @param startRadius The starting radius of the animating circle. |
| 37 | * @param endRadius The ending radius of the animating circle. |
| 38 | */ |
| 39 | public static final ValueAnimator createCircularReveal(View view, |
| 40 | int centerX, int centerY, float startRadius, float endRadius) { |
John Reck | d3de42c | 2014-07-15 14:29:33 -0700 | [diff] [blame^] | 41 | return new RevealAnimator(view, centerX, centerY, startRadius, endRadius, false); |
ztenghui | 62f30e0 | 2014-06-05 09:55:04 -0700 | [diff] [blame] | 42 | } |
| 43 | } |