Search in sources :

Example 1 with ImagePresenterImpl

use of com.jsoupsimple.image.imagelist.presenter.ImagePresenterImpl in project AndroidDevelop by 7449.

the class ImageFragment method initData.

@Override
protected void initData() {
    if (!isPrepared || !isVisible || isLoad) {
        return;
    }
    recyclerView.setLoadingData(this);
    recyclerView.setHasFixedSize(true);
    imageListPresenter = new ImagePresenterImpl(this);
    swipeRefreshLayout.setOnRefreshListener(this);
    recyclerView.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
    adapter = new ImageAdapter(new LinkedList<BaseModel>());
    adapter.setOnItemClickListener(this);
    recyclerView.setAdapter(adapter);
    swipeRefreshLayout.post(new Runnable() {

        @Override
        public void run() {
            onRefresh();
        }
    });
    setLoad();
}
Also used : ImageAdapter(com.jsoupsimple.image.imagelist.widget.adapter.ImageAdapter) ImagePresenterImpl(com.jsoupsimple.image.imagelist.presenter.ImagePresenterImpl) StaggeredGridLayoutManager(android.support.v7.widget.StaggeredGridLayoutManager) LinkedList(java.util.LinkedList)

Aggregations

StaggeredGridLayoutManager (android.support.v7.widget.StaggeredGridLayoutManager)1 ImagePresenterImpl (com.jsoupsimple.image.imagelist.presenter.ImagePresenterImpl)1 ImageAdapter (com.jsoupsimple.image.imagelist.widget.adapter.ImageAdapter)1 LinkedList (java.util.LinkedList)1