Detecting the scrolling direction in the adapter (up/down)

后端 未结 11 1592
臣服心动
臣服心动 2020-12-01 00:38

I am trying to mimic the Google Plus application in my project, as it seems to be the reference now.

The listview effect when scrolling is really nice and I would li

11条回答
  •  Happy的楠姐
    2020-12-01 01:05

    Here's my approach: It gets you more immediate feedback on how much you've scrolled: OnScroll, you can just get the Top position of the first item in your list. It's a pretty reliable to get actual scroll position information immediately.

    listView.getChildAt(0).getTop()
    

提交回复
热议问题