热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

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

本文整理了Java中android.view.View.getRotationY()方法的一些代码示例,展示了View.getRotationY()

本文整理了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;
}
}

推荐阅读
  • Android 渐变圆环加载控件实现
    本文介绍了如何在 Android 中创建一个自定义的渐变圆环加载控件,该控件已在多个知名应用中使用。我们将详细探讨其工作原理和实现方法。 ... [详细]
  • 深入解析Android自定义View面试题
    本文探讨了Android Launcher开发中自定义View的重要性,并通过一道经典的面试题,帮助开发者更好地理解自定义View的实现细节。文章不仅涵盖了基础知识,还提供了实际操作建议。 ... [详细]
  • 优化ListView性能
    本文深入探讨了如何通过多种技术手段优化ListView的性能,包括视图复用、ViewHolder模式、分批加载数据、图片优化及内存管理等。这些方法能够显著提升应用的响应速度和用户体验。 ... [详细]
  • Explore how Matterverse is redefining the metaverse experience, creating immersive and meaningful virtual environments that foster genuine connections and economic opportunities. ... [详细]
  • 1:有如下一段程序:packagea.b.c;publicclassTest{privatestaticinti0;publicintgetNext(){return ... [详细]
  • Android LED 数字字体的应用与实现
    本文介绍了一种适用于 Android 应用的 LED 数字字体(digital font),并详细描述了其在 UI 设计中的应用场景及其实现方法。这种字体常用于视频、广告倒计时等场景,能够增强视觉效果。 ... [详细]
  • 本文介绍如何在 Android 中通过代码模拟用户的点击和滑动操作,包括参数说明、事件生成及处理逻辑。详细解析了视图(View)对象、坐标偏移量以及不同类型的滑动方式。 ... [详细]
  • Explore a common issue encountered when implementing an OAuth 1.0a API, specifically the inability to encode null objects and how to resolve it. ... [详细]
  • 本文介绍了Java并发库中的阻塞队列(BlockingQueue)及其典型应用场景。通过具体实例,展示了如何利用LinkedBlockingQueue实现线程间高效、安全的数据传递,并结合线程池和原子类优化性能。 ... [详细]
  • 主要用了2个类来实现的,话不多说,直接看运行结果,然后在奉上源代码1.Index.javaimportjava.awt.Color;im ... [详细]
  • c# – UWP:BrightnessOverride StartOverride逻辑 ... [详细]
  • Android 九宫格布局详解及实现:人人网应用示例
    本文深入探讨了人人网Android应用中独特的九宫格布局设计,解析其背后的GridView实现原理,并提供详细的代码示例。这种布局方式不仅美观大方,而且在现代Android应用中较为少见,值得开发者借鉴。 ... [详细]
  • 本文详细介绍了Java中org.neo4j.helpers.collection.Iterators.single()方法的功能、使用场景及代码示例,帮助开发者更好地理解和应用该方法。 ... [详细]
  • 本文详细介绍了 GWT 中 PopupPanel 类的 onKeyDownPreview 方法,提供了多个代码示例及应用场景,帮助开发者更好地理解和使用该方法。 ... [详细]
  • Java 类成员初始化顺序与数组创建
    本文探讨了Java中类成员的初始化顺序、静态引入、可变参数以及finalize方法的应用。通过具体的代码示例,详细解释了这些概念及其在实际编程中的使用。 ... [详细]
author-avatar
稚气忖托气质_844
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有