当前位置: 首页>>代码示例>>Java>>正文


Java View.setRotationY方法代码示例

本文整理汇总了Java中android.view.View.setRotationY方法的典型用法代码示例。如果您正苦于以下问题:Java View.setRotationY方法的具体用法?Java View.setRotationY怎么用?Java View.setRotationY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.View的用法示例。


在下文中一共展示了View.setRotationY方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onPreTransform

import android.view.View; //导入方法依赖的package包/类
/**
 * Called each {@link #transformPage(View, float)} before {{@link #onTransform(View, float)}.
 * <p>
 * The default implementation attempts to reset all view properties. This is useful when toggling transforms that do
 * not modify the same page properties. For instance changing from a transformation that applies rotation to a
 * transformation that fades can inadvertently leave a fragment stuck with a rotation or with some degree of applied
 * alpha.
 *
 * @param page
 *            Apply the transformation to this page
 * @param position
 *            Position of page relative to the current front-and-center position of the pager. 0 is front and
 *            center. 1 is one full page position to the right, and -1 is one page position to the left.
 */
protected void onPreTransform(View page, float position) {
	final float width = page.getWidth();

	page.setRotationX(0);
	page.setRotationY(0);
	page.setRotation(0);
	page.setScaleX(1);
	page.setScaleY(1);
	page.setPivotX(0);
	page.setPivotY(0);
	page.setTranslationY(0);
	page.setTranslationX(isPagingEnabled() ? 0f : -width * position);

	if (hideOffscreenPages()) {
		page.setAlpha(position <= -1f || position >= 1f ? 0f : 1f);
		page.setEnabled(false);
	} else {
		page.setEnabled(true);
		page.setAlpha(1f);
	}
}
 
开发者ID:aomari,项目名称:AndroidViewPagerRxJava,代码行数:36,代码来源:ABaseTransformer.java

示例2: transformPage

