Java Code Examples for com.nineoldandroids.view.ViewHelper#setRotationX()

The following examples show how to use com.nineoldandroids.view.ViewHelper#setRotationX() . 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: ViewAnimationUtils.java    From RecyclerView-Animation-Demo with Apache License 2.0 6 votes vote down vote up
/**
 * 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){
    ViewHelper.setRotationX(view, baseRotation);
    ViewHelper.setTranslationY(view, view.getHeight() / 3);

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

}
 
Example 2
Source File: PullToNextView.java    From Android-PullToNextLayout with Apache License 2.0 6 votes vote down vote up
public void reset(BaseAdapter adapter, int position) {
    setHeaderTopMargin(-mHeadViewHeight);
    initContentView(adapter, position);
    mScrollView=null;
    mWebView=null;
    ViewHelper.setAlpha(this, 1);
    ViewHelper.setTranslationY(this, 0);
    ViewHelper.setTranslationY(this, 0);
    ViewHelper.setScaleX(this, 1);
    ViewHelper.setScaleY(this, 1);
    ViewHelper.setScrollX(this, 0);
    ViewHelper.setScrollY(this, 0);
    ViewHelper.setRotationX(this, 0);
    ViewHelper.setRotationY(this, 0);


}
 
Example 3
Source File: ViewAnimationUtils.java    From WeGit with Apache License 2.0 5 votes vote down vote up
/**
 * 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
 */
public static void liftingFromBottom(View view, float baseRotation, int duration, int startDelay){
    ViewHelper.setRotationX(view, baseRotation);
    ViewHelper.setTranslationY(view, view.getHeight() / 3);

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

}
 
Example 4
Source File: BaseAnimator.java    From FlycoBanner_Master with MIT License 5 votes vote down vote up
public static void reset(View view) {
    ViewHelper.setAlpha(view, 1);
    ViewHelper.setScaleX(view, 1);
    ViewHelper.setScaleY(view, 1);
    ViewHelper.setTranslationX(view, 0);
    ViewHelper.setTranslationY(view, 0);
    ViewHelper.setRotation(view, 0);
    ViewHelper.setRotationY(view, 0);
    ViewHelper.setRotationX(view, 0);
}
 
Example 5
Source File: ViewAnimationUtils.java    From ExpressHelper with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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
 */
public static void liftingFromBottom(View view, float baseRotation, int duration, int startDelay){
    ViewHelper.setRotationX(view, baseRotation);
    ViewHelper.setTranslationY(view, view.getHeight() / 3);

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

}
 
Example 6
Source File: IndicatorBaseAnimator.java    From FlycoPageIndicator with MIT License 5 votes vote down vote up
public static void reset(View view) {
    ViewHelper.setAlpha(view, 1);
    ViewHelper.setScaleX(view, 1);
    ViewHelper.setScaleY(view, 1);
    ViewHelper.setTranslationX(view, 0);
    ViewHelper.setTranslationY(view, 0);
    ViewHelper.setRotation(view, 0);
    ViewHelper.setRotationY(view, 0);
    ViewHelper.setRotationX(view, 0);
}
 
Example 7
Source File: ViewAnimationUtils.java    From NHentai-android with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Lifting view
 *
 * @param view The animation target
 * @param baseRotation initial Rotation X in 3D space
 * @param duration aniamtion duration
 */
public static void liftingFromBottom(View view, float baseRotation, int duration){
    ViewHelper.setRotationX(view, baseRotation);
    ViewHelper.setTranslationY(view, view.getHeight() / 3);

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

}
 
Example 8
Source File: JazzyViewPager.java    From android-kernel-tweaker with GNU General Public License v3.0 5 votes vote down vote up
private void animateFlipVertical(View left, View right, float positionOffset, int positionOffsetPixels) {
	if(mState != State.IDLE) {
		if (left != null) {
			manageLayer(left, true);
			mRot = 180.0f * positionOffset;
			if (mRot > 90.0f) {
				left.setVisibility(View.INVISIBLE);
			} else {
				if (left.getVisibility() == View.INVISIBLE)
					left.setVisibility(View.VISIBLE);
				mTrans = positionOffsetPixels;
				ViewHelper.setPivotX(left, left.getMeasuredWidth()*0.5f);
				ViewHelper.setPivotY(left, left.getMeasuredHeight()*0.5f);
				ViewHelper.setTranslationX(left, mTrans);
				ViewHelper.setRotationX(left, mRot);
			}
		}
		if (right != null) {
			manageLayer(right, true);
			mRot = -180.0f * (1-positionOffset);
			if (mRot < -90.0f) {
				right.setVisibility(View.INVISIBLE);
			} else {
				if (right.getVisibility() == View.INVISIBLE)
					right.setVisibility(View.VISIBLE);
				mTrans = -getWidth()-getPageMargin()+positionOffsetPixels;
				ViewHelper.setPivotX(right, right.getMeasuredWidth()*0.5f);
				ViewHelper.setPivotY(right, right.getMeasuredHeight()*0.5f);
				ViewHelper.setTranslationX(right, mTrans);
				ViewHelper.setRotationX(right, mRot);
			}
		}
	}
}
 
