Java Code Examples for android.view.View#getTranslationZ()
The following examples show how to use
android.view.View#getTranslationZ() .
These examples are extracted from open source projects.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: scene File: RenderNodeAnimatorWrapper.java License: Apache License 2.0 | 5 votes |
private float getValue(int propertyConstant) { final View node = mView; switch (propertyConstant) { case ViewPropertyAnimatorConstant.TRANSLATION_X: return node.getTranslationX(); case ViewPropertyAnimatorConstant.TRANSLATION_Y: return node.getTranslationY(); case ViewPropertyAnimatorConstant.TRANSLATION_Z: return node.getTranslationZ(); case ViewPropertyAnimatorConstant.ROTATION: return node.getRotation(); case ViewPropertyAnimatorConstant.ROTATION_X: return node.getRotationX(); case ViewPropertyAnimatorConstant.ROTATION_Y: return node.getRotationY(); case ViewPropertyAnimatorConstant.SCALE_X: return node.getScaleX(); case ViewPropertyAnimatorConstant.SCALE_Y: return node.getScaleY(); case ViewPropertyAnimatorConstant.X: return mView.getLeft() + node.getTranslationX(); case ViewPropertyAnimatorConstant.Y: return mView.getTop() + node.getTranslationY(); case ViewPropertyAnimatorConstant.Z: return node.getElevation() + node.getTranslationZ(); case ViewPropertyAnimatorConstant.ALPHA: return mView.getAlpha(); } return 0; }
Example 2
Source Project: android_9.0.0_r45 File: ChangeTransform.java License: Apache License 2.0 | 5 votes |
public Transforms(View view) { translationX = view.getTranslationX(); translationY = view.getTranslationY(); translationZ = view.getTranslationZ(); scaleX = view.getScaleX(); scaleY = view.getScaleY(); rotationX = view.getRotationX(); rotationY = view.getRotationY(); rotationZ = view.getRotation(); }
Example 3
Source Project: android_9.0.0_r45 File: ActivityTransitionCoordinator.java License: Apache License 2.0 | 5 votes |
private static SharedElementOriginalState getOldSharedElementState(View view, String name, Bundle transitionArgs) { SharedElementOriginalState state = new SharedElementOriginalState(); state.mLeft = view.getLeft(); state.mTop = view.getTop(); state.mRight = view.getRight(); state.mBottom = view.getBottom(); state.mMeasuredWidth = view.getMeasuredWidth(); state.mMeasuredHeight = view.getMeasuredHeight(); state.mTranslationZ = view.getTranslationZ(); state.mElevation = view.getElevation(); if (!(view instanceof ImageView)) { return state; } Bundle bundle = transitionArgs.getBundle(name); if (bundle == null) { return state; } int scaleTypeInt = bundle.getInt(KEY_SCALE_TYPE, -1); if (scaleTypeInt < 0) { return state; } ImageView imageView = (ImageView) view; state.mScaleType = imageView.getScaleType(); if (state.mScaleType == ImageView.ScaleType.MATRIX) { state.mMatrix = new Matrix(imageView.getImageMatrix()); } return state; }
Example 4
Source Project: CircularReveal File: DynamicAnimation.java License: MIT License | 5 votes |
@Override public float getValue(View view) { if (isZSupported()) { return view.getTranslationZ(); } else { return 0; } }
Example 5
Source Project: letv File: ViewCompatLollipop.java License: Apache License 2.0 | 4 votes |
public static float getTranslationZ(View view) { return view.getTranslationZ(); }
Example 6
Source Project: adt-leanback-support File: ViewCompatApi21.java License: Apache License 2.0 | 4 votes |
public static float getTranslationZ(View view) { return view.getTranslationZ(); }
Example 7
Source Project: Transitions-Everywhere File: ViewUtilsLollipop.java License: Apache License 2.0 | 4 votes |
@Override public float getTranslationZ(@NonNull View view) { return view.getTranslationZ(); }