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

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

源代码1 项目: scene   文件: ChangeTransform.java
Transforms(View view) {
    mTranslationX = view.getTranslationX();
    mTranslationY = view.getTranslationY();
    mTranslationZ = ViewCompat.getTranslationZ(view);
    mScaleX = view.getScaleX();
    mScaleY = view.getScaleY();
    mRotationX = view.getRotationX();
    mRotationY = view.getRotationY();
    mRotationZ = view.getRotation();
}
 
源代码2 项目: scene   文件: RenderNodeAnimatorWrapper.java
private float getValue(int propertyConstant) {
    final View node = mView;
    switch (propertyConstant) {
        case ViewPropertyAnimatorConstant.TRANSLATION_X:
            return node.getTranslationX();
        case ViewPropertyAnimatorConstant.TRANSLATION_Y:
            return node.getTranslationY();
        case ViewPropertyAnimatorConstant.TRANSLATION_Z:
            return node.getTranslationZ();
        case ViewPropertyAnimatorConstant.ROTATION:
            return node.getRotation();
        case ViewPropertyAnimatorConstant.ROTATION_X:
            return node.getRotationX();
        case ViewPropertyAnimatorConstant.ROTATION_Y:
            return node.getRotationY();
        case ViewPropertyAnimatorConstant.SCALE_X:
            return node.getScaleX();
        case ViewPropertyAnimatorConstant.SCALE_Y:
            return node.getScaleY();
        case ViewPropertyAnimatorConstant.X:
            return mView.getLeft() + node.getTranslationX();
        case ViewPropertyAnimatorConstant.Y:
            return mView.getTop() + node.getTranslationY();
        case ViewPropertyAnimatorConstant.Z:
            return node.getElevation() + node.getTranslationZ();
        case ViewPropertyAnimatorConstant.ALPHA:
            return mView.getAlpha();
    }
    return 0;
}
 
源代码3 项目: UltimateAndroid   文件: ViewPropertyAnimatorHC.java
/**
 * This method gets the value of the named property from the View object.
 *
 * @param propertyConstant The property whose value should be returned
 * @return float The value of the named property
 */
private float getValue(int propertyConstant) {
    //final View.TransformationInfo info = mView.mTransformationInfo;
    View v = mView.get();
    if (v != null) {
        switch (propertyConstant) {
            case TRANSLATION_X:
                //return info.mTranslationX;
                return v.getTranslationX();
            case TRANSLATION_Y:
                //return info.mTranslationY;
                return v.getTranslationY();
            case ROTATION:
                //return info.mRotation;
                return v.getRotation();
            case ROTATION_X:
                //return info.mRotationX;
                return v.getRotationX();
            case ROTATION_Y:
                //return info.mRotationY;
                return v.getRotationY();
            case SCALE_X:
                //return info.mScaleX;
                return v.getScaleX();
            case SCALE_Y:
                //return info.mScaleY;
                return v.getScaleY();
            case X:
                //return v.mLeft + info.mTranslationX;
                return v.getX();
            case Y:
                //return v.mTop + info.mTranslationY;
                return v.getY();
            case ALPHA:
                //return info.mAlpha;
                return v.getAlpha();
        }
    }
    return 0;
}
 
源代码4 项目: android_9.0.0_r45   文件: ChangeTransform.java
public Transforms(View view) {
    translationX = view.getTranslationX();
    translationY = view.getTranslationY();
    translationZ = view.getTranslationZ();
    scaleX = view.getScaleX();
    scaleY = view.getScaleY();
    rotationX = view.getRotationX();
    rotationY = view.getRotationY();
    rotationZ = view.getRotation();
}
 
源代码5 项目: simple-view-behavior   文件: SimpleViewBehavior.java
@Override
void prepare(CoordinatorLayout parent, View child, View dependency) {
    super.prepare(parent, child, dependency);

    mStartX = (int) child.getX();
    mStartY = (int) child.getY();
    mStartWidth = child.getWidth();
    mStartHeight = child.getHeight();
    mStartAlpha = child.getAlpha();
    mStartRotateX = child.getRotationX();
    mStartRotateY = child.getRotationY();

    // only set the start background color when the background is color drawable
    Drawable background = child.getBackground();
    if (background instanceof ColorDrawable) {
        mStartBackgroundColor = ((ColorDrawable) background).getColor();
    }

    // if parent fitsSystemWindows is true, add status bar height to target y if specified
    if (Build.VERSION.SDK_INT > 16 && parent.getFitsSystemWindows() && targetY != UNSPECIFIED_INT) {
        int result = 0;
        Resources resources = parent.getContext().getResources();
        int resourceId = resources.getIdentifier("status_bar_height", "dimen", "android");
        if (resourceId > 0) {
            result = resources.getDimensionPixelSize(resourceId);
        }
        targetY += result;
    }
}
 
源代码6 项目: Flubber   文件: FlipY.java
@Override
public Animator getAnimationFor(AnimationBody animationBody, View view) {

    final float startRotation = view.getRotationY();
    final float endRotation = startRotation + 180f;

    final PropertyValuesHolder rotationPVH =
            PropertyValuesHolder.ofFloat(View.ROTATION_Y, startRotation, endRotation);

    final ObjectAnimator animation =
            ObjectAnimator.ofPropertyValuesHolder(view, rotationPVH);

    return animation;
}
 
源代码7 项目: ChromeLikeTabSwitcher   文件: PhoneArithmetics.java
@Override
public final float getRotation(@NonNull final Axis axis, @NonNull final AbstractItem item) {
    Condition.INSTANCE.ensureNotNull(axis, "The axis may not be null");
    Condition.INSTANCE.ensureNotNull(item, "The view may not be null");
    View view = item.getView();

    if (getOrientationInvariantAxis(axis) == Axis.DRAGGING_AXIS) {
        return view.getRotationY();
    } else {
        return view.getRotationX();
    }
}
 
