I have a requirement for my android application that a button is at the bottom end of the list. That is done on purpose so users have to scroll trough the entire list (and possibly see more answers). Therefore I added the button as a listview footer.
This all works fine but in some cases the list is too short (only 3-4 items in it) so the button will end up about midway of the screen. What I would like is that the button is at the end of the listview (so if enough items in the list, the user can only see the button when he scrolls down) but when the listview only contains a few items the button will fix itself to the bottom of the screen.
To give the idea I want:
onCreate() {
if (button.getyposition() > screen.getyposition()) { // example methodnames!
// Button at the bottom of the listview (many items)
}
else {
// Button at the bottom of the screen (few items in listview)
}
}
The point is, I don't know if it's possible and where to start. Could anyone give me some directions where to look or even better a piece of sample code? Thanks in advance!
EDIT:
I added a picture to clarify my problem. I hope this makes more sense!
Picture showing the button halfway on the screen http://niles11.dyndns.org/example.png
As you can see, it looks quite strange with the button halfway on the screen. I want the button to be at the bottom of the screen BUT (!) when the listview contains more items I want it to appear at the bottom of the listview (so at first, be off screen)
Hope this picture helps!