Skip to content

Instantly share code, notes, and snippets.

@raxhaxor
Created December 24, 2019 16:10
Show Gist options
  • Save raxhaxor/33537f455aed208a4b6815b25777b618 to your computer and use it in GitHub Desktop.
Save raxhaxor/33537f455aed208a4b6815b25777b618 to your computer and use it in GitHub Desktop.
protected ViewGroup generateLayout(DecorView decor) {
...
if (..) {}
else if (..) {}
else if ((features & (1 << FEATURE_ACTION_MODE_OVERLAY)) != 0) {
layoutResource = com.android.internal.R.layout.screen_simple_overlay_action_mode;
}
else {
// Embedded, so no decoration is needed.
layoutResource = com.android.internal.R.layout.screen_simple;
// System.out.println("Simple!");
}
...
View in = mLayoutInflater.inflate(layoutResource, null);
decor.addView(in, new ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT));
ViewGroup contentParent = (ViewGroup)findViewById(ID_ANDROID_CONTENT);
if (contentParent == null) {
throw new RuntimeException("Window couldn't find content container view");
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment