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

The following are Jave code examples for showing how to use getScaleY() 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.
+ Save this method
Example 1
Project: FlickLauncher   File: Utilities.java   View Source Code Vote up 7 votes
public static int[] getCenterDeltaInScreenSpace(View v0, View v1, int[] delta) {
    v0.getLocationInWindow(sLoc0);
    v1.getLocationInWindow(sLoc1);

    sLoc0[0] += (v0.getMeasuredWidth() * v0.getScaleX()) / 2;
    sLoc0[1] += (v0.getMeasuredHeight() * v0.getScaleY()) / 2;
    sLoc1[0] += (v1.getMeasuredWidth() * v1.getScaleX()) / 2;
    sLoc1[1] += (v1.getMeasuredHeight() * v1.getScaleY()) / 2;

    if (delta == null) {
        delta = new int[2];
    }

    delta[0] = sLoc1[0] - sLoc0[0];
    delta[1] = sLoc1[1] - sLoc0[1];

    return delta;
}
 
Example 2
Project: SimpleUILauncher   File: Utilities.java   View Source Code Vote up 7 votes
public static int[] getCenterDeltaInScreenSpace(View v0, View v1, int[] delta) {
    v0.getLocationInWindow(sLoc0);
    v1.getLocationInWindow(sLoc1);

    sLoc0[0] += (v0.getMeasuredWidth() * v0.getScaleX()) / 2;
    sLoc0[1] += (v0.getMeasuredHeight() * v0.getScaleY()) / 2;
    sLoc1[0] += (v1.getMeasuredWidth() * v1.getScaleX()) / 2;
    sLoc1[1] += (v1.getMeasuredHeight() * v1.getScaleY()) / 2;

    if (delta == null) {
        delta = new int[2];
    }

    delta[0] = sLoc1[0] - sLoc0[0];
    delta[1] = sLoc1[1] - sLoc0[1];

    return delta;
}
 
Example 3
Project: SimpleUILauncher   File: ViewGroupFocusHelper.java   View Source Code Vote up 6 votes
@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());
}
 
Example 4
Project: LaunchEnr   File: ViewGroupFocusHelper.java   View Source Code Vote up 6 votes
@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());
}
 
Example 5
Project: airgram   File: ViewProxy.java   View Source Code Vote up 6 votes
public static float getScaleY(View view) {
    if (View10.NEED_PROXY) {
        return View10.wrap(view).getScaleY();
    } else {
        return view.getScaleY();
    }
}
 
Example 6
Project: exciting-app   File: ViewPropertyAnimatorHC.java   View Source Code Vote up 6 votes
/**
 * This method gets the value of the named property from the View object.
 *
 * @param propertyConstant The property whose value should be returned
 * @return float The value of the named property
 */
private float getValue(int propertyConstant) {
    //final View.TransformationInfo info = mView.mTransformationInfo;
    View v = mView.get();
    if (v != null) {
        switch (propertyConstant) {
            case TRANSLATION_X:
                //return info.mTranslationX;
                return v.getTranslationX();
            case TRANSLATION_Y:
                //return info.mTranslationY;
                return v.getTranslationY();
            case ROTATION:
                //return info.mRotation;
                return v.getRotation();
            case ROTATION_X:
                //return info.mRotationX;
                return v.getRotationX();
            case ROTATION_Y:
                //return info.mRotationY;
                return v.getRotationY();
            case SCALE_X:
                //return info.mScaleX;
                return v.getScaleX();
            case SCALE_Y:
                //return info.mScaleY;
                return v.getScaleY();
            case X:
                //return v.mLeft + info.mTranslationX;
                return v.getX();
            case Y:
                //return v.mTop + info.mTranslationY;
                return v.getY();
            case ALPHA:
                //return info.mAlpha;
                return v.getAlpha();
        }
    }
    return 0;
}
 
