Created
June 11, 2013 07:24
-
-
Save chrisbanes/5755022 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DecorChildLayout(Context context, ViewGroup systemDecorView, View headerView) { | |
super(context); | |
// Move all children from decor view to here | |
for (int i = 0, z = systemDecorView.getChildCount() ; i < z ; i++) { | |
View child = systemDecorView.getChildAt(i); | |
systemDecorView.removeView(child); | |
addView(child); | |
} | |
/** | |
* Wrap the Header View in a FrameLayout and add it to this view. It is wrapped | |
* so any inset changes do not affect the actual header view. | |
*/ | |
mHeaderViewWrapper = new FrameLayout(context); | |
mHeaderViewWrapper.addView(headerView); | |
addView(mHeaderViewWrapper, ViewGroup.LayoutParams.MATCH_PARENT, | |
ViewGroup.LayoutParams.WRAP_CONTENT); | |
requestFitSystemWindows(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment