Skip to content

Instantly share code, notes, and snippets.

@mlegy
Created October 30, 2020 06:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlegy/1e2917a092bd75cc8ac687ce3b0d820b to your computer and use it in GitHub Desktop.
Save mlegy/1e2917a092bd75cc8ac687ce3b0d820b to your computer and use it in GitHub Desktop.
@NonNull
public static ActivityMainBinding inflate(@NonNull LayoutInflater inflater) {
return inflate(inflater, null, false);
}
@NonNull
public static ActivityMainBinding inflate(@NonNull LayoutInflater inflater,
@Nullable ViewGroup parent, boolean attachToParent) {
View root = inflater.inflate(R.layout.activity_main, parent, false);
if (attachToParent) {
parent.addView(root);
}
return bind(root);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment