On Tue, May 21, 2013 at 12:11 AM, Miha Valencic <miha.valen...@gmail.com> wrote:
> In this case, which is the correct state? I now see that
> "state_activated" works as expected, though as Kostya mentions, it is
> API Level 11 and beyond. Is there an alternatvive for API level 10?

So... I've implemented a couple of verisions (I pushed to github,
previously mentioned): using selector with state_activated, using
custom view for selected item via "getView" and using custom
"Checkable" layout, which uses state_checked approach. The
state_activated is what I would go for if it would be at least API
level 10, so between two other options, Checkable layout seems like a
good way to go.

Kostya, how do you handle "checked" states then? I see two possible solutions:

1) in OnItemClickListener, call adapter.setChecked(position), which
sets the checked item position and then calls notifyDataSetChanged()
2) in OnItemClickListener call setChecked on the view itself plus call
adapter.setChecked(position) and define the checked state in the
getView()

I see option 2 as a minor performance improvement over option1. How
did you handle it?

@Romain, is there a way to use state_activated in API level 10 via
some sort of compatibility package? Could I create such a
compatibility lib myself perhaps?

Regards,
 Miha.

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to