Kennyc1012 / BottomSheetMenu

BottomSheetMenu style dialogs for Android
Apache License 2.0
887 stars 99 forks source link

Create method for the builder is confusing #6

Closed fnk0 closed 9 years ago

fnk0 commented 9 years ago

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 commented 9 years ago

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.