android.view.View#getScaleY ( )源码实例Demo

下面列出了android.view.View#getScaleY ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: FirefoxReality   文件: AnimationHelper.java
public static void scaleTo(@NonNull View aView, float scaleX, float scaleY, long duration, long delay, final Runnable aCallback) {
    if (aView.getScaleX() == scaleX && aView.getScaleY() == scaleY) {
        if (aCallback != null) {
            aView.post(aCallback);
        }
        return;
    }
    aView.animate().setStartDelay(delay).scaleX(scaleX).scaleY(scaleX).setDuration(duration).setListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);
            if (aCallback != null) {
                aView.post(aCallback);
            }
        }
    }).setUpdateListener(animation -> aView.invalidate());
}
 
源代码2 项目: scene   文件: ChangeTransform.java
Transforms(View view) {
    mTranslationX = view.getTranslationX();
    mTranslationY = view.getTranslationY();
    mTranslationZ = ViewCompat.getTranslationZ(view);
    mScaleX = view.getScaleX();
    mScaleY = view.getScaleY();
    mRotationX = view.getRotationX();
    mRotationY = view.getRotationY();
    mRotationZ = view.getRotation();
}
 
源代码3 项目: scene   文件: RenderNodeAnimatorWrapper.java
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;
}
 
源代码4 项目: Transitions-Everywhere   文件: Scale.java
@Nullable
private Animator createAnimation(@NonNull final View view, float startScale, float endScale, @Nullable TransitionValues values) {
    final float initialScaleX = view.getScaleX();
    final float initialScaleY = view.getScaleY();
    float startScaleX = initialScaleX * startScale;
    float endScaleX = initialScaleX * endScale;
    float startScaleY = initialScaleY * startScale;
    float endScaleY = initialScaleY * endScale;

    if (values != null) {
        Float savedScaleX = (Float) values.values.get(PROPNAME_SCALE_X);
        Float savedScaleY = (Float) values.values.get(PROPNAME_SCALE_Y);
        // if saved value is not equal initial value it means that previous
        // transition was interrupted and in the onTransitionEnd
        // we've applied endScale. we should apply proper value to
        // continue animation from the interrupted state
        if (savedScaleX != null && savedScaleX != initialScaleX) {
            startScaleX = savedScaleX;
        }
        if (savedScaleY != null && savedScaleY != initialScaleY) {
            startScaleY = savedScaleY;
        }
    }

    view.setScaleX(startScaleX);
    view.setScaleY(startScaleY);

    Animator animator = TransitionUtils.mergeAnimators(
        ObjectAnimator.ofFloat(view, View.SCALE_X, startScaleX, endScaleX),
        ObjectAnimator.ofFloat(view, View.SCALE_Y, startScaleY, endScaleY));
    addListener(new TransitionListenerAdapter() {
        @Override
        public void onTransitionEnd(@NonNull Transition transition) {
            view.setScaleX(initialScaleX);
            view.setScaleY(initialScaleY);
            transition.removeListener(this);
        }
    });
    return animator;
}
 
源代码5 项目: android_9.0.0_r45   文件: ChangeTransform.java
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();
}
 
源代码6 项目: morphos   文件: ViewDefault.java
public void updateView(View v) {
    if (v != null) {
        this.alpha = v.getAlpha();
        this.x = v.getX();
        this.y = v.getY();
        this.z = atLeastLollipop ? v.getZ() : 0;
        this.width = v.getWidth();
        this.height = v.getHeight();
        this.expansionScaleX = v.getScaleX();
        this.expansionScaleY = v.getScaleY();
        this.dispositionAngle = v.getRotation();
        this.dispositionAngleX = v.getRotationX();
        this.dispositionAngleY = v.getRotationY();
    }
}
 
