lucasr / twoway-view

[DEPRECATED] RecyclerView made simple
5.23k stars 1.02k forks source link

how to implement load more on two way-view horizonal listview #210

Open ryandzhunter opened 9 years ago

ryandzhunter commented 9 years ago

hello,

I had some trouble when creating a horizontal listview on my app. The horizontal is running well, but when I'm try to implement load more with button, the method cannot found.

            mListView = (TwoWayView) findViewById(R.id.listSearch); 
            ImageButton btnLoadMore = new ImageButton(this);
    btnLoadMore.setBackgroundResource(R.color.transparent);
    btnLoadMore.setImageResource(R.drawable.butt_loadmore);

    if(listNews.size()<11){
        btnLoadMore.setVisibility(View.GONE);
    }else{
        if (counter==0) {
            mListView.addFooterView(btnLoadMore);
        }
        counter++;
        btnLoadMore.setVisibility(View.VISIBLE);
    }

    btnLoadMore.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            page  = page+10;
            new OpenData().execute();
        }
    });

    mListView.setAdapter(listadapter);

what method available in two way view which has same function with addFooterView?

please, i need your help to fix this issue...

KoMinkyu commented 9 years ago

You have to implement footer type viewholder your self.

I got a help from HeaderFooterRecyclerViewAdapter.