Android custom floatingactionbutton sliding behavior only hides the summary of problems that do not appear

Let's start with the behavior code. There are a lot of online codes about floating action button (hereinafter referred to as Fab) sliding. Please refer to it.

This is a custom behavior class, which mainly customizes the appearance and disappearance animation in onnestedscroll. When using, add a layout containing the full behavior class name to the Fab in the XML file_ Behavior property

In this way, Fab will disappear with the slide on the list. This function mainly deals with the problem that the position of the Fab will block the last item in the list. When sliding up, the Fab will be hidden. In this way, when reaching the last item at the bottom of the list, the fab is hidden and will not block the list.

When writing this function, a problem was found:

When sliding up, the Fab can be hidden normally, but when the drop-down list is selected, the Fab does not appear.

If the same code is put into other projects, some can function normally. During debug, it is found that onnestedscroll will be called during pull-up, so the customized hidden method can be called, but onnestedscroll will not be called during slide down.

The above is a summary of the Android custom floatingactionbutton sliding behavior introduced by Xiaobian, which only hides the problems that do not appear. I hope it will be helpful to you. If you have any questions, please leave me a message, and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>