android.view.View.getRotationX()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(371)

本文整理了Java中android.view.View.getRotationX()方法的一些代码示例,展示了View.getRotationX()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。View.getRotationX()方法的具体详情如下:
包路径:android.view.View
类名称:View
方法名:getRotationX

View.getRotationX介绍

暂无

代码示例

代码示例来源:origin: commonsguy/cw-omnibus

static float getRotationX(View view) {
  return view.getRotationX();
}

代码示例来源:origin: square/assertj-android

@TargetApi(HONEYCOMB)
public S hasRotationX(float rotation) {
 isNotNull();
 float actualRotation = actual.getRotationX();
 assertThat(actualRotation) //
   .overridingErrorMessage("Expected x rotation <%s> but was <%s>", rotation,
     actualRotation) //
   .isEqualTo(rotation);
 return myself;
}

代码示例来源:origin: scwang90/SmartRefreshLayout

ObjectAnimator rotation = ObjectAnimator.ofFloat(mFlyView, "rotation", mFlyView.getRotation(), 0);
rotation.setInterpolator(new DecelerateInterpolator());
ObjectAnimator rotationX = ObjectAnimator.ofFloat(mFlyView, "rotationX", mFlyView.getRotationX(), 50);
rotationX.setInterpolator(new DecelerateInterpolator());

代码示例来源:origin: scwang90/SmartRefreshLayout

transY1.setInterpolator(PathInterpolatorCompat.create(0.1f, 1f));
ObjectAnimator rotation1 = ObjectAnimator.ofFloat(mFlyView, "rotation", mFlyView.getRotation(), 0);
ObjectAnimator rotationX1 = ObjectAnimator.ofFloat(mFlyView, "rotationX", mFlyView.getRotationX(), 30);
rotation1.setInterpolator(new AccelerateInterpolator());
flyDownAnim.playTogether(transX1, transY1

代码示例来源: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 rotationX() {
 view.setRotationX(10f);
 assertThat(view.getRotationX()).isEqualTo(10f);
}

代码示例来源:origin: commonsguy/cw-omnibus

case ROTATION_X:
  return v.getRotationX();
case ROTATION_Y:

代码示例来源: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 getRotationX(View view) {
  return view.getRotationX();
}

代码示例来源: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_X:
  return v.getRotationX();
case ROTATION_Y:

代码示例来源:origin: leeowenowen/beauty-of-math

static float getRotationX(View view) {
 return view.getRotationX();
}

代码示例来源:origin: qq8585083/DragIcon

@Override
public float getRotationX(View view) {
  return view.getRotationX();
}

代码示例来源:origin: Android500/AwesomeDrawer

static float getRotationX(View view) {
  return view.getRotationX();
}

代码示例来源:origin: kingargyle/adt-leanback-support

public static float getRotationX(View view) {
  return view.getRotationX();
}

代码示例来源: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: Appolica/Flubber

@Override
  public Animator getAnimationFor(AnimationBody animationBody, View view) {

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

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

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

    return animation;
  }
}

代码示例来源:origin: com.squareup.assertj/assertj-android

@TargetApi(HONEYCOMB)
public S hasRotationX(float rotation) {
 isNotNull();
 float actualRotation = actual.getRotationX();
 assertThat(actualRotation) //
   .overridingErrorMessage("Expected x rotation <%s> but was <%s>", rotation,
     actualRotation) //
   .isEqualTo(rotation);
 return myself;
}

代码示例来源: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);
}

相关文章

微信公众号

最新文章

更多

View类方法