本文整理了Java中android.view.View.getRotationY()
方法的一些代码示例,展示了View.getRotationY()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。View.getRotationY()
方法的具体详情如下:
包路径:android.view.View
类名称:View
方法名:getRotationY
View.getRotationY介绍
暂无
代码示例
代码示例来源:origin: commonsguy/cw-omnibus
static float getRotationY(View view) {
return view.getRotationY();
}
代码示例来源:origin: square/assertj-android
@TargetApi(HONEYCOMB)
public S hasRotationY(float rotation) {
isNotNull();
float actualRotation = actual.getRotationY();
assertThat(actualRotation) //
.overridingErrorMessage("Expected y rotation <%s> but was <%s>", rotation,
actualRotation) //
.isEqualTo(rotation);
return myself;
}
代码示例来源:origin: nanchen2251/RxJava2Examples
/** 初始化数据 */
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;
}
代码示例来源:origin: robolectric/robolectric
@Test
public void rotationY() {
view.setRotationY(20f);
assertThat(view.getRotationY()).isEqualTo(20f);
}
代码示例来源:origin: commonsguy/cw-omnibus
case ROTATION_Y:
return v.getRotationY();
case SCALE_X:
代码示例来源:origin: andkulikov/Transitions-Everywhere
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();
}
代码示例来源:origin: com.nineoldandroids/library
static float getRotationY(View view) {
return view.getRotationY();
}
代码示例来源:origin: michael-rapp/ChromeLikeTabSwitcher
@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();
}
}
代码示例来源:origin: com.nineoldandroids/library
case ROTATION_Y:
return v.getRotationY();
case SCALE_X:
代码示例来源:origin: qq8585083/DragIcon
@Override
public float getRotationY(View view) {
return view.getRotationY();
}
代码示例来源:origin: Android500/AwesomeDrawer
static float getRotationY(View view) {
return view.getRotationY();
}
代码示例来源:origin: leeowenowen/beauty-of-math
static float getRotationY(View view) {
return view.getRotationY();
}
代码示例来源:origin: kingargyle/adt-leanback-support
public static float getRotationY(View view) {
return view.getRotationY();
}
代码示例来源:origin: leveychen/RxBanner
@Override
protected float setViewElevation(View itemView, float targetOffset) {
final float ele = Math.max(Math.abs(itemView.getRotationX()), Math.abs(itemView.getRotationY())) * MAX_ELEVATION / 360;
return MAX_ELEVATION - ele;
}
代码示例来源:origin: yayaa/Rotatable
private void updateRotationValues(boolean notifyListener) {
currentXRotation = rootView.getRotationX();
currentYRotation = rootView.getRotationY();
if (notifyListener) {
notifyListenerRotationChanged();
}
}
代码示例来源:origin: com.squareup.assertj/assertj-android
@TargetApi(HONEYCOMB)
public S hasRotationY(float rotation) {
isNotNull();
float actualRotation = actual.getRotationY();
assertThat(actualRotation) //
.overridingErrorMessage("Expected y rotation <%s> but was <%s>", rotation,
actualRotation) //
.isEqualTo(rotation);
return myself;
}
代码示例来源:origin: Appolica/Flubber
@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;
}
}
代码示例来源:origin: yayaa/Rotatable
private void fitRotation() {
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.setDuration(FIT_ANIM_TIME);
animatorSet.setInterpolator(new FastOutSlowInInterpolator());
ArrayList animators = new ArrayList<>();
if (shouldRotateY()) {
animators.add(ObjectAnimator.ofFloat(rootView, View.ROTATION_Y, getRequiredRotation(rootView.getRotationY())));
}
if (shouldRotateX()) {
animators.add(ObjectAnimator.ofFloat(rootView, View.ROTATION_X, getRequiredRotation(rootView.getRotationX())));
}
animatorSet.playTogether(animators);
animatorSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
updateRotationValues(true);
}
});
animatorSet.start();
// Reset max values to calculate again on touch down
maxDistanceX = NULL_INT;
maxDistanceY = NULL_INT;
}
代码示例来源:origin: yayaa/Rotatable
/**
* Rotates once around in given direction
*/
public void rotateOnce() {
float toDegree;
if (rotation == ROTATE_X) {
toDegree = rootView.getRotationX();
} else if (rotation == ROTATE_Y) {
toDegree = rootView.getRotationY();
} else {
toDegree = rootView.getRotation();
}
toDegree += 180;
rotate(rotation, toDegree);
}
代码示例来源:origin: yayaa/Rotatable
private void handleRotation() {
if (shouldRotateX()) {
float newXRotation = (rootView.getRotationX() + (oldY - currentY)) % 360;
rootView.setRotationX(newXRotation);
currentXRotation = newXRotation;
oldY = currentY;
}
if (shouldRotateY()) {
float newYRotation;
if (isInFrontArea(currentXRotation)) {
newYRotation = (rootView.getRotationY() + (currentX - oldX)) % 360;
} else {
newYRotation = (rootView.getRotationY() - (currentX - oldX)) % 360;
}
rootView.setRotationY(newYRotation);
currentYRotation = newYRotation;
oldX = currentX;
}
}