-1

Can it be implemented with motion layout? It look like bottomsheet in reverse. Can it be implemented using existing Android views?enter image description here

bhanu agrawal
  • 19
  • 2
  • 6

1 Answers1

0

There is no standart view to implement "top sheet" in android. I'm learning android now, and my educational project is a copy of Google calculator. I've implemented custom coordinatorLayout behavior for history sheet. I've learned how BottomSheetBehavior works, and made my own class based on this. But there are some working implementations on GitHub, that can be found on Google.

The more difficult for me was to implement sliding animation of history elements inside the sheet. (Then you typed the "current expression", it's text size changing according to the slide of sheet) I've tried to implement custom recyclerView layout manager for this purpose. It worked, but the code was too complicated.

So I've started to learn motionLayout, and I found this is very powerfull tool. I'm using MotionLayout to animate contents of the sheet. But it could be used to implement the sheet sliding from top without implementation of custom behavior.

I suggest to learn MotionLayout. The top sheet can be done via xml without any line of code. In contrast, my custom sheet behaior took more than 500 lines of code in Kotlin(it is more concise than Java).