gowong / material-sheet-fab

Android library that provides the floating action button to sheet transition from Google's Material Design.
MIT License
1.58k stars 255 forks source link

Allow disabling sheet auto-placement #50

Closed creativedrewy closed 3 years ago

creativedrewy commented 6 years ago

My app has a center-aligned sheet that I needed the fab to animate to, and in the existing implementation the sheet gets auto-aligned to the origin of the fab. I added a property and a setter so that it could be turned off. Kudos to you that after turning it off the fab just goes where it should! So this is how I'm consuming:

val mainFab = MaterialSheetFab(add_site_fab,
                card,
                overlay,
                getColor(android.R.color.white),
                getColor(android.R.color.holo_red_light))
mainFab.setAutoPositionSheet(false)

Again, everything just works in this case! Let me know if you want this property to be set in a different manner or in a different place.