将扩展FAB转换为标准FAB

时间:2018-05-23 07:49:41

标签: android material-design floating-action-button

有人已经实现了将扩展FAB转换为标准FAB,反之亦然吗?我知道如何在我的布局中添加FAB以及如何检测列表滚动阈值但我真的不知道如何实现这种转换(请参阅参考资料,看看我想做什么:{{3} })。

非常感谢

亲切的问候

1 个答案:

答案 0 :(得分:0)

为此行为添加2条神奇的线,此代码仅适用于ExtendedFloatingActionButton

floatingButton.shrink(); ///This line of code hide text and show Icon of floating buttion

floatingButton.extend()///This line of code show text and icon of floating button