本文整理汇总了Java中android.view.View.getAnimation方法的典型用法代码示例。如果您正苦于以下问题:Java View.getAnimation方法的具体用法?Java View.getAnimation怎么用?Java View.getAnimation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.View
的用法示例。
在下文中一共展示了View.getAnimation方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: wrap
import android.view.View; //导入方法依赖的package包/类
/**
* Create a proxy to allow for modifying post-3.0 view properties on all
* pre-3.0 platforms. <strong>DO NOT</strong> wrap your views if you are
* using {@code ObjectAnimator} as it will handle that itself.
*
* @param view View to wrap.
* @return Proxy to post-3.0 properties.
*/
public static AnimatorProxy wrap(View view) {
AnimatorProxy proxy = PROXIES.get(view);
// This checks if the proxy already exists and whether it still is the animation of the given view
if (proxy == null || proxy != view.getAnimation()) {
proxy = new AnimatorProxy(view);
PROXIES.put(view, proxy);
}
return proxy;
}
示例2: wrap
import android.view.View; //导入方法依赖的package包/类
public static View10 wrap(View view) {
View10 proxy = PROXIES.get(view);
Animation animation = view.getAnimation();
if (proxy == null || proxy != animation && animation != null) {
proxy = new View10(view);
PROXIES.put(view, proxy);
} else if (animation == null) {
view.setAnimation(proxy);
}
return proxy;
}
示例3: animTop
import android.view.View; //导入方法依赖的package包/类
public static void animTop(Context context, final View view) {
if (view == null) {
return;
}
if (view.getAnimation() == null || view.getAnimation().hasEnded()) {
view.post(new Runnable() {
public void run() {
UIs.animCollection(view, UIs.collectionAniScaleRec, 0);
}
});
}
}
示例4: startBeatsAnimation
import android.view.View; //导入方法依赖的package包/类
@UiThread public static void startBeatsAnimation(@NonNull View view) {
view.clearAnimation();
if (view.getAnimation() != null) {
view.getAnimation().cancel();
}
List<ObjectAnimator> animators = getBeats(view);
for (ObjectAnimator anim : animators) {
anim.setDuration(300).start();
anim.setInterpolator(interpolator);
}
}
示例5: wrap
import android.view.View; //导入方法依赖的package包/类
public static AnimatorProxy wrap(View view) {
Animation proxy = (AnimatorProxy) PROXIES.get(view);
if (proxy != null && proxy == view.getAnimation()) {
return proxy;
}
AnimatorProxy proxy2 = new AnimatorProxy(view);
PROXIES.put(view, proxy2);
return proxy2;
}
示例6: clearTarget
import android.view.View; //导入方法依赖的package包/类
private void clearTarget() {
View view = getTarget();
int size = this.mTuples.size();
for (int i = 0; i < size; i++) {
if (view.getAnimation() == ((Tuple) this.mTuples.get(i)).mAnimation) {
view.clearAnimation();
}
}
this.mViewRef = null;
this.mLastMatch = null;
this.mRunningAnimation = null;
}
示例7: cancel
import android.view.View; //导入方法依赖的package包/类
private void cancel() {
if (this.mRunningAnimation != null) {
View view = getTarget();
if (view != null && view.getAnimation() == this.mRunningAnimation) {
view.clearAnimation();
}
this.mRunningAnimation = null;
}
}
示例8: jumpToCurrentState
import android.view.View; //导入方法依赖的package包/类
public void jumpToCurrentState() {
if (this.mRunningAnimation != null) {
View view = getTarget();
if (view != null && view.getAnimation() == this.mRunningAnimation) {
view.clearAnimation();
}
}
}
示例9: updateSubviewClipStatus
import android.view.View; //导入方法依赖的package包/类
private void updateSubviewClipStatus(Rect clippingRect, int idx, int clippedSoFar) {
View child = Assertions.assertNotNull(mAllChildren)[idx];
sHelperRect.set(child.getLeft(), child.getTop(), child.getRight(), child.getBottom());
boolean intersects = clippingRect
.intersects(sHelperRect.left, sHelperRect.top, sHelperRect.right, sHelperRect.bottom);
boolean needUpdateClippingRecursive = false;
// We never want to clip children that are being animated, as this can easily break layout :
// when layout animation changes size and/or position of views contained inside a listview that
// clips offscreen children, we need to ensure that, when view exits the viewport, final size
// and position is set prior to removing the view from its listview parent.
// Otherwise, when view gets re-attached again, i.e when it re-enters the viewport after scroll,
// it won't be size and located properly.
Animation animation = child.getAnimation();
boolean isAnimating = animation != null && !animation.hasEnded();
if (!intersects && child.getParent() != null && !isAnimating) {
// We can try saving on invalidate call here as the view that we remove is out of visible area
// therefore invalidation is not necessary.
super.removeViewsInLayout(idx - clippedSoFar, 1);
needUpdateClippingRecursive = true;
} else if (intersects && child.getParent() == null) {
super.addViewInLayout(child, idx - clippedSoFar, sDefaultLayoutParam, true);
invalidate();
needUpdateClippingRecursive = true;
} else if (intersects) {
// If there is any intersection we need to inform the child to update its clipping rect
needUpdateClippingRecursive = true;
}
if (needUpdateClippingRecursive) {
if (child instanceof ReactClippingViewGroup) {
// we don't use {@link sHelperRect} until the end of this loop, therefore it's safe
// to call this method that may write to the same {@link sHelperRect} object.
ReactClippingViewGroup clippingChild = (ReactClippingViewGroup) child;
if (clippingChild.getRemoveClippedSubviews()) {
clippingChild.updateClippingRect();
}
}
}
}
示例10: canViewReceivePointerEvents
import android.view.View; //导入方法依赖的package包/类
private static boolean canViewReceivePointerEvents(View child) {
return child.getVisibility() == VISIBLE || (child.getAnimation() != null);
}
示例11: morph
import android.view.View; //导入方法依赖的package包/类
/**
* Applied height variation
* Check the following call conditions
* 1. Call it after type conversion only if the change in the shape of the view is obvious.
* 2. It should be the parent's existing View.
* 3. Recommended for code corresponding to user action.
* 4. Do not change the shape of the target view's animation in external code. However, it is possible to call the morph () method continuously.
*
* @param targetView target view
* @param mode
* input static define value {@link MorphAnimation#ANIMATION_MODE_WIDTH},
* {@link MorphAnimation#ANIMATION_MODE_HEIGHT}.
* @param duration
* Animation duration
*/
public static MorphAnimation morph(final View targetView, int mode, int duration) {
if (targetView != null && targetView.getParent() != null) {
if (targetView.getAnimation() != null)
targetView.getAnimation().cancel();
if (mMorphMap.containsKey(targetView)) {
MorphAnimation morphAnimation = mMorphMap.get(targetView);
morphAnimation.mAnimationStep = ANIMATION_STEP_STOP;
morphAnimation.mTargetView.getViewTreeObserver().removeOnPreDrawListener(morphAnimation);
mMorphMap.remove(targetView);
}
final MorphAnimation morphView = new MorphAnimation(targetView);
mMorphMap.put(targetView, morphView);
morphView.mTargetView = targetView;
morphView.mOriginalVisibility = morphView.mTargetView.getVisibility();
morphView.mTargetView.setVisibility(View.VISIBLE);
morphView.mAnimationMode = mode;
if (duration > 0) {
morphView.mAnimationDuration = duration;
}
LayoutParams params = morphView.mTargetView.getLayoutParams();
morphView.mOriginalLayoutWidth = params.width;
morphView.mOriginalLayoutHeight = params.height;
morphView.mWidth = morphView.mEndWidth = morphView.mTargetView.getMeasuredWidth();
morphView.mHeight = morphView.mEndHeight = morphView.mTargetView.getMeasuredHeight();
morphView.mTargetView.getViewTreeObserver().addOnPreDrawListener(morphView);
return morphView;
} else {
return null;
}
}
示例12: animating
import android.view.View; //导入方法依赖的package包/类
/**
* Returns true if a view is currently animating.
*/
private static boolean animating(View view) {
Animation animation = view.getAnimation();
return animation != null && !animation.hasEnded();
}