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

The following examples show how to use android.view.View#getPivotY() . 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 File: MultiTouchListener.java    From PhotoEditor with 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
Source File: MultiTouchListener.java    From photo-editor-android with 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 3
Source File: ViewUtils.java    From DevUtils with Apache License 2.0 5 votes vote down vote up
/**
 * 获取竖直方向偏转量
 * @param view {@link View}
 * @return 竖直方向偏转量
 */
public static float getPivotY(final View view) {
    if (view != null) {
        return view.getPivotY();
    }
    return 0f;
}
 
Example 4
Source File: UnfoldableView.java    From FoldableLayout with Apache License 2.0 5 votes vote down vote up
void setView(View view, int width, int height) {
    LayoutParams params = new LayoutParams(width, height, Gravity.CENTER_HORIZONTAL);
    addView(view, params);

    // Setting temporary pivotal point, see #onMeasure()
    origPivotY = view.getPivotY();
    view.setPivotY(0f);
}
 
Example 5
Source File: ViewHelper.java    From imsdk-android with MIT License 4 votes vote down vote up
static float getPivotY(View view) {
    return view.getPivotY();
}
 
Example 6
Source File: ViewHelper.java    From timecat with Apache License 2.0 4 votes vote down vote up
static float getPivotY(View view) {
    return view.getPivotY();
}
 
Example 7
Source File: ViewCompatHC.java    From letv with Apache License 2.0 4 votes vote down vote up
public static float getPivotY(View view) {
    return view.getPivotY();
}
 
Example 8
Source File: ViewHelper.java    From android-project-wo2b with Apache License 2.0 4 votes vote down vote up
static float getPivotY(View view) {
    return view.getPivotY();
}
 
Example 9
Source File: a.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
static float c(View view)
{
    return view.getPivotY();
}
 
Example 10
Source File: ViewHelper.java    From Mover with Apache License 2.0 4 votes vote down vote up
static float getPivotY(View view) {
    return view.getPivotY();
}
 
Example 11
Source File: ViewHelper.java    From XDroidAnimation with Apache License 2.0 4 votes vote down vote up
public static float getPivotY(View view) {
	return view.getPivotY();
}
 
Example 12
Source File: ViewCompatHC.java    From adt-leanback-support with Apache License 2.0 4 votes vote down vote up
public static float getPivotY(View view) {
    return view.getPivotY();
}
 
Example 13
Source File: ViewHelper.java    From KJFrameForAndroid with Apache License 2.0 4 votes vote down vote up
static float getPivotY(View view) {
    return view.getPivotY();
}
 
Example 14
Source File: ViewHelper.java    From UltimateAndroid with Apache License 2.0 4 votes vote down vote up
static float getPivotY(View view) {
    return view.getPivotY();
}
 
Example 15
Source File: UEViewHelper.java    From Auie with GNU General Public License v2.0 4 votes vote down vote up
static float getPivotY(View view) {
    return view.getPivotY();
}