Closed GoogleCodeExporter closed 9 years ago
it is actually odd to have that.. as it is actually not anything provided by
the listview but a combo of a few widgets. I agree sdk listactivity providing
this is very convenient.. but, I think we can do this by doing it manually or
simply create a custom widget for this..
Original comment by gueei....@gmail.com
on 11 Sep 2011 at 2:13
We decided not to implement emptyView on the AdapterView, but provide a
work-around implementation. Since letting a ViewAttribute holding the other
instance's View isn't a too good idea for MVVM and the usage scenario is not
generic enough, in this case a new Read-only View Attribute called `itemCount`
is added to the AdapterView which returns the number of items the view is
holding.
Using also the newest in-xml referencing syntax, following would achieve what
you suggested, purely in xml:
{{{
<TextView binding:visibility="NOT(EQUAL(=id/list1.itemCount, 0))"
android:text="There's nothing in the list yet".../>
<ListView android:id="@+id/list1"
binding:visibility="EQUAL(=id/list1.itemCount, 0)" .../>
}}}
The above solution also demonstrated in the Markup Demo, in the
ArrayListAsListViewSource.
Original comment by gueei....@gmail.com
on 16 Sep 2011 at 1:28
Original issue reported on code.google.com by
ffor...@linuxmail.org
on 10 Sep 2011 at 2:48