cymcsg / UltimateRecyclerView

A RecyclerView(advanced and flexible version of ListView in Android) with refreshing,loading more,animation and many other features.
Apache License 2.0
7.22k stars 1.43k forks source link

Empty view won't show when adapter item count is zero. #88

Closed Morteza-Rastgoo closed 8 years ago

Morteza-Rastgoo commented 9 years ago

I set the attribute:

 swipe:recyclerviewEmptyView="@layout/tour_main_overview"

and the item count is zero but the empty layout flashes for a second and disappears.

cymcsg commented 9 years ago

Have you tried the demo and set a zero count adapter to the recyclerview? I tried and it works fine.

Morteza-Rastgoo commented 9 years ago

Can you please give me the link of that class? i can't find it...

cymcsg commented 9 years ago

The MainActivity in demo.You can remove ultimateRecyclerView.enableLoadmore(); and make stringList as a empty list in that class.

Morteza-Rastgoo commented 9 years ago

...But I want enableLoadmore() method somewhere in my code...

cymcsg commented 9 years ago

You can enableLoadmore. But in demo,the loading more feature will load data to the adapter so the adapter is not null any more.

Morteza-Rastgoo commented 9 years ago

I'm confused! Please add a snippet that shows how to do this that can work. thank you.

cymcsg commented 9 years ago

Do you insert some items into the adapter when loading more?If you do that the adapter is not empty after loading more.

Morteza-Rastgoo commented 9 years ago

I'm inserting items after loading more but the problem is that before this, i can't see emptyView.

jjhesk commented 8 years ago

276 this should be done for the load more issue. @mori-honest