ListTweaks and AbsListView

11 views
Skip to first unread message

ales

unread,
Jun 1, 2015, 4:12:43 AM6/1/15
to mac...@googlegroups.com
Hi,
is there some reason for using AbsListView in ListTweaks?

/** Extra tweaks for ListView */
object ListTweaks {
  type W
= ListView

  val noDivider
= Tweak[W](_.setDivider(null))
 
def adapter(adapter: ListAdapter) = Tweak[AbsListView](_.setAdapter(adapter))
}



This does not work on Android 2.3.3, API 10 (we have to support older devices), because the setAdapter method was added to AbsListView in API 11.

I have created my own tweak:

def adapter(adapter: ListAdapter) = Tweak[ListView](_.setAdapter(adapter))



and it works.

Ales

Nick Stanchenko

unread,
Jun 1, 2015, 6:49:25 AM6/1/15
to mac...@googlegroups.com, kahane...@gmail.com
Hi,

IIRC this was done to support some third-party widget that inherited from AbsListView, rather than ListView. Most likely this one: https://github.com/etsy/AndroidStaggeredGrid.

Nick
Reply all
Reply to author
Forward
0 new messages