Example usage for android.view ViewGroup getScrollX

List of usage examples for android.view ViewGroup getScrollX

Introduction

In this page you can find the example usage for android.view ViewGroup getScrollX.

Prototype

public final int getScrollX() 

Source Link

Document

Return the scrolled left position of this view.

Usage

From source file:android.support.transition.ChangeTransform.java

private void captureValues(TransitionValues transitionValues) {
    View view = transitionValues.view;
    if (view.getVisibility() == View.GONE) {
        return;//from  w w w.java  2  s .c  o m
    }
    transitionValues.values.put(PROPNAME_PARENT, view.getParent());
    Transforms transforms = new Transforms(view);
    transitionValues.values.put(PROPNAME_TRANSFORMS, transforms);
    Matrix matrix = view.getMatrix();
    if (matrix == null || matrix.isIdentity()) {
        matrix = null;
    } else {
        matrix = new Matrix(matrix);
    }
    transitionValues.values.put(PROPNAME_MATRIX, matrix);
    if (mReparent) {
        Matrix parentMatrix = new Matrix();
        ViewGroup parent = (ViewGroup) view.getParent();
        ViewUtils.transformMatrixToGlobal(parent, parentMatrix);
        parentMatrix.preTranslate(-parent.getScrollX(), -parent.getScrollY());
        transitionValues.values.put(PROPNAME_PARENT_MATRIX, parentMatrix);
        transitionValues.values.put(PROPNAME_INTERMEDIATE_MATRIX, view.getTag(R.id.transition_transform));
        transitionValues.values.put(PROPNAME_INTERMEDIATE_PARENT_MATRIX, view.getTag(R.id.parent_matrix));
    }
}