Example 7
Project: AndroidTvDemo   File: AbsFocusBorder.java   View Source Code Vote up 6 votes
/**
 * 焦点缩放动画
 * 
 * @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();
    }
}
 
Example 8
Project: PlusGram   File: ViewProxy.java   View Source Code Vote up 6 votes
public static float getScaleY(View view) {
    if (View10.NEED_PROXY) {
        return View10.wrap(view).getScaleY();
    } else {
        return view.getScaleY();
    }
}
 
Example 9
Project: boohee_v5.6   File: ViewPropertyAnimatorHC.java   View Source Code Vote up 6 votes
private float getValue(int propertyConstant) {
    View v = (View) this.mView.get();
    if (v != null) {
        switch (propertyConstant) {
            case 1:
                return v.getTranslationX();
            case 2:
                return v.getTranslationY();
            case 4:
                return v.getScaleX();
            case 8:
                return v.getScaleY();
            case 16:
                return v.getRotation();
            case 32:
                return v.getRotationX();
            case 64:
                return v.getRotationY();
            case 128:
                return v.getX();
            case 256:
                return v.getY();
            case 512:
                return v.getAlpha();
        }
    }
    return 0.0f;
}
 
Example 10
Project: android-project-gallery   File: ViewPropertyAnimatorHC.java   View Source Code Vote up 6 votes
/**
 * This method gets the value of the named property from the View object.
 *
 * @param propertyConstant The property whose value should be returned
 * @return float The value of the named property
 */
private float getValue(int propertyConstant) {
    //final View.TransformationInfo info = mView.mTransformationInfo;
    View v = mView.get();
    if (v != null) {
        switch (propertyConstant) {
            case TRANSLATION_X:
                //return info.mTranslationX;
                return v.getTranslationX();
            case TRANSLATION_Y:
                //return info.mTranslationY;
                return v.getTranslationY();
            case ROTATION:
                //return info.mRotation;
                return v.getRotation();
            case ROTATION_X:
                //return info.mRotationX;
                return v.getRotationX();
            case ROTATION_Y:
                //return info.mRotationY;
                return v.getRotationY();
            case SCALE_X:
                //return info.mScaleX;
                return v.getScaleX();
            case SCALE_Y:
                //return info.mScaleY;
                return v.getScaleY();
            case X:
                //return v.mLeft + info.mTranslationX;
                return v.getX();
            case Y:
                //return v.mTop + info.mTranslationY;
                return v.getY();
            case ALPHA:
                //return info.mAlpha;
                return v.getAlpha();
        }
    }
    return 0;
}
 
Example 11
Project: morphos   File: ViewDefault.java   View Source Code Vote up 6 votes
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();
    }
}
 
Example 12
Project: RNLearn_Project1   File: ScaleYAnimationPropertyUpdater.java   View Source Code Vote up 5 votes
@Override
protected float getProperty(View view) {
  return view.getScaleY();
}
 
Example 13
Project: letv   File: ViewCompatHC.java   View Source Code Vote up 5 votes
public static float getScaleY(View view) {
    return view.getScaleY();
}
 
Example 14
Project: exciting-app   File: ViewHelper.java   View Source Code Vote up 5 votes
static float getScaleY(View view) {
    return view.getScaleY();
}
 
Example 15
Project: RNLearn_Project1   File: ScaleXYAnimationPairPropertyUpdater.java   View Source Code Vote up 5 votes
@Override
protected void getProperty(View view, float[] returnValues) {
  returnValues[0] = view.getScaleX();
  returnValues[1] = view.getScaleY();
}
 
Example 16
Project: RNLearn_Project1   File: ScaleXYAnimationPairPropertyUpdater.java   View Source Code Vote up 5 votes
@Override
protected void getProperty(View view, float[] returnValues) {
  returnValues[0] = view.getScaleX();
  returnValues[1] = view.getScaleY();
}
 
Example 17
Project: ECardFlow   File: ECardFlow.java   View Source Code Vote up 5 votes
private void cacheData(View view) {
    mPageScaleX = view.getScaleX();
    mPageScaleY = view.getScaleY();
    mScaleX = getScaleX();
    mScaleY = getScaleY();
}
 
Example 18
Project: boohee_v5.6   File: ViewHelper.java   View Source Code Vote up 5 votes
static float getScaleY(View view) {
    return view.getScaleY();
}
 
Example 19
Project: boohee_v5.6   File: ViewCompatHC.java   View Source Code Vote up 5 votes
public static float getScaleY(View view) {
    return view.getScaleY();
}
 
Example 20
Project: android-project-gallery   File: ViewHelper.java   View Source Code Vote up 5 votes
static float getScaleY(View view) {
    return view.getScaleY();
}