源代码8 项目: morphos   文件: ViewDefault.java
public void updateView(View v) {
    if (v != null) {
        this.alpha = v.getAlpha();
        this.x = v.getX();
        this.y = v.getY();
        this.z = atLeastLollipop ? v.getZ() : 0;
        this.width = v.getWidth();
        this.height = v.getHeight();
        this.expansionScaleX = v.getScaleX();
        this.expansionScaleY = v.getScaleY();
        this.dispositionAngle = v.getRotation();
        this.dispositionAngleX = v.getRotationX();
        this.dispositionAngleY = v.getRotationY();
    }
}
 
源代码9 项目: okhttp-OkGo   文件: SimpleViewBehavior.java
/** 初始化数据 */
private void prepare(CoordinatorLayout parent, View child, View dependency) {
    mDependStartX = (int) dependency.getX();
    mDependStartY = (int) dependency.getY();
    mDependStartWidth = dependency.getWidth();
    mDependStartHeight = dependency.getHeight();
    mStartX = (int) child.getX();
    mStartY = (int) child.getY();
    mStartWidth = child.getWidth();
    mStartHeight = child.getHeight();
    mStartAlpha = child.getAlpha();
    mStartRotateX = child.getRotationX();
    mStartRotateY = child.getRotationY();

    //特殊处理y方向变化
    if (mDependTargetY == UNSPECIFIED_INT && dependency instanceof AppBarLayout) {
        mDependTargetY = ((AppBarLayout) dependency).getTotalScrollRange();
    }
    // 背景颜色渐变
    if (child.getBackground() instanceof ColorDrawable) mStartBackgroundColor = ((ColorDrawable) child.getBackground()).getColor();
    // 自定义动画
    if (mAnimationId != 0) {
        mAnimation = AnimationUtils.loadAnimation(child.getContext(), mAnimationId);
        mAnimation.initialize(child.getWidth(), child.getHeight(), parent.getWidth(), parent.getHeight());
    }
    // 兼容5.0以上的沉浸模式
    if (Build.VERSION.SDK_INT > 16 && parent.getFitsSystemWindows() && targetY != UNSPECIFIED_INT) {
        targetY += getStatusBarHeight(parent.getContext());
    }
    isPrepared = true;
}
 
源代码10 项目: Transitions-Everywhere   文件: ChangeTransform.java
public Transforms(View view) {
    translationX = view.getTranslationX();
    translationY = view.getTranslationY();
    translationZ = ViewUtils.getTranslationZ(view);
    scaleX = view.getScaleX();
    scaleY = view.getScaleY();
    rotationX = view.getRotationX();
    rotationY = view.getRotationY();
    rotationZ = view.getRotation();
}
 
源代码11 项目: Mover   文件: ViewPropertyAnimatorHC.java
/**
 * This method gets the value of the named property from the View object.
 *
 * @param propertyConstant The property whose value should be returned
 * @return float The value of the named property
 */
private float getValue(int propertyConstant) {
    //final View.TransformationInfo info = mView.mTransformationInfo;
    View v = mView.get();
    if (v != null) {
        switch (propertyConstant) {
            case TRANSLATION_X:
                //return info.mTranslationX;
                return v.getTranslationX();
            case TRANSLATION_Y:
                //return info.mTranslationY;
                return v.getTranslationY();
            case ROTATION:
                //return info.mRotation;
                return v.getRotation();
            case ROTATION_X:
                //return info.mRotationX;
                return v.getRotationX();
            case ROTATION_Y:
                //return info.mRotationY;
                return v.getRotationY();
            case SCALE_X:
                //return info.mScaleX;
                return v.getScaleX();
            case SCALE_Y:
                //return info.mScaleY;
                return v.getScaleY();
            case X:
                //return v.mLeft + info.mTranslationX;
                return v.getX();
            case Y:
                //return v.mTop + info.mTranslationY;
                return v.getY();
            case ALPHA:
                //return info.mAlpha;
                return v.getAlpha();
        }
    }
    return 0;
}
 
源代码12 项目: adt-leanback-support   文件: ViewCompatHC.java
public static float getRotationY(View view) {
    return view.getRotationY();
}
 
源代码13 项目: KJFrameForAndroid   文件: ViewHelper.java
static float getRotationY(View view) {
    return view.getRotationY();
}
 
源代码14 项目: timecat   文件: ViewHelper.java
static float getRotationY(View view) {
    return view.getRotationY();
}
 
源代码15 项目: litho   文件: MountState.java
private static void unsetRotationY(View view, NodeInfo nodeInfo) {
  if (nodeInfo.isRotationYSet() && view.getRotationY() != 0) {
    view.setRotationY(0);
  }
}
 
源代码16 项目: letv   文件: ViewCompatHC.java
public static float getRotationY(View view) {
    return view.getRotationY();
}
 
源代码17 项目: CircularReveal   文件: DynamicAnimation.java
@Override
public float getValue(View view) {
  return view.getRotationY();
}
 
源代码18 项目: android-project-wo2b   文件: ViewHelper.java
static float getRotationY(View view) {
    return view.getRotationY();
}
 
源代码19 项目: MiBandDecompiled   文件: a.java
static float f(View view)
{
    return view.getRotationY();
}
 
源代码20 项目: Mover   文件: ViewHelper.java
static float getRotationY(View view) {
    return view.getRotationY();
}
 
 方法所在类
 同类方法