android.support.v4.view.ViewCompat#setRotationX ( )源码实例Demo

下面列出了android.support.v4.view.ViewCompat#setRotationX ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: KUtils   文件: BGABannerUtil.java
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);
    }
}
 
源代码2 项目: KUtils-master   文件: BGABannerUtil.java
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);
    }
}
 
源代码3 项目: MultiView   文件: BaseItemAnimator.java
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();
}
 
源代码4 项目: FimiX8-RE   文件: BaseViewAnimator.java
public void reset(View target) {
    ViewCompat.setAlpha(target, 1.0f);
    ViewCompat.setScaleX(target, 1.0f);
    ViewCompat.setScaleY(target, 1.0f);
    ViewCompat.setTranslationX(target, 0.0f);
    ViewCompat.setTranslationY(target, 0.0f);
    ViewCompat.setRotation(target, 0.0f);
    ViewCompat.setRotationY(target, 0.0f);
    ViewCompat.setRotationX(target, 0.0f);
}
 
源代码5 项目: PageRecyclerView   文件: CubeOutTransformer.java
@Override
protected void onTransform(View view, float position, boolean forwardDirection, int mOrientation) {
	if (mOrientation == OnPageDataListener.HORIZONTAL) {
		ViewCompat.setPivotX(view, position < 0f ? view.getWidth() : 0f);
		ViewCompat.setPivotY(view, view.getHeight() * 0.5f);
		ViewCompat.setRotationY(view, 90f * position);
	} else {
		ViewCompat.setPivotY(view, position < 0f ? view.getHeight() : 0f);
		ViewCompat.setPivotX(view, view.getWidth() * 0.5f);
		ViewCompat.setRotationX(view, -90f * position);
	}
}
 
源代码6 项目: PageRecyclerView   文件: FlipTransformer.java
@Override
protected void onTransform(View view, float position, boolean forwardDirection, int mOrientation) {
	final float rotation = 180f * (position);
	if (mOrientation == OnPageDataListener.HORIZONTAL) {
		ViewCompat.setAlpha(view, rotation > 90f || rotation < -90f ? 0 : 1);
		ViewCompat.setPivotX(view, view.getWidth() * 0.5f);
		ViewCompat.setPivotY(view, view.getHeight() * 0.5f);
		ViewCompat.setRotationY(view, rotation);
	} else {
		ViewCompat.setAlpha(view, rotation > 90f || rotation < -90f ? 0 : 1);
		ViewCompat.setPivotX(view, view.getWidth() * 0.5f);
		ViewCompat.setPivotY(view, view.getHeight() * 0.5f);
		ViewCompat.setRotationX(view, -rotation);
	}
}
 
源代码7 项目: PageRecyclerView   文件: BaseTransformer.java
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);
}
 
源代码8 项目: FlyRefresh   文件: UIUtils.java
public static void clearAnimator(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);
}
 
源代码9 项目: SimpleNews   文件: ViewHelper.java
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);
}
 
源代码10 项目: MemoryCleaner   文件: ViewHelper.java
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);
}
 
源代码11 项目: PowerfulRecyclerView   文件: AnimateViewUtils.java
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);
}
 
源代码12 项目: Nimingban   文件: ViewHelper.java
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);
}
 
源代码13 项目: RecyclerviewAnimators   文件: ViewHelper.java
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);
    }
 
@Override
protected void onTransform(View view, float position) {
    final float rotation = -180f * position;
    ViewCompat.setAlpha(view, rotation > 90f || rotation < -90f ? 0f : 1f);
    ViewCompat.setPivotX(view, view.getWidth() * 0.5f);
    ViewCompat.setPivotY(view, view.getHeight() * 0.5f);
    ViewCompat.setRotationX(view, rotation);

}
 
源代码15 项目: RecyclerViewLib   文件: GarageDoorItemAnimator.java
@Override
protected void onAddCanceled(ViewHolder holder) {
    ViewCompat.setRotationX(holder.itemView, 0);
    ViewCompat.setTranslationY(holder.itemView, 0);
}
 
源代码16 项目: RecyclerViewLib   文件: GarageDoorItemAnimator.java
@Override
protected boolean prepHolderForAnimateAdd(ViewHolder holder) {
    ViewCompat.setRotationX(holder.itemView, 90);
    ViewCompat.setTranslationY(holder.itemView, - (holder.itemView.getMeasuredHeight() / 2));
    return true;
}
 
源代码17 项目: RecyclerViewLib   文件: GarageDoorItemAnimator.java
@Override
protected void onRemoveCanceled(ViewHolder holder) {
    ViewCompat.setRotationX(holder.itemView, 0);
    ViewCompat.setTranslationY(holder.itemView, 0);
}
 
源代码18 项目: RecyclerviewAnimators   文件: FlipInTopXAnimator.java
@Override
protected void preAnimateAddImpl(RecyclerView.ViewHolder holder) {
    ViewCompat.setRotationX(holder.itemView, 90);
}
 
@Override
protected void preAnimateAddImpl(RecyclerView.ViewHolder holder) {
    ViewCompat.setRotationX(holder.itemView, -90);
}
 
源代码20 项目: LoyalNativeSlider   文件: BaseTransformer.java
/**
 * Called each {@link #transformPage(View, float)} before {{@link #onTransform(View, float)} is called.
 *
 * @param view     view
 * @param position position
 */
protected void onPreTransform(View view, float position) {
    final float width = view.getWidth();

    ViewCompat.setRotationX(view, 0);
    ViewCompat.setRotationY(view, 0);
    ViewCompat.setRotation(view, 0);
    ViewCompat.setScaleX(view, 1);
    ViewCompat.setScaleY(view, 1);
    ViewCompat.setPivotX(view, 0);
    ViewCompat.setPivotY(view, 0);
    ViewCompat.setTranslationY(view, 0);
    ViewCompat.setTranslationX(view, isPagingEnabled() ? 0f : -width * position);

    if (hideOffscreenPages()) {
        ViewCompat.setAlpha(view, position <= -1f || position >= 1f ? 0f : 1f);
    } else {
        ViewCompat.setAlpha(view, 1f);
    }
    if (mCustomAnimationInterface != null) {
        if (h.containsKey(view) == false || h.get(view).size() == 1) {
            if (position > -1 && position < 1) {
                if (h.get(view) == null) {
                    h.put(view, new ArrayList<Float>());
                }
                h.get(view).add(position);
                if (h.get(view).size() == 2) {
                    float zero = h.get(view).get(0);
                    float cha = h.get(view).get(1) - h.get(view).get(0);
                    if (zero > 0) {
                        if (cha > -1 && cha < 0) {
                            //in
                            mCustomAnimationInterface.onPrepareNextItemShowInScreen(view);
                        } else {
                            //out
                            mCustomAnimationInterface.onPrepareCurrentItemLeaveScreen(view);
                        }
                    } else {
                        if (cha > -1 && cha < 0) {
                            //out
                            mCustomAnimationInterface.onPrepareCurrentItemLeaveScreen(view);
                        } else {
                            //in
                            mCustomAnimationInterface.onPrepareNextItemShowInScreen(view);
                        }
                    }
                }
            }
        }
    }
}
 
 同类方法