import android.view.View; //导入方法依赖的package包/类
@Override
public void transformPage(View page, float position) {
    float scaleFactor = Math.max(min_scale, 1 - Math.abs(position));
    float rotate = 20 * Math.abs(position);
    if (position < -1) {

    } else if (position < 0) {
        page.setScaleX(scaleFactor);
        page.setScaleY(scaleFactor);
        page.setRotationY(rotate);
    } else if (position >= 0 && position < 1) {
        page.setScaleX(scaleFactor);
        page.setScaleY(scaleFactor);
        page.setRotationY(-rotate);
    } else if (position >= 1) {
        page.setScaleX(scaleFactor);
        page.setScaleY(scaleFactor);
        page.setRotationY(-rotate);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:GallyPageTransformer.java

示例3: onTransform

import android.view.View; //导入方法依赖的package包/类
protected void onTransform(View view, float position) {
    float rotation = (position < 0.0f ? 30.0f : -30.0f) * Math.abs(position);
    view.setTranslationX(getOffsetXForRotation(rotation, view.getWidth(), view.getHeight()));
    view.setPivotX(((float) view.getWidth()) * 0.5f);
    view.setPivotY(0.0f);
    view.setRotationY(rotation);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:8,代码来源:TabletTransformer.java

示例4: onTransform

import android.view.View; //导入方法依赖的package包/类
@Override
protected void onTransform(View view, float position) {
    final float rotation = 180f * position;

    view.setAlpha(rotation > 90f || rotation < -90f ? 0 : 1);
    view.setPivotX(view.getWidth() * 0.5f);
    view.setPivotY(view.getHeight() * 0.5f);
    view.setRotationY(rotation);
}
 
开发者ID:OCNYang,项目名称:PageTransformerHelp,代码行数:10,代码来源:FlipHorizontalTransformer.java

示例5: onPreTransform

import android.view.View; //导入方法依赖的package包/类
private void onPreTransform(View view, float position) {
final float width = view.getWidth();
view.setRotationX(0);
view.setRotationY(0);
view.setRotation(0);
view.setScaleX(1);
view.setScaleY(1);
view.setPivotX(0);
view.setPivotY(0);
view.setTranslationY(0);
view.setTranslationX(0f);
view.setAlpha(position <= -1f || position >= 1f ? 0f : 1f);
}
 
开发者ID:appteam-nith,项目名称:Hillffair17,代码行数:14,代码来源:RotateDownPageTransformer.java

示例6: onTransform

import android.view.View; //导入方法依赖的package包/类
@Override
protected void onTransform(View view, float position) {
	final float rotation = (position < 0 ? 30f : -30f) * Math.abs(position);

	view.setTranslationX(getOffsetXForRotation(rotation, view.getWidth(), view.getHeight()));
	view.setPivotX(view.getWidth() * 0.5f);
	view.setPivotY(0);
	view.setRotationY(rotation);
}
 
开发者ID:HanyeeWang,项目名称:GeekZone,代码行数:10,代码来源:TabletTransformer.java

示例7: resetTransformProperty

import android.view.View; //导入方法依赖的package包/类
private static void resetTransformProperty(View view) {
  view.setTranslationX(PixelUtil.toPixelFromDIP(0));
  view.setTranslationY(PixelUtil.toPixelFromDIP(0));
  view.setRotation(0);
  view.setRotationX(0);
  view.setRotationY(0);
  view.setScaleX(1);
  view.setScaleY(1);
  view.setCameraDistance(0);
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:11,代码来源:BaseViewManager.java

示例8: onTransform

import android.view.View; //导入方法依赖的package包/类
@Override
protected void onTransform(View view, float position) {
	// Rotate the fragment on the left or right edge
	view.setPivotX(position > 0 ? 0 : view.getWidth());
	view.setPivotY(0);
	view.setRotationY(-90f * position);
}
 
开发者ID:HanyeeWang,项目名称:GeekZone,代码行数:8,代码来源:CubeInTransformer.java

示例9: preAnimateAddImpl

import android.view.View; //导入方法依赖的package包/类
@Override
protected void preAnimateAddImpl(RecyclerView.ViewHolder holder) {
    View icon = holder.itemView.findViewById(R.id.icon);
    icon.setRotationX(30);
    View right = holder.itemView.findViewById(R.id.right);
    right.setPivotX(0);
    right.setPivotY(0);
    right.setRotationY(90);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:FlyRefreshStyleActivity.java

示例10: onTransform

import android.view.View; //导入方法依赖的package包/类
@Override
protected void onTransform(View view, float position) {
	final float rotation = 180f * position;

	view.setAlpha(rotation > 90f || rotation < -90f ? 0 : 1);
	view.setPivotX(view.getWidth() * 0.5f);
	view.setPivotY(view.getHeight() * 0.5f);
	view.setRotationY(rotation);
}
 
开发者ID:AndroidBoySC,项目名称:Mybilibili,代码行数:10,代码来源:FlipHorizontalTransformer.java

示例11: onTransform

import android.view.View; //导入方法依赖的package包/类
@Override
protected void onTransform(View view, float position) {
    // Rotate the fragment on the left or right edge
    view.setPivotX(position > 0 ? 0 : view.getWidth());
    view.setPivotY(0);
    view.setRotationY(-90f * position);
}
 
开发者ID:aomari,项目名称:AndroidViewPagerRxJava,代码行数:8,代码来源:CubeInTransformer.java

示例12: clearAnimation

import android.view.View; //导入方法依赖的package包/类
public static void clearAnimation(View view) {
    view.setAlpha(1);
    view.setScaleX(1);
    view.setScaleY(1);
    view.setTranslationX(0);
    view.setTranslationY(0);
    view.setRotation(0);
    view.setRotationX(0);
    view.setRotationY(0);
}
 
开发者ID:Appolica,项目名称:Flubber,代码行数:11,代码来源:FlubberUtil.java

示例13: setRotationY

import android.view.View; //导入方法依赖的package包/类
static void setRotationY(View view, float rotationY) {
    view.setRotationY(rotationY);
}
 
开发者ID:benniaobuguai,项目名称:android-project-gallery,代码行数:4,代码来源:ViewHelper.java


注:本文中的android.view.View.setRotationY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。