static void setRotation(View view, float rotation) { view.setRotation(rotation); }
public static void reset(View view) { view.setAlpha(1); view.setScaleX(1); view.setScaleY(1); view.setTranslationX(0); view.setTranslationY(0); view.setRotation(0); view.setRotationY(0); view.setRotationX(0); }
@Override public void reset(Object mountContent) { assertIsView(mountContent, this).setRotation(0); } }
private static void setTransforms(View view, float translationX, float translationY, float translationZ, float scaleX, float scaleY, float rotationX, float rotationY, float rotationZ) { view.setTranslationX(translationX); view.setTranslationY(translationY); ViewUtils.setTranslationZ(view, translationZ); view.setScaleX(scaleX); view.setScaleY(scaleY); view.setRotationX(rotationX); view.setRotationY(rotationY); view.setRotation(rotationZ); }
@Override public void onAnimationEnd(Animator animation) { view.setRotation(targetRotation); } }).start();
@Override public void onAnimationCancel(Animator animation) { view.setRotation(targetRotation); }
@Override public void set(Object mountContent, float value) { assertIsView(mountContent, this).setRotation(value); }
public void setRotation(float rotation) { if (mShowView != null) mShowView.getRenderView().setRotation(rotation); }
protected static void resetDraggingItemViewEffects(View view, float initialTranslationZ) { view.setTranslationX(0); view.setTranslationY(0); ViewCompat.setTranslationZ(view, initialTranslationZ); view.setAlpha(1.0f); view.setRotation(0); view.setScaleX(1.0f); view.setScaleY(1.0f); }
@Nullable @Override public Animator createAnimator(@NonNull ViewGroup sceneRoot, @Nullable TransitionValues startValues, @Nullable TransitionValues endValues) { if (startValues == null || endValues == null) { return null; } final View view = endValues.view; float startRotation = (Float) startValues.values.get(PROPNAME_ROTATION); float endRotation = (Float) endValues.values.get(PROPNAME_ROTATION); if (startRotation != endRotation) { view.setRotation(startRotation); return ObjectAnimator.ofFloat(view, View.ROTATION, startRotation, endRotation); } return null; } }
@Override public void onMoving(boolean isDragging, float percent, int offset, int height, int maxDragHeight) { if (isDragging || !mIsRefreshing) { if (offset < 0) { if (mOffset > 0) { offset = 0; percent = 0; } else { return; } } mOffset = offset; mCurrentPercent = percent; if (mSceneView != null) { mSceneView.updatePercent(percent); final View sceneView = mSceneView; sceneView.postInvalidate(); } if (mFlyView != null) { if (height + maxDragHeight > 0) { mFlyView.setRotation((-45f) * offset / (height + maxDragHeight)); } else { mFlyView.setRotation((-45f) * percent); } } } }
@Override public void setRotation(float rotation) { View targetView; if ((targetView = getTargetView()) != null){ targetView.setRotation(rotation); } }
protected void rotateSettingsDialog(int degrees) { if (settingsDialog != null && settingsDialog.isShowing() && Build.VERSION.SDK_INT > 10) { ViewGroup dialogView = (ViewGroup) settingsDialog.getWindow().getDecorView(); for (int i = 0; i < dialogView.getChildCount(); i++) { dialogView.getChildAt(i).setRotation(degrees); } } }
private static void setRotation(View view, NodeInfo nodeInfo) { if (Build.VERSION.SDK_INT >= 11) { if (nodeInfo.isRotationSet()) { view.setRotation(nodeInfo.getRotation()); } } }
private static void unsetRotation(View view, NodeInfo nodeInfo) { if (Build.VERSION.SDK_INT >= 11) { if (nodeInfo.isRotationSet() && view.getRotation() != 0) { view.setRotation(0); } } }
@Override public void onClick(View v) { TransitionManager.beginDelayedTransition(transitionsContainer, new Rotate()); mRotated = !mRotated; icon.setRotation(mRotated ? 135 : 0); }
private void showActionFab() { if (null != mFabLayout && STATE_NORMAL == mState && !mShowActionFab) { mShowActionFab = true; View fab = mFabLayout.getPrimaryFab(); fab.setVisibility(View.VISIBLE); fab.setRotation(-45.0f); fab.animate().scaleX(1.0f).scaleY(1.0f).rotation(0.0f).setListener(null) .setDuration(ANIMATE_TIME).setStartDelay(0L) .setInterpolator(AnimationUtils.FAST_SLOW_INTERPOLATOR).start(); } }
@Override public void setRotation(float rotation) { super.setRotation(rotation); invalidateParentIfNeeded(); fireOnTransformationChangedListener(); }
@Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { // super.onLayout(changed, left, top, right, bottom); int width = right - left; int height = bottom - top; int div = (height - width) / 2; top = div; left = -div; RefreshHeader header = mRefreshLayout.getRefreshHeader(); RefreshFooter footer = mRefreshLayout.getRefreshFooter(); for (int i = 0, len = mRefreshLayout.getChildCount(); i < len; i++) { View child = mRefreshLayout.getChildAt(i); if ((header == null || child != header.getView()) && (footer == null || child != footer.getView())) { if (child.getVisibility() != GONE) { child.setTag(R.string.srl_component_falsify, child); child.setRotation(90); child.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY)); child.layout(div, -div, width + div, height - div); } } } mRefreshLayout.layout(left, top, left + height, top + width); } //</editor-fold>
@Test public void rotation() { view.setRotation(30f); assertThat(view.getRotation()).isEqualTo(30f); }