@Override public void shouldRotateControls(int degrees) { ViewCompat.setRotation(cameraSwitchView, degrees); ViewCompat.setRotation(mediaActionSwitchView, degrees); ViewCompat.setRotation(flashSwitchView, degrees); ViewCompat.setRotation(recordDurationText, degrees); ViewCompat.setRotation(recordSizeText, degrees); }
public static void resetPageTransformer(List<? extends View> views) { if (views == null) { return; } for (View view : views) { view.setVisibility(View.VISIBLE); ViewCompat.setAlpha(view, 1); ViewCompat.setPivotX(view, view.getMeasuredWidth() * 0.5f); ViewCompat.setPivotY(view, view.getMeasuredHeight() * 0.5f); ViewCompat.setTranslationX(view, 0); ViewCompat.setTranslationY(view, 0); ViewCompat.setScaleX(view, 1); ViewCompat.setScaleY(view, 1); ViewCompat.setRotationX(view, 0); ViewCompat.setRotationY(view, 0); ViewCompat.setRotation(view, 0); } }
public static void clear(View v) { ViewCompat.setAlpha(v, 1); ViewCompat.setScaleY(v, 1); ViewCompat.setScaleX(v, 1); ViewCompat.setTranslationY(v, 0); ViewCompat.setTranslationX(v, 0); ViewCompat.setRotation(v, 0); ViewCompat.setRotationY(v, 0); ViewCompat.setRotationX(v, 0); ViewCompat.setPivotY(v, v.getMeasuredHeight() / 2); ViewCompat.setPivotX(v, v.getMeasuredWidth() / 2); ViewCompat.animate(v).setInterpolator(null); } }
@Override public void shouldRotateControls(int degrees) { ViewCompat.setRotation(cameraSwitchView, degrees); ViewCompat.setRotation(mediaActionSwitchView, degrees); ViewCompat.setRotation(flashSwitchView, degrees); }
public static void clear(View v) { ViewCompat.setAlpha(v, 1); ViewCompat.setScaleY(v, 1); ViewCompat.setScaleX(v, 1); ViewCompat.setTranslationY(v, 0); ViewCompat.setTranslationX(v, 0); ViewCompat.setRotation(v, 0); ViewCompat.setRotationY(v, 0); ViewCompat.setRotationX(v, 0); v.setPivotY(v.getMeasuredHeight() / 2); ViewCompat.setPivotX(v, v.getMeasuredWidth() / 2); ViewCompat.animate(v).setInterpolator(null); } }
@Override public void handleInvisiblePage(View view, float position) { ViewCompat.setPivotX(view, view.getMeasuredWidth() * 0.5f); ViewCompat.setPivotY(view, view.getMeasuredHeight()); ViewCompat.setRotation(view, 0); }
public static void clear(View v) { ViewCompat.setAlpha(v, 1); ViewCompat.setScaleY(v, 1); ViewCompat.setScaleX(v, 1); ViewCompat.setTranslationY(v, 0); ViewCompat.setTranslationX(v, 0); ViewCompat.setRotation(v, 0); ViewCompat.setRotationY(v, 0); ViewCompat.setRotationX(v, 0); ViewCompat.setPivotY(v, v.getMeasuredHeight() / 2); ViewCompat.setPivotX(v, v.getMeasuredWidth() / 2); ViewCompat.animate(v).setInterpolator(null); } }
@Override public void handleLeftPage(View view, float position) { float rotation = (mMaxRotation * position); ViewCompat.setPivotX(view, view.getMeasuredWidth() * 0.5f); ViewCompat.setPivotY(view, view.getMeasuredHeight()); ViewCompat.setRotation(view, rotation); }
public static void clear(View v) { ViewCompat.setAlpha(v, 1); ViewCompat.setScaleY(v, 1); ViewCompat.setScaleX(v, 1); ViewCompat.setTranslationY(v, 0); ViewCompat.setTranslationX(v, 0); ViewCompat.setRotation(v, 0); ViewCompat.setRotationY(v, 0); ViewCompat.setRotationX(v, 0); ViewCompat.setPivotY(v, v.getMeasuredHeight() / 2); ViewCompat.setPivotX(v, v.getMeasuredWidth() / 2); ViewCompat.animate(v).setInterpolator(null).setStartDelay(0); } }
@Override public void shouldRotateControls(int degrees) { ViewCompat.setRotation(mCameraSwitchView, degrees); ViewCompat.setRotation(mFlashSwitchView, degrees); ViewCompat.setRotation(mRecordDurationText, degrees); ViewCompat.setRotation(mRecordSizeText, degrees); }
public static void clear(View v) { ViewCompat.setAlpha(v, 1); ViewCompat.setScaleY(v, 1); ViewCompat.setScaleX(v, 1); ViewCompat.setTranslationY(v, 0); ViewCompat.setTranslationX(v, 0); ViewCompat.setRotation(v, 0); ViewCompat.setRotationY(v, 0); ViewCompat.setRotationX(v, 0); ViewCompat.setPivotY(v, v.getMeasuredHeight() / 2); ViewCompat.setPivotX(v, v.getMeasuredWidth() / 2); ViewCompat.animate(v).setInterpolator(null).setStartDelay(0); } }
public void rotateByValue(float rotateOffset, boolean reverse) { if (reverse) rotateOffset = 360f - rotateOffset; ViewCompat.setRotation(this, rotateOffset); }
public static void clear(View v) { ViewCompat.setAlpha(v, 1); ViewCompat.setScaleY(v, 1); ViewCompat.setScaleX(v, 1); ViewCompat.setTranslationY(v, 0); ViewCompat.setTranslationX(v, 0); ViewCompat.setRotation(v, 0); ViewCompat.setRotationY(v, 0); ViewCompat.setRotationX(v, 0); ViewCompat.setPivotY(v, v.getMeasuredHeight() / 2); ViewCompat.setPivotX(v, v.getMeasuredWidth() / 2); ViewCompat.animate(v).setInterpolator(null).setStartDelay(0); } }
@Override public void onAnimationEnd(Animation animation) { ViewCompat.setRotation(indicator, !open ? 0f : 90f); }
public void update(float percentX, float percentY) { if (rotationEnabled) { ViewCompat.setRotation(this, percentX * rotationValue); } if (dragListener != null) { dragListener.onDrag(this, percentX, percentY); } if (viewAnimator != null) { viewAnimator.update(this, percentX, percentY); } oldPercentX = percentX; oldPercentY = percentY; }
@Override public void applyToView(View v, RecyclerView parent) { float halfHeight = v.getHeight() * 0.5f; float parentHalfHeight = parent.getHeight() * 0.5f; float y = v.getY(); float rot = parentHalfHeight - halfHeight - y; ViewCompat.setPivotX(v, v.getWidth()); ViewCompat.setPivotY(v, halfHeight); ViewCompat.setRotation(v, -1 * rot * 0.05f); ViewCompat.setTranslationX(v, -1 * (float) (-Math.cos(rot * mTranslationRatio * mDegToRad) + 1) * mCircleOffset); float scale = 1.0f - Math.abs(parentHalfHeight - halfHeight - y) * mScalingRatio; ViewCompat.setScaleX(v, scale); ViewCompat.setScaleY(v, scale); } }
@Override public void applyToView(View v, RecyclerView parent) { float halfHeight = v.getHeight() * 0.5f; float parentHalfHeight = parent.getHeight() * 0.5f; float y = v.getY(); float rot = parentHalfHeight - halfHeight - y; ViewCompat.setPivotX(v, 0.0f); ViewCompat.setPivotY(v, halfHeight); ViewCompat.setRotation(v, rot * 0.05f); ViewCompat.setTranslationX(v, (float)(-Math.cos(rot * mTranslationRatio * mDegToRad) + 1) * mCircleOffset); float scale = 1.0f - Math.abs(parentHalfHeight - halfHeight - y) * mScalingRatio; ViewCompat.setScaleX(v, scale); ViewCompat.setScaleY(v, scale); } }
@Override public void applyToView(View v, RecyclerView parent) { float halfWidth = v.getWidth() * 0.5f; float parentHalfWidth = parent.getWidth() * 0.5f; float x = v.getX(); float rot = parentHalfWidth - halfWidth - x; ViewCompat.setPivotY(v, 0.0f); ViewCompat.setPivotX(v, halfWidth); ViewCompat.setRotation(v, -rot * 0.05f); ViewCompat.setTranslationY(v, (float) (-Math.cos(rot * mTranslationRatio * mDegToRad) + 1) * mCircleOffset); float scale = 1.0f - Math.abs(parentHalfWidth - halfWidth - x) * mScalingRatio; ViewCompat.setScaleX(v, scale); ViewCompat.setScaleY(v, scale); } }
@Override public void applyToView(View v, RecyclerView parent) { float halfWidth = v.getWidth() * 0.5f; float parentHalfWidth = parent.getWidth() * 0.5f; float x = v.getX(); float rot = parentHalfWidth - halfWidth - x; if (mUseRotation) { ViewCompat.setPivotY(v, 0.0f); ViewCompat.setPivotX(v, halfWidth); ViewCompat.setRotation(v, -rot * 0.05f); } ViewCompat.setTranslationY(v, - 1 * (float) (-Math.cos(rot * mTranslationRatio * mDegToRad) + 1) * mCircleOffset + mYOffset); float scale = 1.0f - Math.abs(parentHalfWidth - halfWidth - x) * mScalingRatio; ViewCompat.setScaleX(v, scale); ViewCompat.setScaleY(v, scale); } }
@Override public void onScrollChange(NestedScrollView v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) { if (oldScrollY - scrollY > 0) ((FloatingActionButton) findViewById(R.id.fab)).show(); else if (oldScrollY - scrollY < 0) { if (isFABMenuOpen) collapseFABMenu(); ((FloatingActionButton) findViewById(R.id.fab)).hide(); ViewCompat.setRotation(fabMenu, 0.0F); } } });