android.view.View#setRotationX ( )源码实例Demo

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

源代码1 项目: EasyTabs   文件: ABaseTransformer.java
/**
 * Called each {@link #transformPage(View, float)} before {{@link #onTransform(View, float)}.
 * <p>
 * The default implementation attempts to reset all view properties. This is useful when toggling transforms that do
 * not modify the same page properties. For instance changing from a transformation that applies rotation to a
 * transformation that fades can inadvertently leave a fragment stuck with a rotation or with some degree of applied
 * alpha.
 * 
 * @param page
 *            Apply the transformation to this page
 * @param position
 *            Position of page relative to the current front-and-center position of the pager. 0 is front and
 *            center. 1 is one full page position to the right, and -1 is one page position to the left.
 */
protected void onPreTransform(View page, float position) {
	final float width = page.getWidth();

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

	if (hideOffscreenPages()) {
		page.setAlpha(position <= -1f || position >= 1f ? 0f : 1f);
		page.setEnabled(false);
	} else {
		page.setEnabled(true);
		page.setAlpha(1f);
	}
}
 
/**
 * Called each {@link #transformPage(View, float)} before {{@link #onTransform(View, float)}.
 * <p>
 * The default implementation attempts to reset all view properties. This is useful when toggling transforms that do
 * not modify the same page properties. For instance changing from a transformation that applies rotation to a
 * transformation that fades can inadvertently leave a fragment stuck with a rotation or with some degree of applied
 * alpha.
 * 
 * @param page
 *            Apply the transformation to this page
 * @param position
 *            Position of page relative to the current front-and-center position of the pager. 0 is front and
 *            center. 1 is one full page position to the right, and -1 is one page position to the left.
 */
protected void onPreTransform(View page, float position) {
	final float width = page.getWidth();

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

	if (hideOffscreenPages()) {
		page.setAlpha(position <= -1f || position >= 1f ? 0f : 1f);
		page.setEnabled(false);
	} else {
		page.setEnabled(true);
		page.setAlpha(1f);
	}
}
 
@Override
public Animator getInAnimator(View target, SlideShowView parent, int fromSlide, int toSlide) {
    target.setAlpha(0);
    target.setScaleX(SCALE_FACTOR);
    target.setScaleY(SCALE_FACTOR);
    target.setTranslationX(0);
    target.setTranslationY(0);
    target.setRotationX(0);
    target.setRotationY(0);

    final PropertyValuesHolder scaleX = PropertyValuesHolder.ofFloat(View.SCALE_X, 1);
    final PropertyValuesHolder scaleY = PropertyValuesHolder.ofFloat(View.SCALE_Y, 1);
    final PropertyValuesHolder alpha = PropertyValuesHolder.ofFloat(View.ALPHA, 1);

    ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(target, scaleX, scaleY, alpha);
    animator.setDuration(getDuration());
    animator.setInterpolator(getInterpolator());

    return animator;
}
 
源代码4 项目: Nibo   文件: ViewAnimationUtilties.java
/**
 * Lifting view
 *
 * @param view The animation target
 * @param baseRotation initial Rotation X in 3D space
 * @param duration aniamtion duration
 * @param startDelay start delay before animation begin
 */
@Deprecated
public static void liftingFromBottom(View view, float baseRotation, int duration, int startDelay){
    view.setRotationX(baseRotation);
    view.setTranslationY(view.getHeight() / 3);

    view
            .animate()
            .setInterpolator(new AccelerateDecelerateInterpolator())
            .setDuration(duration)
            .setStartDelay(startDelay)
            .rotationX(0)
            .translationY(0)
            .start();

}
 
源代码5 项目: YCRefreshView   文件: BaseTransformer.java
protected void onPreTransform(View page, float position) {
	final float width = page.getWidth();

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

	if (hideOffscreenPages()) {
		page.setAlpha(position <= -1f || position >= 1f ? 0f : 1f);
	} else {
		page.setAlpha(1f);
	}
}
 
源代码6 项目: PageRecyclerView   文件: TabletTransformer.java
@Override
protected void onTransform(View view, float position, boolean forwardDirection, int mOrientation) {
	final float rotation = (position < 0 ? 30f : -30f) * Math.abs(position);
	if (mOrientation == OnPageDataListener.HORIZONTAL) {
		view.setTranslationX(getOffsetForRotation(rotation, view.getWidth(), view.getHeight(), mOrientation));
		view.setPivotX(view.getWidth() * 0.5f);
		view.setPivotY(0);
		view.setRotationY(rotation);
	} else {
		view.setTranslationY(getOffsetForRotation(rotation, view.getWidth(), view.getHeight(), mOrientation));
		view.setPivotY(view.getHeight() * 0.5f);
		view.setPivotX(0);
		view.setRotationX(-rotation);
	}

}
 
