use of com.bilibili.boxing.presenter.PickerPresenter 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.presenter.PickerPresenter in project boxing by Bilibili.
the class PickerPresenterTest method setupMockAndViews.
@Before
public void setupMockAndViews() {
MockitoAnnotations.initMocks(this);
PowerMockito.mockStatic(BoxingManager.class);
PowerMockito.mockStatic(TextUtils.class);
PowerMockito.when(BoxingManager.getInstance()).thenReturn(mPickerManager);
mPresenter = new PickerPresenter(mView);
MockContentResolver contentResolver = new MockContentResolver();
Mockito.when(mView.getAppCr()).thenReturn(contentResolver);
PowerMockito.when(TextUtils.isEmpty(any(CharSequence.class))).thenAnswer(new Answer<Boolean>() {
@Override
public Boolean answer(InvocationOnMock invocation) throws Throwable {
CharSequence charSequence = (CharSequence) invocation.getArguments()[0];
return !(charSequence != null && charSequence.length() > 0);
}
});
}
use of com.bilibili.boxing.presenter.PickerPresenter 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, 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();
}
use of com.bilibili.boxing.presenter.PickerPresenter in project boxing by Bilibili.
the class AbsBoxingViewActivity method onCreate.
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
BoxingConfig config;
if (savedInstanceState != null) {
config = savedInstanceState.getParcelable(Boxing.EXTRA_CONFIG);
} else {
config = BoxingManager.getInstance().getBoxingConfig();
}
setPickerConfig(config);
parseSelectedMedias(savedInstanceState, getIntent());
setPresenter(new PickerPresenter(this));
}
use of com.bilibili.boxing.presenter.PickerPresenter in project boxing by Bilibili.
the class Boxing method setupFragment.
/**
* set up a subclass of {@link AbsBoxingViewFragment} without a {@link AbsBoxingActivity}.
*
* @param fragment subclass of {@link AbsBoxingViewFragment}
* @param onFinishListener a listener fo media result
*/
public void setupFragment(@NonNull AbsBoxingViewFragment fragment, OnBoxingFinishListener onFinishListener) {
fragment.setPresenter(new PickerPresenter(fragment));
fragment.setOnFinishListener(onFinishListener);
}
Aggregations