Search in sources :

Example 1 with IBoxingMediaLoader

use of com.bilibili.boxing.loader.IBoxingMediaLoader in project boxing by Bilibili.

the class MainActivity method onOptionsItemSelected.

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();
    IBoxingMediaLoader loader;
    switch(id) {
        case R.id.menu_fresco:
            loader = new BoxingFrescoLoader(this);
            break;
        case R.id.menu_glide:
            loader = new BoxingGlideLoader();
            break;
        case R.id.menu_picasso:
            loader = new BoxingPicassoLoader();
            break;
        default:
            loader = new BoxingFrescoLoader(this);
            break;
    }
    BoxingMediaLoader.getInstance().init(loader);
    return super.onOptionsItemSelected(item);
}
Also used : BoxingGlideLoader(com.bilibili.boxing.impl.BoxingGlideLoader) BoxingPicassoLoader(com.bilibili.boxing.impl.BoxingPicassoLoader) BoxingFrescoLoader(com.bilibili.boxing.impl.BoxingFrescoLoader) IBoxingMediaLoader(com.bilibili.boxing.loader.IBoxingMediaLoader)

Example 2 with IBoxingMediaLoader

use of com.bilibili.boxing.loader.IBoxingMediaLoader in project boxing by Bilibili.

the class BoxingApplication method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    IBoxingMediaLoader loader = new BoxingGlideLoader();
    BoxingMediaLoader.getInstance().init(loader);
    BoxingCrop.getInstance().init(new BoxingUcrop());
}
Also used : BoxingGlideLoader(com.bilibili.boxing.impl.BoxingGlideLoader) BoxingUcrop(com.bilibili.boxing.impl.BoxingUcrop) IBoxingMediaLoader(com.bilibili.boxing.loader.IBoxingMediaLoader)

Example 3 with IBoxingMediaLoader

use of com.bilibili.boxing.loader.IBoxingMediaLoader in project boxing by Bilibili.

the class TestBlankActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_boxing);
    BoxingMediaLoader.getInstance().init(new IBoxingMediaLoader() {

        @Override
        public void displayThumbnail(@NonNull ImageView img, @NonNull String absPath, int width, int height) {
        }

        @Override
        public void displayRaw(@NonNull ImageView img, @NonNull String absPath, int width, int height, IBoxingCallback callback) {
        }
    });
    BoxingViewFragment fragment = BoxingViewFragment.newInstance();
    fragment.setTitleTxt((TextView) findViewById(R.id.pick_album_txt));
    fragment.setPresenter(new PickerPresenter(fragment));
    fragment.setPickerConfig(new BoxingConfig(BoxingConfig.Mode.MULTI_IMG));
    final FragmentManager manager = getSupportFragmentManager();
    manager.beginTransaction().add(R.id.content_layout, fragment).commit();
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) BoxingConfig(com.bilibili.boxing.model.config.BoxingConfig) IBoxingCallback(com.bilibili.boxing.loader.IBoxingCallback) IBoxingMediaLoader(com.bilibili.boxing.loader.IBoxingMediaLoader) ImageView(android.widget.ImageView) BoxingViewFragment(com.bilibili.boxing_impl.ui.BoxingViewFragment) PickerPresenter(com.bilibili.boxing.presenter.PickerPresenter)

Aggregations

IBoxingMediaLoader (com.bilibili.boxing.loader.IBoxingMediaLoader)3 BoxingGlideLoader (com.bilibili.boxing.impl.BoxingGlideLoader)2 FragmentManager (android.support.v4.app.FragmentManager)1 ImageView (android.widget.ImageView)1 BoxingFrescoLoader (com.bilibili.boxing.impl.BoxingFrescoLoader)1 BoxingPicassoLoader (com.bilibili.boxing.impl.BoxingPicassoLoader)1 BoxingUcrop (com.bilibili.boxing.impl.BoxingUcrop)1 IBoxingCallback (com.bilibili.boxing.loader.IBoxingCallback)1 BoxingConfig (com.bilibili.boxing.model.config.BoxingConfig)1 PickerPresenter (com.bilibili.boxing.presenter.PickerPresenter)1 BoxingViewFragment (com.bilibili.boxing_impl.ui.BoxingViewFragment)1