private static boolean canViewReceivePointerEvents(View child) { return child.getVisibility() == VISIBLE || (child.getAnimation() != null); }
/** * 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; }
public void setAnimation(Animation animation){ if(mCurrentView == null){ Log.e("round","mcview == null" + mItems.size()); mCurrentView = (View) getChildAt(0); Log.e("round","mcview == " + (mCurrentView == null)); } if(mCurrentView != null){ Log.e("round","set"); mCurrentView.startAnimation(animation); isRotating = true; Log.e("round","set" +mCurrentView.getAnimation().hasStarted()); } }
public S hasAnimation(Animation animation) { isNotNull(); Animation actualAnimation = actual.getAnimation(); assertThat(actualAnimation) // .overridingErrorMessage("Expected animation <%s> but was <%s>", animation, actualAnimation) // .isSameAs(animation); return myself; }
@Test public void shouldSetAnimation() throws Exception { Animation anim = new TestAnimation(); view.setAnimation(anim); assertThat(view.getAnimation()).isSameAs(anim); }
private boolean isShowingAnimation(RecyclerView.ViewHolder holder) { return holder.itemView.getAnimation() != null && holder.itemView .getAnimation().hasStarted(); }
/** * 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; }
private void doAnimation(Animation animation, @Nullable final String animationType) { Animation oldAnimation = mPuppet.getAnimation(); if (oldAnimation != null) { if (oldAnimation.hasStarted() || (!oldAnimation.hasEnded())) { oldAnimation.cancel(); mPuppet.clearAnimation(); } } animation.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { Log.d(TAG, animationType + " start;"); } @Override public void onAnimationEnd(Animation animation) { Log.d(TAG, animationType + " end;"); } @Override public void onAnimationRepeat(Animation animation) { Log.d(TAG, animationType + " repeat;"); } }); mPuppet.startAnimation(animation); }
Animation animation = view.getAnimation(); if (isBusy && animation == null) { view.startAnimation(getAnimation());
private void launchRevealAnimation() { Animation animation = mPuppet.getAnimation(); if (animation != null) { animation.cancel();
lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { view.getAnimation().start(); //your custom logic } });
for (int i = 0; i < count; i++) { final View child = children[getChildDrawingOrder(count, i)]; if ((child.mViewFlags & VISIBILITY_MASK) == VISIBLE || child.getAnimation() != null) { more |= drawChild(canvas, child, drawingTime); } }
public void run() { view.setVisibility( View.VISIBLE); if(BusyIndicator.this.visible){ // view.setBackgroundDrawable(drawable); view.setBackground(drawable); if(view.getAnimation() == null){ view.startAnimation(animation); } } } });
public void run() { view.setVisibility(View.INVISIBLE); if(view.getAnimation() != null){ view.clearAnimation(); } } });
/** * Hides the view. */ public final void hideView() { if (animatedView.getAnimation() != null) { animatedView.getAnimation().cancel(); } ObjectAnimator animator = createAnimator(true); animator.start(); }
public static AnimatorProxy wrap(View view) { AnimatorProxy proxy = PROXIES.get(view); if (proxy == null || proxy != view.getAnimation()) { proxy = new AnimatorProxy(view); PROXIES.put(view, proxy); } return proxy; }
public static ApplozicAudioRecordAnimation wrap(View view) { ApplozicAudioRecordAnimation proxy = PROXIES.get(view); Animation animation = view.getAnimation(); if (proxy == null || proxy != animation && animation != null) { proxy = new ApplozicAudioRecordAnimation(view); PROXIES.put(view, proxy); } else if (animation == null) { view.setAnimation(proxy); } return proxy; }
for (final View coachmarkView : coachmarkViews) { Animation animation = coachmarkView.getAnimation(); if (animation != null) { animation.cancel(); coachmarkView.setAnimation(null); } coachmarkView.setVisibility(View.INVISIBLE); }
@Override public boolean tryCaptureView(@NonNull View view, int pointerId) { if (view.getAnimation() != null) { return false; } boolean ret = mDragHelper.isEdgeTouched(ViewDragHelper.EDGE_LEFT, pointerId); boolean directionCheck = !mDragHelper.checkTouchSlop(ViewDragHelper.DIRECTION_VERTICAL, pointerId); return mDragHelper.getViewDragState() != ViewDragHelper.STATE_SETTLING && (ret & directionCheck); }
public S hasAnimation(Animation animation) { isNotNull(); Animation actualAnimation = actual.getAnimation(); assertThat(actualAnimation) // .overridingErrorMessage("Expected animation <%s> but was <%s>", animation, actualAnimation) // .isSameAs(animation); return myself; }