Search in sources :

Example 1 with UilAdapter

use of com.facebook.samples.comparison.adapters.UilAdapter in project fresco by facebook.

the class MainActivity method setLoaderAdapter.

private void setLoaderAdapter(int index) {
    FLog.v(TAG, "onImageLoaderSelect: %d", index);
    resetAdapter();
    mCurrentLoaderAdapterIndex = index;
    mPerfListener = new PerfListener();
    switch(index) {
        case FRESCO_INDEX:
        case FRESCO_OKHTTP_INDEX:
            mCurrentAdapter = new FrescoAdapter(this, mPerfListener, index == FRESCO_INDEX ? ImagePipelineConfigFactory.getImagePipelineConfig(this) : ImagePipelineConfigFactory.getOkHttpImagePipelineConfig(this));
            break;
        case GLIDE_INDEX:
            mCurrentAdapter = new GlideAdapter(this, mPerfListener);
            break;
        case PICASSO_INDEX:
            mCurrentAdapter = new PicassoAdapter(this, mPerfListener);
            break;
        case UIL_INDEX:
            mCurrentAdapter = new UilAdapter(this, mPerfListener);
            break;
        case VOLLEY_INDEX:
            mCurrentAdapter = new VolleyAdapter(this, mPerfListener);
            break;
        case AQUERY_INDEX:
            mCurrentAdapter = new AQueryAdapter(this, mPerfListener);
            break;
        default:
            mCurrentAdapter = null;
            return;
    }
    mRecyclerView.setAdapter(mCurrentAdapter);
    updateAdapter(mImageUrls);
    updateStats();
}
Also used : PerfListener(com.facebook.samples.comparison.instrumentation.PerfListener) VolleyAdapter(com.facebook.samples.comparison.adapters.VolleyAdapter) GlideAdapter(com.facebook.samples.comparison.adapters.GlideAdapter) PicassoAdapter(com.facebook.samples.comparison.adapters.PicassoAdapter) AQueryAdapter(com.facebook.samples.comparison.adapters.AQueryAdapter) FrescoAdapter(com.facebook.samples.comparison.adapters.FrescoAdapter) UilAdapter(com.facebook.samples.comparison.adapters.UilAdapter)

Aggregations

AQueryAdapter (com.facebook.samples.comparison.adapters.AQueryAdapter)1 FrescoAdapter (com.facebook.samples.comparison.adapters.FrescoAdapter)1 GlideAdapter (com.facebook.samples.comparison.adapters.GlideAdapter)1 PicassoAdapter (com.facebook.samples.comparison.adapters.PicassoAdapter)1 UilAdapter (com.facebook.samples.comparison.adapters.UilAdapter)1 VolleyAdapter (com.facebook.samples.comparison.adapters.VolleyAdapter)1 PerfListener (com.facebook.samples.comparison.instrumentation.PerfListener)1