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

The following examples show how to use android.view.View#isLaidOut() . 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: ChangeBounds.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
private void captureValues(TransitionValues values) {
    View view = values.view;

    if (view.isLaidOut() || view.getWidth() != 0 || view.getHeight() != 0) {
        values.values.put(PROPNAME_BOUNDS, new Rect(view.getLeft(), view.getTop(),
                view.getRight(), view.getBottom()));
        values.values.put(PROPNAME_PARENT, values.view.getParent());
        if (mReparent) {
            values.view.getLocationInWindow(tempLocation);
            values.values.put(PROPNAME_WINDOW_X, tempLocation[0]);
            values.values.put(PROPNAME_WINDOW_Y, tempLocation[1]);
        }
        if (mResizeClip) {
            values.values.put(PROPNAME_CLIP, view.getClipBounds());
        }
    }
}
 
Example 2
Source File: AbsoluteChangeBounds.java    From scene with Apache License 2.0 5 votes vote down vote up
private void captureValues(TransitionValues values) {
    View view = values.view;
    if (view.isLaidOut() || view.getWidth() != 0 || view.getHeight() != 0) {
        values.view.getLocationInWindow(tempLocation);
        values.values.put(PROPNAME_WINDOW_X, tempLocation[0]);
        values.values.put(PROPNAME_WINDOW_Y, tempLocation[1]);
    }
}
 
Example 3
Source File: ViewUtils.java    From ListItemView with Apache License 2.0 5 votes vote down vote up
/**
 * Returns whether or not the view has been laid out
 **/
public static boolean isLaidOut(View view) {
    if (Build.VERSION.SDK_INT >= 19) {
        return view.isLaidOut();
    }

    return view.getWidth() > 0 && view.getHeight() > 0;
}
 
Example 4
Source File: ViewUtils.java    From MaterialMasterDetail with Apache License 2.0 5 votes vote down vote up
/**
 * Returns whether or not the view has been laid out
 **/
static boolean isLaidOut(View view) {
    if (Build.VERSION.SDK_INT >= 19) {
        return view.isLaidOut();
    }

    return view.getWidth() > 0 && view.getHeight() > 0;
}
 
Example 5
Source File: ViewCompatKitKat.java    From letv with Apache License 2.0 4 votes vote down vote up
public static boolean isLaidOut(View view) {
    return view.isLaidOut();
}
 
Example 6
Source File: ViewUtils.java    From Transitions-Everywhere with Apache License 2.0 4 votes vote down vote up
@Override
public boolean isLaidOut(@NonNull View v, boolean defaultValue) {
    return v.isLaidOut();
}
 
Example 7
Source File: ViewCompat.java    From android-signaturepad with Apache License 2.0 3 votes vote down vote up
/**
 * Returns true if {@code view} has been through at least one layout since it
 * was last attached to or detached from a window.
 *
 * See http://developer.android.com/reference/android/support/v4/view/ViewCompat.html#isLaidOut%28android.view.View%29
 *
 * @param view the view
 * @return true if this view has been through at least one layout since it was last attached to or detached from a window.
 */
public static boolean isLaidOut(View view) {
    // Future (API19+)...
    if (Build.VERSION.SDK_INT >= 19) {
        return view.isLaidOut();
    }
    // Legacy...
    return view.getWidth() > 0 && view.getHeight() > 0;
}
 
Example 8
Source File: ViewCompat.java    From SSForms with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Returns true if {@code view} has been through at least one layout since it
 * was last attached to or detached from a window.
 *
 * See http://developer.android.com/reference/android/support/v4/view/ViewCompat.html#isLaidOut%28android.view.View%29
 *
 * @param view the view
 * @return true if this view has been through at least one layout since it was last attached to or detached from a window.
 */
public static boolean isLaidOut(View view) {
    // Future (API19+)...
    return view.isLaidOut();
    // Legacy...
}