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

The following are Jave code examples for showing how to use setRotationY() 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: AndroidViewPagerRxJava   File: ABaseTransformer.java   Source Code and License Vote up 7 votes
/**
 * 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);
	}
}
 
Example 2
Project: GitHub   File: GallyPageTransformer.java   Source Code and License Vote up 7 votes
@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);
    }
}
 
Example 3
Project: boohee_v5.6   File: TabletTransformer.java   Source Code and License Vote up 6 votes
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);
}
 
Example 4
Project: PageTransformerHelp   File: FlipHorizontalTransformer.java   Source Code and License Vote up 6 votes
@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);
}
 
Example 5
Project: Hillffair17   File: RotateDownPageTransformer.java   Source Code and License Vote up 6 votes
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);
}
 
Example 6
Project: GeekZone   File: TabletTransformer.java   Source Code and License Vote up 6 votes
@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);
}
 
Example 7
Project: GitHub   File: TabletTransformer.java   Source Code and License Vote up 6 votes
@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);
}
 
Example 8
Project: PageTransformerHelp   File: TabletTransformer.java   Source Code and License Vote up 6 votes
@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);
}
 
Example 9
Project: RNLearn_Project1   File: BaseViewManager.java   Source Code and License Vote up 6 votes
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);
}
 
Example 10
Project: GeekZone   File: CubeInTransformer.java   Source Code and License Vote up 6 votes
@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);
}
 
Example 11
Project: AndroidViewPagerRxJava   File: FlipHorizontalTransformer.java   Source Code and License Vote up 6 votes
@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);
}
 
Example 12
Project: GitHub   File: FlyRefreshStyleActivity.java   Source Code and License Vote up 6 votes
@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);
}
 
Example 13
Project: GitHub   File: CubeInTransformer.java   Source Code and License Vote up 6 votes
@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);
}
 
Example 14
Project: Mybilibili   File: CubeInTransformer.java   Source Code and License Vote up 6 votes
@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);
}
 
Example 15
Project: Mybilibili   File: FlipHorizontalTransformer.java   Source Code and License Vote up 6 votes
@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);
}
 
Example 16
Project: AndroidBasicLibs   File: TabletTransformer.java   Source Code and License Vote up 6 votes
@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);
}
 
Example 17
Project: AndroidViewPagerRxJava   File: CubeInTransformer.java   Source Code and License Vote up 6 votes
@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);
}
 
Example 18
Project: Flubber   File: FlubberUtil.java   Source Code and License Vote up 6 votes
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);
}
 
Example 19
Project: android-project-gallery   File: ViewHelper.java   Source Code and License Vote up 5 votes
static void setRotationY(View view, float rotationY) {
    view.setRotationY(rotationY);
}
 
Example 20
Project: exciting-app   File: ViewHelper.java   Source Code and License Vote up 4 votes
static void setRotationY(View view, float rotationY) {
    view.setRotationY(rotationY);
}