How to move a view above Snackbar just like FloatingButton

前端 未结 8 634
伪装坚强ぢ
伪装坚强ぢ 2021-01-31 07:50

I got a linear layout that I want to move up when a Snackbar appears.

I saw many examples how to do this with FloatingButton, but what about a regular view?

8条回答
  •  不要未来只要你来
    2021-01-31 08:12

    I've written a library which additional views can be added to animate with the SnackProgressBar. It also includes progressBar and other stuff. Try it out https://github.com/tingyik90/snackprogressbar

    Suppose you have the following views to animate.

    View[] views = {view1, view2, view3};
    

    Create an instance of SnackProgressBarManager in your activity and includes the view to animate.

    SnackProgressBarManager snackProgressBarManager = new SnackProgressBarManager(rootView)
            .setViewsToMove(views)
    

    When a SnackProgressBar is shown or dismissed, these views will be animated accordingly.

提交回复
热议问题