Example 9
Source File: ViewAnimationUtils.java    From NHentai-android with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Lifting view
 *
 * @param view The animation target
 * @param baseRotation initial Rotation X in 3D space
 * @param fromY initial Y position of view
 * @param duration aniamtion duration
 * @param startDelay start delay before animation begin
 */
public static void liftingFromBottom(View view, float baseRotation, float fromY, int duration, int startDelay){
    ViewHelper.setRotationX(view, baseRotation);
    ViewHelper.setTranslationY(view, fromY);

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

}
 
Example 10
Source File: JazzyViewPager.java    From school_shop with MIT License 5 votes vote down vote up
private void animateFlipVertical(View left, View right, float positionOffset, int positionOffsetPixels) {
	if(mState != State.IDLE) {
		if (left != null) {
			manageLayer(left, true);
			mRot = 180.0f * positionOffset;
			if (mRot > 90.0f) {
				left.setVisibility(View.INVISIBLE);
			} else {
				if (left.getVisibility() == View.INVISIBLE)
					left.setVisibility(View.VISIBLE);
				mTrans = positionOffsetPixels;
				ViewHelper.setPivotX(left, left.getMeasuredWidth()*0.5f);
				ViewHelper.setPivotY(left, left.getMeasuredHeight()*0.5f);
				ViewHelper.setTranslationX(left, mTrans);
				ViewHelper.setRotationX(left, mRot);
			}
		}
		if (right != null) {
			manageLayer(right, true);
			mRot = -180.0f * (1-positionOffset);
			if (mRot < -90.0f) {
				right.setVisibility(View.INVISIBLE);
			} else {
				if (right.getVisibility() == View.INVISIBLE)
					right.setVisibility(View.VISIBLE);
				mTrans = -getWidth()-getPageMargin()+positionOffsetPixels;
				ViewHelper.setPivotX(right, right.getMeasuredWidth()*0.5f);
				ViewHelper.setPivotY(right, right.getMeasuredHeight()*0.5f);
				ViewHelper.setTranslationX(right, mTrans);
				ViewHelper.setRotationX(right, mRot);
			}
		}
	}
}
 
Example 11
Source File: ViewAnimationUtils.java    From WeGit with Apache License 2.0 5 votes vote down vote up
/**
 * Lifting view
 *
 * @param view The animation target
 * @param baseRotation initial Rotation X in 3D space
 * @param duration aniamtion duration
 */
public static void liftingFromBottom(View view, float baseRotation, int duration){
    ViewHelper.setRotationX(view, baseRotation);
    ViewHelper.setTranslationY(view, view.getHeight() / 3);

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

}
 
Example 12
Source File: ViewAnimationUtils.java    From Mover with Apache License 2.0 5 votes vote down vote up
/**
 * Lifting view
 *
 * @param view The animation target
 * @param baseRotation initial Rotation X in 3D space
 * @param duration aniamtion duration
 */
public static void liftingFromBottom(View view, float baseRotation, int duration){
    ViewHelper.setRotationX(view, baseRotation);
    ViewHelper.setTranslationY(view, view.getHeight() / 3);

    ViewPropertyAnimator
            .animate(view)
            .setInterpolator(ACCELERATE_DECELERATE)
            .setDuration(duration)
            .rotationX(0)
            .translationY(0)
            .start();

}
 
Example 13
Source File: BaseViewAnimator.java    From UltimateAndroid with Apache License 2.0 5 votes vote down vote up
/**
 * reset the view to default status
 *
 * @param target
 */
public void reset(View target) {
    ViewHelper.setAlpha(target, 1);
    ViewHelper.setScaleX(target, 1);
    ViewHelper.setScaleY(target, 1);
    ViewHelper.setTranslationX(target, 0);
    ViewHelper.setTranslationY(target, 0);
    ViewHelper.setRotation(target, 0);
    ViewHelper.setRotationY(target, 0);
    ViewHelper.setRotationX(target, 0);
    ViewHelper.setPivotX(target, target.getMeasuredWidth() / 2.0f);
    ViewHelper.setPivotY(target, target.getMeasuredHeight() / 2.0f);
}
 
Example 14
Source File: ViewAnimationUtils.java    From Jide-Note with MIT License 5 votes vote down vote up
/**
 * Lifting view
 *
 * @param view The animation target
 * @param baseRotation initial Rotation X in 3D space
 * @param fromY initial Y position of view
 * @param duration aniamtion duration
 * @param startDelay start delay before animation begin
 */
