当前位置: 首页>>代码示例>>Java>>正文


Java ViewHelper.setRotation方法代码示例

本文整理汇总了Java中com.nineoldandroids.view.ViewHelper.setRotation方法的典型用法代码示例。如果您正苦于以下问题:Java ViewHelper.setRotation方法的具体用法?Java ViewHelper.setRotation怎么用?Java ViewHelper.setRotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.nineoldandroids.view.ViewHelper的用法示例。


在下文中一共展示了ViewHelper.setRotation方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: animateRotate

import com.nineoldandroids.view.ViewHelper; //导入方法依赖的package包/类
private void animateRotate(View left, View right, float positionOffset, boolean up) {
	if (mState != State.IDLE) {
		if (left != null) {
			manageLayer(left, true);
			mRot = (up ? 1 : -1) * (ROT_MAX * positionOffset);
			mTrans = (up ? -1 : 1) * (float) (getMeasuredHeight() - getMeasuredHeight()*Math.cos(mRot*Math.PI/180.0f));
			ViewHelper.setPivotX(left, left.getMeasuredWidth()*0.5f);
			ViewHelper.setPivotY(left, up ? 0 : left.getMeasuredHeight());
			ViewHelper.setTranslationY(left, mTrans);
			ViewHelper.setRotation(left, mRot);
		}
		if (right != null) {
			manageLayer(right, true);
			mRot = (up ? 1 : -1) * (-ROT_MAX + ROT_MAX*positionOffset);
			mTrans = (up ? -1 : 1) * (float) (getMeasuredHeight() - getMeasuredHeight()*Math.cos(mRot*Math.PI/180.0f));
			ViewHelper.setPivotX(right, right.getMeasuredWidth()*0.5f);
			ViewHelper.setPivotY(right, up ? 0 : right.getMeasuredHeight());
			ViewHelper.setTranslationY(right, mTrans);
			ViewHelper.setRotation(right, mRot);
		}
	}
}
 
开发者ID:SimonCherryGZ,项目名称:JewelryUI,代码行数:23,代码来源:JazzyViewPager.java

示例2: transformPage

import com.nineoldandroids.view.ViewHelper; //导入方法依赖的package包/类
@Override
public void transformPage(View page, float position) {
    if (position < -1) {
        ViewHelper.setRotation(page, 0);
    } else if (position <= 1) {
        if (position < 0) {
            mRot = (ROT_MAX * position);
            ViewHelper.setPivotX(page, page.getMeasuredWidth() * 0.5f);
            ViewHelper.setPivotY(page, page.getMeasuredHeight());
            ViewHelper.setRotation(page, mRot);
        } else {
            mRot = (ROT_MAX * position);
            ViewHelper.setPivotX(page, page.getMeasuredWidth() * 0.5f);
            ViewHelper.setPivotY(page, page.getMeasuredHeight());
            ViewHelper.setRotation(page, mRot);
        }
    } else {
        ViewHelper.setRotation(page, 0);
    }
}
 
开发者ID:shenhuanet,项目名称:OpenEyesReading-android,代码行数:21,代码来源:RotateDownPage.java

示例3: onTransform

import com.nineoldandroids.view.ViewHelper; //导入方法依赖的package包/类
@Override
protected void onTransform(View view, float position) {
	// Rotate the fragment on the left or right edge
       ViewHelper.setPivotX(view,position > 0 ? 0 : view.getWidth());
       ViewHelper.setPivotY(view,0);
       ViewHelper.setRotation(view,-90f * position);
}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:8,代码来源:CubeInTransformer.java

示例4: onTransform

import com.nineoldandroids.view.ViewHelper; //导入方法依赖的package包/类
@Override
protected void onTransform(View view, float position) {
	final float width = view.getWidth();
	final float height = view.getHeight();
	final float rotation = ROT_MOD * position * -1.25f;

	ViewHelper.setPivotX(view,width * 0.5f);
       ViewHelper.setPivotY(view,height);
       ViewHelper.setRotation(view,rotation);
}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:11,代码来源:RotateDownTransformer.java

