@Override public void handleLeftPage(View view, float position) { ViewCompat.setTranslationX(view, -view.getWidth() * position); float rotation = (ROTATION * position); ViewCompat.setRotationY(view, rotation); if (position > -0.5) { view.setVisibility(View.VISIBLE); } else { view.setVisibility(View.INVISIBLE); } }
@Override public void handleRightPage(View view, float position) { ViewCompat.setTranslationX(view, -view.getWidth() * position); float rotation = (ROTATION * position); ViewCompat.setRotationY(view, rotation); if (position < 0.5) { view.setVisibility(View.VISIBLE); } else { view.setVisibility(View.INVISIBLE); } }
@Override public void handleLeftPage(View view, float position) { ViewCompat.setPivotX(view, view.getMeasuredWidth()); ViewCompat.setPivotY(view, view.getMeasuredHeight() * 0.5f); ViewCompat.setRotationY(view, mMaxRotation * position); }
@Override public void handleInvisiblePage(View view, float position) { ViewCompat.setPivotX(view, view.getMeasuredWidth()); ViewCompat.setPivotY(view, view.getMeasuredHeight() * 0.5f); ViewCompat.setRotationY(view, 0); }
@Override public void handleRightPage(View view, float position) { ViewCompat.setPivotX(view, 0); ViewCompat.setPivotY(view, view.getMeasuredHeight() * 0.5f); ViewCompat.setRotationY(view, mMaxRotation * position); }
public static void resetPageTransformer(List<? extends View> views) { if (views == null) { return; } for (View view : views) { view.setVisibility(View.VISIBLE); ViewCompat.setAlpha(view, 1); ViewCompat.setPivotX(view, view.getMeasuredWidth() * 0.5f); ViewCompat.setPivotY(view, view.getMeasuredHeight() * 0.5f); ViewCompat.setTranslationX(view, 0); ViewCompat.setTranslationY(view, 0); ViewCompat.setScaleX(view, 1); ViewCompat.setScaleY(view, 1); ViewCompat.setRotationX(view, 0); ViewCompat.setRotationY(view, 0); ViewCompat.setRotation(view, 0); } }
@Override protected boolean drawChild(Canvas canvas, View child, long drawingTime) { boolean result; final LayoutParams lp = (LayoutParams) child.getLayoutParams(); final int save = canvas.save(Canvas.ALL_SAVE_FLAG); if (mCanSlide && !lp.slideable && mSlideableView != null) { canvas.scale(1.5f - 0.5f * mSlideOffset, 1.5f - 0.5f * mSlideOffset, child.getRight(), getHeight() / 2); } else { canvas.scale(1 - mSlideOffset / 5, 1 - mSlideOffset / 5, mSlideableView.getLeft(), getHeight() / 2); ViewCompat.setRotationY(child, -10 * mSlideOffset); } result = super.drawChild(canvas, child, drawingTime); canvas.restoreToCount(save); return result; }
@Override protected boolean drawChild(Canvas canvas, View child, long drawingTime) { boolean result; final LayoutParams lp = (LayoutParams) child.getLayoutParams(); final int save = canvas.save(Canvas.ALL_SAVE_FLAG); if (mCanSlide && !lp.slideable && mSlideableView != null) { canvas.scale(1.5f - 0.5f * mSlideOffset, 1.5f - 0.5f * mSlideOffset, child.getRight(), getHeight() / 2); } else { canvas.scale(1 - mSlideOffset / 5, 1 - mSlideOffset / 5, mSlideableView.getLeft(), getHeight() / 2); ViewCompat.setRotationY(child, -10 * mSlideOffset); } result = super.drawChild(canvas, child, drawingTime); canvas.restoreToCount(save); return result; }
private void tilt(View v, float rot) { float degree = rot * (last - first); if (degree > 90) degree = 90; if (degree < -90) degree = -90; ViewCompat.setRotationY(v, degree); } }
@Override protected void preAnimateAddImpl(RecyclerView.ViewHolder holder) { ViewCompat.setRotationY(holder.itemView, 90); }
@Override protected void preAnimateAddImpl(RecyclerView.ViewHolder holder) { ViewCompat.setRotationY(holder.itemView, 90); }
@Override protected void preAnimateAddImpl(RecyclerView.ViewHolder holder) { ViewCompat.setRotationY(holder.itemView, -90); }
@Override protected void preAnimateAddImpl(RecyclerView.ViewHolder holder) { ViewCompat.setRotationY(holder.itemView, 90); }
void updateSlideOffset(CardView child, Setting setting, float width, float slideOffset, boolean isLeftDrawer) { if (setting.degree > 0) { float percentage = (setting.degree) / 90f; ViewCompat.setX(child, width * slideOffset - (child.getWidth()/2) * percentage * slideOffset); ViewCompat.setRotationY(child, (isLeftDrawer ? -1 : 1) * setting.degree * slideOffset); } else super.updateSlideOffset(child, setting, width, slideOffset, isLeftDrawer); }
public static void clear(View v) { ViewCompat.setAlpha(v, 1); ViewCompat.setScaleY(v, 1); ViewCompat.setScaleX(v, 1); ViewCompat.setTranslationY(v, 0); ViewCompat.setTranslationX(v, 0); ViewCompat.setRotation(v, 0); ViewCompat.setRotationY(v, 0); ViewCompat.setRotationX(v, 0); ViewCompat.setPivotY(v, v.getMeasuredHeight() / 2); ViewCompat.setPivotX(v, v.getMeasuredWidth() / 2); ViewCompat.animate(v).setInterpolator(null); } }
public static void clear(View v) { ViewCompat.setAlpha(v, 1); ViewCompat.setScaleY(v, 1); ViewCompat.setScaleX(v, 1); ViewCompat.setTranslationY(v, 0); ViewCompat.setTranslationX(v, 0); ViewCompat.setRotation(v, 0); ViewCompat.setRotationY(v, 0); ViewCompat.setRotationX(v, 0); ViewCompat.setPivotY(v, v.getMeasuredHeight() / 2); ViewCompat.setPivotX(v, v.getMeasuredWidth() / 2); ViewCompat.animate(v).setInterpolator(null); } }
public static void clear(View v) { ViewCompat.setAlpha(v, 1); ViewCompat.setScaleY(v, 1); ViewCompat.setScaleX(v, 1); ViewCompat.setTranslationY(v, 0); ViewCompat.setTranslationX(v, 0); ViewCompat.setRotation(v, 0); ViewCompat.setRotationY(v, 0); ViewCompat.setRotationX(v, 0); v.setPivotY(v.getMeasuredHeight() / 2); ViewCompat.setPivotX(v, v.getMeasuredWidth() / 2); ViewCompat.animate(v).setInterpolator(null); } }
public static void clear(View v) { ViewCompat.setAlpha(v, 1); ViewCompat.setScaleY(v, 1); ViewCompat.setScaleX(v, 1); ViewCompat.setTranslationY(v, 0); ViewCompat.setTranslationX(v, 0); ViewCompat.setRotation(v, 0); ViewCompat.setRotationY(v, 0); ViewCompat.setRotationX(v, 0); ViewCompat.setPivotY(v, v.getMeasuredHeight() / 2); ViewCompat.setPivotX(v, v.getMeasuredWidth() / 2); ViewCompat.animate(v).setInterpolator(null).setStartDelay(0); } }
public static void clear(View v) { ViewCompat.setAlpha(v, 1); ViewCompat.setScaleY(v, 1); ViewCompat.setScaleX(v, 1); ViewCompat.setTranslationY(v, 0); ViewCompat.setTranslationX(v, 0); ViewCompat.setRotation(v, 0); ViewCompat.setRotationY(v, 0); ViewCompat.setRotationX(v, 0); ViewCompat.setPivotY(v, v.getMeasuredHeight() / 2); ViewCompat.setPivotX(v, v.getMeasuredWidth() / 2); ViewCompat.animate(v).setInterpolator(null).setStartDelay(0); } }
public static void clear(View v) { ViewCompat.setAlpha(v, 1); ViewCompat.setScaleY(v, 1); ViewCompat.setScaleX(v, 1); ViewCompat.setTranslationY(v, 0); ViewCompat.setTranslationX(v, 0); ViewCompat.setRotation(v, 0); ViewCompat.setRotationY(v, 0); ViewCompat.setRotationX(v, 0); ViewCompat.setPivotY(v, v.getMeasuredHeight() / 2); ViewCompat.setPivotX(v, v.getMeasuredWidth() / 2); ViewCompat.animate(v).setInterpolator(null).setStartDelay(0); } }