Skip to content

Instantly share code, notes, and snippets.

@beta
Created October 6, 2016 06:55
Show Gist options
  • Save beta/b147f812372af427f6a164f53fd6f4ce to your computer and use it in GitHub Desktop.
Save beta/b147f812372af427f6a164f53fd6f4ce to your computer and use it in GitHub Desktop.
private View wrapInBottomSheet(int layoutResId, View view, ViewGroup.LayoutParams params) {
...
if (shouldWindowCloseOnTouchOutside()) {
coordinator.findViewById(R.id.touch_outside).setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View view) {
if (isShowing()) {
cancel();
}
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment