Make FAB on click listener nullable

This commit is contained in:
kubasz 2019-09-27 22:41:22 +02:00
parent 84d6447887
commit e4ad01dc87
3 changed files with 13 additions and 4 deletions

4
.gitignore vendored
View File

@ -11,4 +11,6 @@
/build
/captures
.externalNativeBuild
/_hakerskie
/_hakerskie
*.apk
app/release/

View File

@ -104,6 +104,14 @@ class NavBottomBar : BottomAppBar {
fabExtendedView?.text = value
}
/**
* Set the FAB's on click listener
*/
fun setFabOnClickListener(onClickListener: OnClickListener?) {
fabView?.setOnClickListener(onClickListener)
fabExtendedView?.setOnClickListener(onClickListener)
}
private fun create(attrs: AttributeSet?, defStyle: Int) {
setOnTouchListener { _, event ->
if (bottomSheet?.enable != true || bottomSheet?.enableDragToOpen != true)

View File

@ -153,9 +153,8 @@ class NavView : FrameLayout {
/**
* Set the FAB's on click listener
*/
fun setFabOnClickListener(onClickListener: OnClickListener) {
floatingActionButton.setOnClickListener(onClickListener)
extendedFloatingActionButton.setOnClickListener(onClickListener)
fun setFabOnClickListener(onClickListener: OnClickListener?) {
bottomBar.setFabOnClickListener(onClickListener)
}
internal var systemBarsUtil: SystemBarsUtil? = null