Tuesday, 6 August 2013

Listview rounded corner selector issue

Listview rounded corner selector issue

I'm a newbie in Android so pardon my ignorance. So basically I'm doing a
custom listview wherein I have chosen it to be rounded on its corners.
What I'm doing right now is about the listSelector. I'm looking up from
this post and applied what the author posted, but I'm having an error in
entry_list.size()
@Override
public void bindView(View view, Context context, Cursor cursor) {
int position = cursor.getPosition();
if (position == 0) && entry_list.size() == 1) {
view.setBackgroundResource(R.drawable.selector_rounded_corner_top);
} else if (position == 0) {
view.setBackgroundResource(R.drawable.selector_rounded_corner_top);
} else if (position == entry_list.size() - 1) {
view.setBackgroundResource(R.drawable.rounded_corner_bottom);
} else {
view.setBackgroundResource(R.drawable.list_entry_middle);
}
I'm also wondering how to get the last record of a cursor..Any help will
do and be appreciated.

No comments:

Post a Comment