public static void liftingFromBottom(View view, float baseRotation, float fromY, int duration, int startDelay){
    ViewHelper.setRotationX(view, baseRotation);
    ViewHelper.setTranslationY(view, fromY);

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

}
 
Example 15
Source File: ViewAnimationUtils.java    From RecyclerView-Animation-Demo with Apache License 2.0 5 votes vote down vote up
/**
 * Lifting view
 *
 * @param view The animation target
 * @param baseRotation initial Rotation X in 3D space
 * @param duration aniamtion duration
 */
@Deprecated
public static void liftingFromBottom(View view, float baseRotation, int duration){
    ViewHelper.setRotationX(view, baseRotation);
    ViewHelper.setTranslationY(view, view.getHeight() / 3);

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

}
 
Example 16
Source File: ViewAnimationUtils.java    From material-sheet-fab with MIT License 5 votes vote down vote up
/**
 * Lifting view
 *
 * @param view The animation target
 * @param baseRotation initial Rotation X in 3D space
 * @param duration aniamtion duration
 */
@Deprecated
public static void liftingFromBottom(View view, float baseRotation, int duration){
    ViewHelper.setRotationX(view, baseRotation);
    ViewHelper.setTranslationY(view, view.getHeight() / 3);

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

}
 
Example 17
Source File: BaseTransformer.java    From ImageSliderWithSwipes with Apache License 2.0 4 votes vote down vote up
/**
 * Called each {@link #transformPage(View, float)} before {{@link #onTransform(View, float)} is called.
 *
 * @param view
 * @param position
 */
protected void onPreTransform(View view, float position) {
    final float width = view.getWidth();

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

    if (hideOffscreenPages()) {
        ViewHelper.setAlpha(view,position <= -1f || position >= 1f ? 0f : 1f);
    } else {
        ViewHelper.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);
                        }
                    }
                }
            }
        }
    }
}
 
Example 18
Source File: BaseTransformer.java    From UltimateAndroid with Apache License 2.0 4 votes vote down vote up
/**
 * Called each {@link #transformPage(android.view.View, float)} before {{@link #onTransform(android.view.View, float)} is called.
 *
 * @param view
 * @param position
 */
protected void onPreTransform(View view, float position) {
    final float width = view.getWidth();

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

    if (hideOffscreenPages()) {
        ViewHelper.setAlpha(view,position <= -1f || position >= 1f ? 0f : 1f);
    } else {
        ViewHelper.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);
                        }
                    }
                }
            }
        }
    }
}
 
Example 19
Source File: BaseTransformer.java    From AndroidImageSlider with MIT License 4 votes vote down vote up
/**
 * Called each {@link #transformPage(View, float)} before {{@link #onTransform(View, float)} is called.
 *
 * @param view
 * @param position
 */
protected void onPreTransform(View view, float position) {
    final float width = view.getWidth();

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

    if (hideOffscreenPages()) {
        ViewHelper.setAlpha(view,position <= -1f || position >= 1f ? 0f : 1f);
    } else {
        ViewHelper.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);
                        }
                    }
                }
            }
        }
    }
}
 
Example 20
Source File: JazzyViewPager.java    From ClockView with Apache License 2.0 4 votes vote down vote up
private void animateFlipVertical(View left, View right,
		float positionOffset, int positionOffsetPixels)
{
	if (mState != State.IDLE)
	{
		if (left != null)
		{
			manageLayer(left, true);
			mRot = 180.0f * positionOffset;
			if (mRot > 90.0f)
			{
				left.setVisibility(View.INVISIBLE);
			} else
			{
				if (left.getVisibility() == View.INVISIBLE)
					left.setVisibility(View.VISIBLE);
				mTrans = positionOffsetPixels;
				ViewHelper.setPivotX(left, left.getMeasuredWidth() * 0.5f);
				ViewHelper.setPivotY(left, left.getMeasuredHeight() * 0.5f);
				ViewHelper.setTranslationX(left, mTrans);
				ViewHelper.setRotationX(left, mRot);
			}
		}
		if (right != null)
		{
			manageLayer(right, true);
			mRot = -180.0f * (1 - positionOffset);
			if (mRot < -90.0f)
			{
				right.setVisibility(View.INVISIBLE);
			} else
			{
				if (right.getVisibility() == View.INVISIBLE)
					right.setVisibility(View.VISIBLE);
				mTrans = -getWidth() - getPageMargin()
						+ positionOffsetPixels;
				ViewHelper
						.setPivotX(right, right.getMeasuredWidth() * 0.5f);
				ViewHelper.setPivotY(right,
						right.getMeasuredHeight() * 0.5f);
				ViewHelper.setTranslationX(right, mTrans);
				ViewHelper.setRotationX(right, mRot);
			}
		}
	}
}