开发者

Adding a button bar at the bottom of ListView upon checkbox select (as in Gmail app)?

开发者 https://www.devze.com 2023-02-02 17:52 出处:网络
I have a ListView with custom adapter. In each row there is a checkbox and couple of textviews. I want user to give option to delete the check marked items, so as soon as soon clicks on one of the che

I have a ListView with custom adapter. In each row there is a checkbox and couple of textviews. I want user to give option to delete the check marked items, so as soon as soon clicks on one of the checkbox, I want a button bar to slide in from the bottom and stay at the bottom regardless of listview scroll. This is something like the email app behavior of Motorola Cliq and to some extent gmail app itself.

I have tried adding a relativelayout (containing buttons) below the listview, which has visibility set to gone initially, but as soon as user checks a button, the visibility changes to "visible". I have added a slide-in animation to it too. It is working but problem is that it is overlapping the last element of the listview which user can not checkmark if the button bar has already become visible. So I tried to set the bottom margin of the listview equal to the height of the button bar when I'm changing the button bar visibility, which solves the problem of overlap, but now the checkbox behavior has gone weird. Clicking on one checkmark tries to checkmark another checkmark in the list for some weird reason. I noticed that this happens because as soon as I change the listview margin, list redraws itself, and during this new call to getView() method of adapter, things mess up.

I wanted to ask if anyone has done something like开发者_高级运维 this. What is the best method to add such button bar below list while keeping the slide-in animation intact. Also, What is the footer-view of listview and can that solve my problem?

0

精彩评论

暂无评论...
验证码 换一张
取 消