下面列出了android.view.View#isLaidOut ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
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());
}
}
}
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]);
}
}
/**
* 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;
}
/**
* 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;
}
public static boolean isLaidOut(View view) {
return view.isLaidOut();
}
@Override
public boolean isLaidOut(@NonNull View v, boolean defaultValue) {
return v.isLaidOut();
}
/**
* 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;
}
/**
* 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...
}