示例5: onTransform

import com.nineoldandroids.view.ViewHelper; //导入方法依赖的package包/类
@Override
protected void onTransform(View view, float position) {
	final float width = view.getWidth();
	final float rotation = ROT_MOD * position;

	ViewHelper.setPivotX(view,width * 0.5f);
       ViewHelper.setPivotY(view,0f);
       ViewHelper.setTranslationX(view,0f);
       ViewHelper.setRotation(view,rotation);
}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:11,代码来源:RotateUpTransformer.java

示例6: reset

import com.nineoldandroids.view.ViewHelper; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:ebridfighter,项目名称:GongXianSheng,代码行数:18,代码来源:BaseViewAnimator.java

示例7: clear

import com.nineoldandroids.view.ViewHelper; //导入方法依赖的package包/类
public static void clear(View v) {
    ViewHelper.setAlpha(v, 1);
    ViewHelper.setScaleY(v, 1);
    ViewHelper.setScaleX(v, 1);
    ViewHelper.setTranslationY(v, 0);
    ViewHelper.setTranslationX(v, 0);
    ViewHelper.setRotation(v, 0);
    ViewHelper.setRotationY(v, 0);
    ViewHelper.setRotationX(v, 0);
    // @TODO https://code.google.com/p/android/issues/detail?id=80863
    //        ViewHelper.setPivotY(v, v.getMeasuredHeight() / 2);
    v.setPivotY(v.getMeasuredHeight() / 2);
    ViewHelper.setPivotX(v, v.getMeasuredWidth() / 2);
    ViewPropertyAnimator.animate(v).setInterpolator(null);
}
 
开发者ID:SalmanTKhan,项目名称:MyAnimeViewer,代码行数:16,代码来源:BaseItemAnimator.java

示例8: reset

import com.nineoldandroids.view.ViewHelper; //导入方法依赖的package包/类
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);
}
 
开发者ID:Luodian,项目名称:Shared-Route,代码行数:11,代码来源:BaseAnimatorSet.java

示例9: resetVerticalAnimation

import com.nineoldandroids.view.ViewHelper; //导入方法依赖的package包/类
/**
 * Set starting params to vertical animations
 */
private void resetVerticalAnimation(View view, boolean toTop) {
    if (!mIsMenuOpen) {
        ViewHelper.setRotation(view, 0);
        ViewHelper.setRotationY(view, 0);
        ViewHelper.setRotationX(view, -90);
    }
    ViewHelper.setPivotX(view, mMenuItemSize / 2);
    ViewHelper.setPivotY(view, !toTop ? 0 : mMenuItemSize);
}
 
开发者ID:zongkaili,项目名称:MenuSet,代码行数:13,代码来源:MenuAdapter.java

示例10: resetSideAnimation

import com.nineoldandroids.view.ViewHelper; //导入方法依赖的package包/类
/**
 * Set starting params to side animations
 */
private void resetSideAnimation(View view) {
    if (!mIsMenuOpen) {
        ViewHelper.setRotation(view, 0);
        ViewHelper.setRotationY(view, -90);
        ViewHelper.setRotationX(view, 0);
    }
    ViewHelper.setPivotX(view, mMenuItemSize);
    ViewHelper.setPivotY(view, mMenuItemSize / 2);
}
 
开发者ID:zongkaili,项目名称:MenuSet,代码行数:13,代码来源:MenuAdapter.java

示例11: onPreTransform

import com.nineoldandroids.view.ViewHelper; //导入方法依赖的package包/类
/**
 * 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) || 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);
                        }
                    }
                }
            }
        }
    }
}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:57,代码来源:BaseTransformer.java


注:本文中的com.nineoldandroids.view.ViewHelper.setRotation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。