Java Code Examples for android.view.View.getRotationY()

The following are Jave code examples for showing how to use getRotationY() of the android.view.View class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: GitHub   File: SimpleViewBehavior.java   Source Code and License Vote up 6 votes
/** 初始化数据 */
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;
}
 
Example 2
Project: airgram   File: ViewProxy.java   Source Code and License Vote up 6 votes
public static float getRotationY(View view) {
    if (View10.NEED_PROXY) {
        return View10.wrap(view).getRotationY();
    } else {
        return view.getRotationY();
    }
}
 
Example 3
Project: exciting-app   File: ViewPropertyAnimatorHC.java   Source Code and License Vote up 6 votes
/**
 * 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;
}
 
Example 4
Project: ChromeLikeTabSwitcher   File: PhoneArithmetics.java   Source Code and License Vote up 6 votes
@Override
public final float getRotation(@NonNull final Axis axis, @NonNull final AbstractItem item) {
    ensureNotNull(axis, "The axis may not be null");
    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();
    }
}
 
Example 5
Project: PlusGram   File: ViewProxy.java   Source Code and License Vote up 6 votes
public static float getRotationY(View view) {
    if (View10.NEED_PROXY) {
        return View10.wrap(view).getRotationY();
    } else {
        return view.getRotationY();
    }
}
 
Example 6
Project: boohee_v5.6   File: ViewPropertyAnimatorHC.java   Source Code and License Vote up 6 votes
private float getValue(int propertyConstant) {
    View v = (View) this.mView.get();
    if (v != null) {
        switch (propertyConstant) {
            case 1:
                return v.getTranslationX();
            case 2:
                return v.getTranslationY();
            case 4:
                return v.getScaleX();
            case 8:
                return v.getScaleY();
            case 16:
                return v.getRotation();
            case 32:
                return v.getRotationX();
            case 64:
                return v.getRotationY();
            case 128:
                return v.getX();
            case 256:
                return v.getY();
            case 512:
                return v.getAlpha();
        }
    }
    return 0.0f;
}
 
Example 7
Project: android-project-gallery   File: ViewPropertyAnimatorHC.java   Source Code and License Vote up 6 votes
/**
 * 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;
}
 
Example 8
Project: morphos   File: ViewDefault.java   Source Code and License Vote up 6 votes
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();
    }
}
 
Example 9
Project: NeoTerm   File: PhoneArithmetics.java   Source Code and License Vote up 6 votes
@Override
public final float getRotation(@NonNull final Axis axis, @NonNull final View view) {
    ensureNotNull(axis, "The axis may not be null");
    ensureNotNull(view, "The view may not be null");

    if (getOrientationInvariantAxis(axis) == Axis.DRAGGING_AXIS) {
        return view.getRotationY();
    } else {
        return view.getRotationX();
    }
}
 
Example 10
Project: LuaViewPlayground   File: ViewHelper.java   Source Code and License Vote up 5 votes
static float getRotationY(View view) {
    return view.getRotationY();
}
 
Example 11
Project: letv   File: ViewCompatHC.java   Source Code and License Vote up 5 votes
public static float getRotationY(View view) {
    return view.getRotationY();
}
 
Example 12
Project: exciting-app   File: ViewHelper.java   Source Code and License Vote up 5 votes
static float getRotationY(View view) {
    return view.getRotationY();
}
 
Example 13
Project: Flubber   File: FlipY.java   Source Code and License Vote up 5 votes
@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;
}
 
Example 14
Project: AndroidAnimationTools   File: ViewAnimatorBuilder.java   Source Code and License Vote up 5 votes
@Override
public Float get(View target) {
    return target.getRotationY();
}
 
Example 15
Project: boohee_v5.6   File: ViewHelper.java   Source Code and License Vote up 5 votes
static float getRotationY(View view) {
    return view.getRotationY();
}
 
Example 16
Project: boohee_v5.6   File: ViewCompatHC.java   Source Code and License Vote up 5 votes
public static float getRotationY(View view) {
    return view.getRotationY();
}
 
Example 17
Project: android-project-gallery   File: ViewHelper.java   Source Code and License Vote up 5 votes
static float getRotationY(View view) {
    return view.getRotationY();
}