First of all, Meituan did not give me a way to slide to the top and then expand the search bar, but instead, immediately display the search bar at the top and expand the content.
I have done this in a company project, and my implementation is like this:
The entire page is RecyclerView nested in NestScrollview
The search bar is at the top (true) and in the list (false). The fake search bar is just the same in appearance as the real search bar. When the fake search bar is clicked, the page scrolls up搜索条距离顶部的长度, and the scroll ends at the fake search bar ( The scrolling time of Scrollview's SmoothScrollTO() is usually 250 milliseconds) before the real search bar is displayed, and finally the content is expanded.
This process is broken down, each part is in order, and the overall look is relatively smooth and natural. Meituan’s is actually not very effective. Personally, I think it’s just from the UI perspective.
First of all, Meituan did not give me a way to slide to the top and then expand the search bar, but instead, immediately display the search bar at the top and expand the content.
I have done this in a company project, and my implementation is like this:
The entire page is RecyclerView nested in NestScrollview
The search bar is at the top (true) and in the list (false). The fake search bar is just the same in appearance as the real search bar. When the fake search bar is clicked, the page scrolls up
搜索条距离顶部的长度
, and the scroll ends at the fake search bar ( The scrolling time of Scrollview's SmoothScrollTO() is usually 250 milliseconds) before the real search bar is displayed, and finally the content is expanded.This process is broken down, each part is in order, and the overall look is relatively smooth and natural. Meituan’s is actually not very effective. Personally, I think it’s just from the UI perspective.