Merge "Hide children in ViewGroup.createSnaphost via internal flag and add test for it." into nyc-dev
am: 394d3df
* commit '394d3dfb2d9ccd2ca2fd7aad06ef2e9a8458a0c7':
Hide children in ViewGroup.createSnaphost via internal flag and add test for it.
Change-Id: Iab1265b6a4c4ff5291259f7e5d9b96c217ee3141
This commit is contained in:
@@ -16299,8 +16299,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
/**
|
||||
* Create a snapshot of the view into a bitmap. We should probably make
|
||||
* some form of this public, but should think about the API.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
Bitmap createSnapshot(Bitmap.Config quality, int backgroundColor, boolean skipChildren) {
|
||||
public Bitmap createSnapshot(Bitmap.Config quality, int backgroundColor, boolean skipChildren) {
|
||||
int width = mRight - mLeft;
|
||||
int height = mBottom - mTop;
|
||||
|
||||
|
||||
@@ -3251,8 +3251,11 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@Override
|
||||
Bitmap createSnapshot(Bitmap.Config quality, int backgroundColor, boolean skipChildren) {
|
||||
public Bitmap createSnapshot(Bitmap.Config quality, int backgroundColor, boolean skipChildren) {
|
||||
int count = mChildrenCount;
|
||||
int[] visibilities = null;
|
||||
|
||||
@@ -3262,7 +3265,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
|
||||
View child = getChildAt(i);
|
||||
visibilities[i] = child.getVisibility();
|
||||
if (visibilities[i] == View.VISIBLE) {
|
||||
child.setVisibility(INVISIBLE);
|
||||
child.mViewFlags = (child.mViewFlags & ~View.VISIBILITY_MASK)
|
||||
| (View.INVISIBLE & View.VISIBILITY_MASK);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3271,7 +3275,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
|
||||
|
||||
if (skipChildren) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
getChildAt(i).setVisibility(visibilities[i]);
|
||||
View child = getChildAt(i);
|
||||
child.mViewFlags = (child.mViewFlags & ~View.VISIBILITY_MASK)
|
||||
| (visibilities[i] & View.VISIBILITY_MASK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user