barryhappy/TEmptyView

if i want change empty text later , how ?

Opened this issue · 4 comments

if i want change empty text later , how ?

If you are using ListView, you can do like this:

((TEmptyView)listView.getEmptyView()).setEmptyText("New Text")

if i use recyclerView

i think no way

I know it's not so elegant, but work……o(╯□╰)o

try {
    ((TextView) (((ViewGroup) recyclerView.getParent()).findViewById(R.id.t_emptyTextView)))
            .setText("NewText".concat(String.valueOf(++count)));
}catch (Exception e){
    e.printStackTrace();
}

I will try to provide a better solution next version.