源代码7 项目: MultiView   文件: ViewUtils.java
public static boolean isChildInCenterY(RecyclerView recyclerView, View view) {
    int childCount = recyclerView.getChildCount();
    int[] rvLocationOnScreen = new int[2];
    int[] vLocationOnScreen = new int[2];
    recyclerView.getLocationOnScreen(rvLocationOnScreen);
    int middleY = (int) (rvLocationOnScreen[1] + recyclerView.getHeight() * recyclerView.getScaleY() / 2);
    if (childCount > 0) {
        view.getLocationOnScreen(vLocationOnScreen);
        if (vLocationOnScreen[1] <= middleY && vLocationOnScreen[1] + view.getHeight() * view.getScaleY() >= middleY) {
            return true;
        }
    }
    return false;
}
 
源代码8 项目: litho   文件: AnimatedProperties.java
@Override
public float get(Object mountContent) {
  final View asView = assertIsView(mountContent, this);
  final float scale = asView.getScaleX();
  if (scale != asView.getScaleY()) {
    throw new RuntimeException(
        "Tried to get scale of view, but scaleX and scaleY are different");
  }
  return scale;
}
 
源代码9 项目: litho   文件: MountState.java
private static void unsetScale(View view, NodeInfo nodeInfo) {
  if (nodeInfo.isScaleSet()) {
    if (view.getScaleX() != 1) {
      view.setScaleX(1);
    }
    if (view.getScaleY() != 1) {
      view.setScaleY(1);
    }
  }
}
 
源代码10 项目: LaunchEnr   文件: ViewGroupFocusHelper.java
@Override
public void viewToRect(View v, Rect outRect) {
    outRect.left = 0;
    outRect.top = 0;

    computeLocationRelativeToContainer(v, outRect);

    // If a view is scaled, its position will also shift accordingly. For optimization, only
    // consider this for the last node.
    outRect.left += (1 - v.getScaleX()) * v.getWidth() / 2;
    outRect.top += (1 - v.getScaleY()) * v.getHeight() / 2;

    outRect.right = outRect.left + (int) (v.getScaleX() * v.getWidth());
    outRect.bottom = outRect.top + (int) (v.getScaleY() * v.getHeight());
}
 
源代码11 项目: AndroidTvDemo   文件: AbsFocusBorder.java
/**
 * 焦点缩放动画
 * 
 * @param oldOrNewFocusView
 * @param
 */
protected void runFocusScaleAnimation(@Nullable View oldOrNewFocusView, float scaleX, float scaleY)
{
    if (null == oldOrNewFocusView)
        return;
    if (scaleX != oldOrNewFocusView.getScaleX() || scaleY != oldOrNewFocusView.getScaleY())
    {
        oldOrNewFocusView.animate().scaleX(scaleX).scaleY(scaleY).setDuration(mAnimDuration).start();
    }
}
 
源代码12 项目: CircularReveal   文件: DynamicAnimation.java
@Override
public float getValue(View view) {
  return view.getScaleY();
}
 
源代码13 项目: Animer   文件: Animer.java
@Override
public float getValue(View view) {
    return view.getScaleY();
}
 
源代码14 项目: SmallBang   文件: SmallBangView.java
@Override
public Float get(View object) {
    return object.getScaleY();
}
 
源代码15 项目: social-app-android   文件: AnimationUtils.java
public static boolean isViewHiddenByScale(View v) {
    return v.getScaleX() == 0 && v.getScaleY() == 0;
}
 
源代码16 项目: timecat   文件: ViewHelper.java
static float getScaleY(View view) {
    return view.getScaleY();
}
 
源代码17 项目: android-project-wo2b   文件: ViewHelper.java
static float getScaleY(View view) {
    return view.getScaleY();
}
 
源代码18 项目: XDroidAnimation   文件: ViewHelper.java
public static float getScaleY(View view) {
	return view.getScaleY();
}
 
源代码19 项目: Mover   文件: ViewHelper.java
static float getScaleY(View view) {
    return view.getScaleY();
}
 
源代码20 项目: ECardFlow   文件: ECardFlow.java
private void cacheData(View view) {
    mPageScaleX = view.getScaleX();
    mPageScaleY = view.getScaleY();
    mScaleX = getScaleX();
    mScaleY = getScaleY();
}
 
 方法所在类
 同类方法