Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create method for the builder is confusing #6

Closed
fnk0 opened this issue Aug 28, 2015 · 1 comment
Closed

Create method for the builder is confusing #6

fnk0 opened this issue Aug 28, 2015 · 1 comment

Comments

@fnk0
Copy link

fnk0 commented Aug 28, 2015

Thanks for the great library but just a small point that I've seen while using it. To build a bottom sheet the method name that you used is create() while the standard used by all the other Java/Android libraries is build()

@Kennyc1012
Copy link
Owner

Although it might be the standard, it isn't always used. For example Alert Dialog uses create and [Snackbar uses make](https://developer.android.com/reference/android/support/design/widget/Snackbar.html#make%28android.view.View, int, int%29). You also don't really need to ever call the build() method when creating a BottomSheet. You can just call show() to immediately display it like so:

new BottomSheet.Builder(getActivity(), R.menu.bottom_sheet)
  .setTitle(R.string.options)
  .setListener(myListener)
  .show();

Calling build() yourself should really only be used if you need reference to the BottomSheet for whatever reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants