use of com.bilibili.boxing.model.config.BoxingConfig in project boxing by Bilibili.
the class AbsBoxingActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AbsBoxingViewFragment view = onCreateBoxingView(getSelectedMedias(getIntent()));
BoxingConfig pickerConfig = BoxingManager.getInstance().getBoxingConfig();
view.setPresenter(new PickerPresenter(view));
view.setPickerConfig(pickerConfig);
Boxing.get().setupFragment(view, this);
}
use of com.bilibili.boxing.model.config.BoxingConfig in project boxing by Bilibili.
the class AbsBoxingViewFragment method onCreate.
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
BoxingConfig config;
if (savedInstanceState != null) {
config = savedInstanceState.getParcelable(Boxing.EXTRA_CONFIG);
} else {
config = BoxingManager.getInstance().getBoxingConfig();
}
setPickerConfig(config);
onCreateWithSelectedMedias(savedInstanceState, parseSelectedMedias(savedInstanceState, getArguments()));
super.onCreate(savedInstanceState);
initCameraPhotoPicker(savedInstanceState);
}
use of com.bilibili.boxing.model.config.BoxingConfig in project boxing by Bilibili.
the class ConfigTest method testImageSelectionRes.
@Test
public void testImageSelectionRes() {
mPickerManager.setBoxingConfig(new BoxingConfig(BoxingConfig.Mode.MULTI_IMG));
BoxingConfig config = mPickerManager.getBoxingConfig();
assertEquals(config.getMediaCheckedRes(), 0);
assertEquals(BoxingResHelper.getMediaCheckedRes(), R.drawable.ic_boxing_checked);
mPickerManager.setBoxingConfig(new BoxingConfig(BoxingConfig.Mode.MULTI_IMG).withMediaCheckedRes(R.drawable.ic_boxing_broken_image));
config = mPickerManager.getBoxingConfig();
assertEquals(config.getMediaCheckedRes(), R.drawable.ic_boxing_broken_image);
assertEquals(BoxingResHelper.getMediaCheckedRes(), R.drawable.ic_boxing_broken_image);
mPickerManager.setBoxingConfig(new BoxingConfig(BoxingConfig.Mode.MULTI_IMG));
config = mPickerManager.getBoxingConfig();
assertEquals(config.getMediaUnCheckedRes(), 0);
assertEquals(BoxingResHelper.getMediaUncheckedRes(), R.drawable.shape_boxing_unchecked);
mPickerManager.setBoxingConfig(new BoxingConfig(BoxingConfig.Mode.MULTI_IMG).withMediaUncheckedRes(R.drawable.ic_boxing_broken_image));
config = mPickerManager.getBoxingConfig();
assertEquals(config.getMediaUnCheckedRes(), R.drawable.ic_boxing_broken_image);
assertEquals(BoxingResHelper.getMediaUncheckedRes(), R.drawable.ic_boxing_broken_image);
}
use of com.bilibili.boxing.model.config.BoxingConfig in project boxing by Bilibili.
the class ConfigTest method testPlaceHolder.
@Test
public void testPlaceHolder() {
mPickerManager.setBoxingConfig(new BoxingConfig(BoxingConfig.Mode.MULTI_IMG));
BoxingConfig config = mPickerManager.getBoxingConfig();
assertEquals(config.getMediaPlaceHolderRes(), 0);
mPickerManager.setBoxingConfig(new BoxingConfig(BoxingConfig.Mode.MULTI_IMG).withMediaPlaceHolderRes(R.drawable.ic_boxing_broken_image));
config = mPickerManager.getBoxingConfig();
assertEquals(config.getMediaPlaceHolderRes(), R.drawable.ic_boxing_broken_image);
mPickerManager.setBoxingConfig(new BoxingConfig(BoxingConfig.Mode.MULTI_IMG));
config = mPickerManager.getBoxingConfig();
assertEquals(config.getAlbumPlaceHolderRes(), 0);
mPickerManager.setBoxingConfig(new BoxingConfig(BoxingConfig.Mode.MULTI_IMG).withAlbumPlaceHolderRes(R.drawable.ic_boxing_broken_image));
config = mPickerManager.getBoxingConfig();
assertEquals(config.getAlbumPlaceHolderRes(), R.drawable.ic_boxing_broken_image);
}
use of com.bilibili.boxing.model.config.BoxingConfig in project boxing by Bilibili.
the class ConfigTest method testVideoDuration.
@Test
public void testVideoDuration() {
mPickerManager.setBoxingConfig(new BoxingConfig(BoxingConfig.Mode.VIDEO));
BoxingConfig config = mPickerManager.getBoxingConfig();
assertEquals(config.getVideoDurationRes(), 0);
mPickerManager.setBoxingConfig(new BoxingConfig(BoxingConfig.Mode.MULTI_IMG).withVideoDurationRes(R.drawable.ic_boxing_broken_image));
config = mPickerManager.getBoxingConfig();
assertEquals(config.getVideoDurationRes(), R.drawable.ic_boxing_broken_image);
}
Aggregations