Java Code Examples for android.view.View#getPivotX()

The following examples show how to use android.view.View#getPivotX() . 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: PhotoEditor   File: MultiTouchListener.java    License: MIT License 6 votes vote down vote up
private static void computeRenderOffset(View view, float pivotX, float pivotY) {
    if (view.getPivotX() == pivotX && view.getPivotY() == pivotY) {
        return;
    }

    float[] prevPoint = {0.0f, 0.0f};
    view.getMatrix().mapPoints(prevPoint);

    view.setPivotX(pivotX);
    view.setPivotY(pivotY);

    float[] currPoint = {0.0f, 0.0f};
    view.getMatrix().mapPoints(currPoint);

    float offsetX = currPoint[0] - prevPoint[0];
    float offsetY = currPoint[1] - prevPoint[1];

    view.setTranslationX(view.getTranslationX() - offsetX);
    view.setTranslationY(view.getTranslationY() - offsetY);
}
 
Example 2
private static void computeRenderOffset(View view, float pivotX, float pivotY) {
    if (view.getPivotX() == pivotX && view.getPivotY() == pivotY) {
        return;
    }

    float[] prevPoint = {0.0f, 0.0f};
    view.getMatrix().mapPoints(prevPoint);

    view.setPivotX(pivotX);
    view.setPivotY(pivotY);

    float[] currPoint = {0.0f, 0.0f};
    view.getMatrix().mapPoints(currPoint);

    float offsetX = currPoint[0] - prevPoint[0];
    float offsetY = currPoint[1] - prevPoint[1];

    view.setTranslationX(view.getTranslationX() - offsetX);
    view.setTranslationY(view.getTranslationY() - offsetY);
}
 
Example 3
Source Project: DevUtils   File: ViewUtils.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 获取水平方向偏转量
 * @param view {@link View}
 * @return 水平方向偏转量
 */
public static float getPivotX(final View view) {
    if (view != null) {
        return view.getPivotX();
    }
    return 0f;
}
 
Example 4
Source Project: imsdk-android   File: ViewHelper.java    License: MIT License 4 votes vote down vote up
static float getPivotX(View view) {
    return view.getPivotX();
}
 
Example 5
Source Project: timecat   File: ViewHelper.java    License: Apache License 2.0 4 votes vote down vote up
static float getPivotX(View view) {
    return view.getPivotX();
}
 
Example 6
Source Project: letv   File: ViewCompatHC.java    License: Apache License 2.0 4 votes vote down vote up
public static float getPivotX(View view) {
    return view.getPivotX();
}
 
Example 7
Source Project: android-project-wo2b   File: ViewHelper.java    License: Apache License 2.0 4 votes vote down vote up
static float getPivotX(View view) {
    return view.getPivotX();
}
 
Example 8
Source Project: MiBandDecompiled   File: a.java    License: Apache License 2.0 4 votes vote down vote up
static float b(View view)
{
    return view.getPivotX();
}
 
Example 9
Source Project: Mover   File: ViewHelper.java    License: Apache License 2.0 4 votes vote down vote up
static float getPivotX(View view) {
    return view.getPivotX();
}
 
Example 10
Source Project: XDroidAnimation   File: ViewHelper.java    License: Apache License 2.0 4 votes vote down vote up
public static float getPivotX(View view) {
	return view.getPivotX();
}
 
Example 11
public static float getPivotX(View view) {
    return view.getPivotX();
}
 
Example 12
Source Project: KJFrameForAndroid   File: ViewHelper.java    License: Apache License 2.0 4 votes vote down vote up
static float getPivotX(View view) {
    return view.getPivotX();
}
 
Example 13
Source Project: UltimateAndroid   File: ViewHelper.java    License: Apache License 2.0 4 votes vote down vote up
static float getPivotX(View view) {
    return view.getPivotX();
}
 
Example 14
Source Project: Auie   File: UEViewHelper.java    License: GNU General Public License v2.0 4 votes vote down vote up
static float getPivotX(View view) {
    return view.getPivotX();
}