Floatingactionbutton hover Button
------- Part of the information from the online search, if inappropriate, please leave a message to notify me to change!
1) Layout file
- App:backgroundtint-Sets the background color of the fab.
- App:ripplecolor-Sets the background color when the fab is clicked.
- App:borderwidth- This property is particularly important if you do not set 0DP, the Fab will appear as a square on the 4.1 SDK, and the SDK after 5.0 does not have a shadow effect. So set to Borderwidth= "0DP".
- App:elevation-The shadow size of the FAB in the default state.
- App:pressedtranslationz-The shadow size of the fab when clicked.
- App:fabsize-Sets the size of the FAB, which has two values, normal and Mini, and the corresponding fab sizes are 56DP and 40DP, respectively.
- SRC-Set the Fab's icon, Google recommends that the icon size is 24DP to match the design.
- App:layout_anchor-Sets the anchor point of the Fab, that is, which control sets the position for the reference point.
- App:layout_anchorgravity-Sets the location of the Fab relative anchor point, with values Bottom, center, right, left, top, and so on.
Some properties of the control are changed in the layout file settings. To familiarize yourself with the various properties of the control.
The control is a bit like imageview and can be used as this, and this looks better.
2) Add event Listener for Floatingactionbutton control in Mainactivity
Summary: Using the hover button Floatingactionbutton control, you need to do two steps, set the control's properties in the XML file, and add the control's event listener in the mainactivity.
Android Floatingactionbutton (FAB) hover button