I\'m trying to use the new Android P FloatingActionButton that\'s part of the com.google.android.material.floatingactionbutton.FloatingActionButton
and I\'m get
For Kotlin I have an extension method
fun viewsVisibility(visibility: Int, vararg views: View) {
for (view in views) { view.visibility = visibility }
}
Then in then in the code you can do the following
viewsVisibility(View.VISIBLE, demoFab)
viewsVisibility(View.GONE, demoFab)
viewsVisibility(View.INVISIBLE, demoFab, addFab, removeFab)
The error will be gone and this gives the flexibility for any visibility state along with taking in a list of views to handle. There are a lot of times I need to handle more than one view at a time as shown in the final example line.