源代码7 项目: RecyclerBanner   文件: OverFlyingLayoutManager.java
protected void setItemViewProperty(View itemView, float targetOffset) {
    float scale = calculateScale(targetOffset + mSpaceMain);
    itemView.setScaleX(scale);
    itemView.setScaleY(scale);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        itemView.setElevation(0);
    }
    final float rotation = calRotation(targetOffset);
    if (getOrientation() == HORIZONTAL) {
        itemView.setRotationY(rotation);
    } else {
        itemView.setRotationX(-rotation);
    }
}
 
源代码8 项目: Flubber   文件: FlubberUtil.java
public static void clearAnimation(View view) {
    view.setAlpha(1);
    view.setScaleX(1);
    view.setScaleY(1);
    view.setTranslationX(0);
    view.setTranslationY(0);
    view.setRotation(0);
    view.setRotationX(0);
    view.setRotationY(0);
}
 
private void resetAnimatedView(View child) {
    child.setAlpha(1.f);
    child.setTranslationX(0.f);
    child.setTranslationY(0.f);
    child.setRotation(0.f);
    child.setRotationY(0.f);
    child.setRotationX(0.f);
    child.setScaleX(1.f);
    child.setScaleY(1.f);
}
 
源代码10 项目: EasyTabs   文件: EasyFlipVerticalTransformer.java
@Override
protected void onTransform(View view, float position) {
	final float rotation = -180f * position;

	view.setAlpha(rotation > 90f || rotation < -90f ? 0f : 1f);
	view.setPivotX(view.getWidth() * 0.5f);
	view.setPivotY(view.getHeight() * 0.5f);
	view.setRotationX(rotation);
}
 
源代码11 项目: FloatingView   文件: YumFloating.java
@Override
public void setRotationX(float rotationX) {
    View targetView;
    if ((targetView = getTargetView()) != null){
        targetView.setRotationX(rotationX);
    }
}
 
源代码12 项目: PictureSelector   文件: ViewHelper.java
public static void clear(View v) {
    v.setAlpha(1);
    v.setScaleY(1);
    v.setScaleX(1);
    v.setTranslationY(0);
    v.setTranslationX(0);
    v.setRotation(0);
    v.setRotationY(0);
    v.setRotationX(0);
    v.setPivotY(v.getMeasuredHeight() / 2);
    v.setPivotX(v.getMeasuredWidth() / 2);
    ViewCompat.animate(v).setInterpolator(null).setStartDelay(0);
}
 
@Override
protected void onTransform(View view, float position) {
	final float rotation = -180f * position;

	view.setAlpha(rotation > 90f || rotation < -90f ? 0f : 1f);
	view.setPivotX(view.getWidth() * 0.5f);
	view.setPivotY(view.getHeight() * 0.5f);
	view.setRotationX(rotation);
}
 
源代码14 项目: AutoTest   文件: BaseAnimatorSet.java
public static void reset(View view) {
    view.setAlpha(1);
    view.setScaleX(1);
    view.setScaleY(1);
    view.setTranslationX(0);
    view.setTranslationY(0);
    view.setRotation(0);
    view.setRotationY(0);
    view.setRotationX(0);
}
 
源代码15 项目: CircularReveal   文件: DynamicAnimation.java
@Override
public void setValue(View view, float value) {
  view.setRotationX(value);
}
 
源代码16 项目: letv   文件: ViewCompatHC.java
public static void setRotationX(View view, float value) {
    view.setRotationX(value);
}
 
源代码17 项目: imsdk-android   文件: ViewHelper.java
static void setRotationX(View view, float rotationX) {
    view.setRotationX(rotationX);
}
 
源代码18 项目: MiBandDecompiled   文件: a.java
static void e(View view, float f1)
{
    view.setRotationX(f1);
}
 
源代码19 项目: Auie   文件: UEViewHelper.java
static void setRotationX(View view, float rotationX) {
    view.setRotationX(rotationX);
}
 
源代码20 项目: UltimateAndroid   文件: ViewHelper.java
static void setRotationX(View view, float rotationX) {
    view.setRotationX(rotationX);
}
 
 方法所在类
 同类方法