Java Code Examples for android.support.v4.view.ViewCompat#setRotationY()
The following examples show how to use
android.support.v4.view.ViewCompat#setRotationY() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaseItemAnimator.java From MultiView with Apache License 2.0 | 6 votes |
protected void resetView(View view) { Log.v("resetView: " + view); ViewCompat.setAlpha(view, 1); ViewCompat.setTranslationX(view, 0); ViewCompat.setTranslationY(view, 0); ViewCompat.setTranslationZ(view, 0); ViewCompat.setRotation(view, 0); ViewCompat.setRotationX(view, 0); ViewCompat.setRotationY(view, 0); ViewCompat.setScaleX(view, 1); ViewCompat.setScaleY(view, 1); ViewCompat.setPivotY(view, view.getMeasuredHeight() / 2); ViewCompat.setPivotX(view, view.getMeasuredWidth() / 2); ViewCompat.animate(view).setInterpolator(null); //do we need it at all ? // view.invalidate(); }
Example 2
Source File: BaseViewAnimator.java From KUtils with Apache License 2.0 | 5 votes |
/** * reset the view to default status * * @param target */ public void reset(View target) { ViewCompat.setAlpha(target, 1); ViewCompat.setScaleX(target, 1); ViewCompat.setScaleY(target, 1); ViewCompat.setTranslationX(target, 0); ViewCompat.setTranslationY(target, 0); ViewCompat.setRotation(target, 0); ViewCompat.setRotationY(target, 0); ViewCompat.setRotationX(target, 0); }
Example 3
Source File: ViewHelper.java From Nimingban with Apache License 2.0 | 5 votes |
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); // @TODO https://code.google.com/p/android/issues/detail?id=80863 // ViewCompat.setPivotY(v, v.getMeasuredHeight() / 2); v.setPivotY(v.getMeasuredHeight() / 2); ViewCompat.setPivotX(v, v.getMeasuredWidth() / 2); ViewCompat.animate(v).setInterpolator(null); }
Example 4
Source File: FlipPageTransformer.java From KUtils-master with Apache License 2.0 | 5 votes |
@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); } }
Example 5
Source File: FlipHorizontalTransformer.java From LoyalNativeSlider with MIT License | 5 votes |
@Override protected void onTransform(View view, float position) { final float rotation = 180f * position; ViewCompat.setAlpha(view, rotation > 90f || rotation < -90f ? 0 : 1); ViewCompat.setPivotY(view,view.getHeight()*0.5f); ViewCompat.setPivotX(view,view.getWidth() * 0.5f); ViewCompat.setRotationY(view,rotation); }
Example 6
Source File: FlipPageTransformer.java From KUtils with Apache License 2.0 | 5 votes |
@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); } }
Example 7
Source File: FlipPageTransformer.java From KUtils with Apache License 2.0 | 5 votes |
@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); } }
Example 8
Source File: ViewHelper.java From RecyclerviewAnimators with Apache License 2.0 | 5 votes |
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); // @TODO https://code.google.com/p/android/issues/detail?id=80863 ViewCompat.setPivotY(v, v.getMeasuredHeight() / 2); // v.setPivotY(v.getMeasuredHeight() / 2); ViewCompat.setPivotX(v, v.getMeasuredWidth() / 2); ViewCompat.animate(v).setInterpolator(null); }
Example 9
Source File: TabletTransformer.java From LoyalNativeSlider with MIT License | 5 votes |
@Override protected void onTransform(View view, float position) { final float rotation = (position < 0 ? 30f : -30f) * Math.abs(position); ViewCompat.setTranslationX(view,getOffsetXForRotation(rotation, view.getWidth(), view.getHeight())); ViewCompat.setPivotX(view, view.getWidth() * 0.5f); ViewCompat.setPivotY(view,0); ViewCompat.setRotationY(view,rotation); }
Example 10
Source File: FlipPageTransformer.java From JD-Test with Apache License 2.0 | 5 votes |
@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); } }
Example 11
Source File: FlipPageTransformer.java From JD-Test with Apache License 2.0 | 5 votes |
@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); } }
Example 12
Source File: BaseItemAnimator.java From GankGirl with GNU Lesser General Public License v2.1 | 5 votes |
protected void clearInterpolator(View v) { ViewCompat.setAlpha(v, 1.0F); ViewCompat.setScaleY(v, 1.0F); ViewCompat.setScaleX(v, 1.0F); ViewCompat.setTranslationY(v, 0.0F); ViewCompat.setTranslationX(v, 0.0F); ViewCompat.setRotation(v, 0.0F); ViewCompat.setRotationY(v, 0.0F); ViewCompat.setRotationX(v, 0.0F); //v.setPivotY((float)(v.getMeasuredHeight() / 2)); ViewCompat.setPivotX(v, (float) (v.getMeasuredWidth() / 2)); ViewCompat.animate(v).setInterpolator((Interpolator) null); }
Example 13
Source File: BaseTransformer.java From PageRecyclerView with Apache License 2.0 | 5 votes |
protected void onPreTransform(View view, float position, @OnPageDataListener.LayoutOrientation int mOrientation) { ViewCompat.setAlpha(view, 1); ViewCompat.setPivotX(view, 0); ViewCompat.setPivotY(view, 0); ViewCompat.setRotationY(view, 0); ViewCompat.setRotationX(view, 0); ViewCompat.setScaleX(view, 1); ViewCompat.setScaleY(view, 1); ViewCompat.setTranslationX(view, 0); ViewCompat.setTranslationY(view, 0); }
Example 14
Source File: FlipDownItemAnimator.java From RecyclerViewLib with Apache License 2.0 | 5 votes |
@Override protected void onRemoveCanceled(ViewHolder holder) { ViewCompat.setRotationY(holder.itemView, 0); ViewCompat.setTranslationX(holder.itemView, 0); ViewCompat.setScaleX(holder.itemView, 1); ViewCompat.setScaleY(holder.itemView, 1); }
Example 15
Source File: FlipDownItemAnimator.java From RecyclerViewLib with Apache License 2.0 | 4 votes |
@Override protected boolean prepHolderForAnimateAdd(ViewHolder holder) { ViewCompat.setTranslationX(holder.itemView, - (holder.itemView.getMeasuredWidth() / 2)); ViewCompat.setRotationY(holder.itemView, -90); return true; }
Example 16
Source File: CubePageTransformer.java From JD-Test with Apache License 2.0 | 4 votes |
@Override public void handleRightPage(View view, float position) { ViewCompat.setPivotX(view, 0); ViewCompat.setPivotY(view, view.getMeasuredHeight() * 0.5f); ViewCompat.setRotationY(view, mMaxRotation * position); }
Example 17
Source File: CubePageTransformer.java From JD-Test with Apache License 2.0 | 4 votes |
@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); }
Example 18
Source File: CubePageTransformer.java From KUtils with Apache License 2.0 | 4 votes |
@Override public void handleRightPage(View view, float position) { ViewCompat.setPivotX(view, 0); ViewCompat.setPivotY(view, view.getMeasuredHeight() * 0.5f); ViewCompat.setRotationY(view, mMaxRotation * position); }
Example 19
Source File: FlipDownItemAnimator.java From RecyclerViewLib with Apache License 2.0 | 4 votes |
@Override protected void onAddCanceled(ViewHolder holder) { ViewCompat.setRotationY(holder.itemView, 0); ViewCompat.setTranslationX(holder.itemView, 0); }
Example 20
Source File: FlipInLeftYAnimator.java From RecyclerviewAnimators with Apache License 2.0 | 4 votes |
@Override protected void preAnimateAddImpl(RecyclerView.ViewHolder holder) { ViewCompat.setRotationY(holder.itemView, 90); }