medyo/Dynamicbox

I can't show any view in fragment after filling the adapter of the list view

ksultanq opened this issue · 2 comments

I have a fragment with a list view, if I switch views in dynamic box before filing the adapter it works perfectly, but when I fill the adapter, dynamic box stops working, I can't show error view or loading view or even custom view

It's because ListView uses setEmptyView to inflates custom views.
Try this hack :

Wrap the listview with a LinearLayout like

<LinearLayout
android:id="@+id/wrapper">
<ListView />
</LinearLayout>

Then use that new LinearLayout as Target view in DynamicBox constructor.

Thank you for the help Mehdi, I found where the problem is, the thing is I wanted to show the loading view when the listview was already filled with items (I wanted to refresh the list), since there is an adapter with data is sat on the listview, you can show the empty view (where you put all the other views), I fixed this by adding a new adapter without data (null).

its not a bug, its just lack of documentation, would you please add this info the wiki or to the samples ?

Many thanks for this great library