use of com.bilibili.boxing.utils.CameraPickerHelper in project boxing by Bilibili.
the class AbsBoxingViewFragment method initCameraPhotoPicker.
private void initCameraPhotoPicker(Bundle savedInstanceState) {
BoxingConfig config = BoxingManager.getInstance().getBoxingConfig();
if (config == null || !config.isNeedCamera()) {
return;
}
mCameraPicker = new CameraPickerHelper(savedInstanceState);
mCameraPicker.setPickCallback(new CameraListener(this));
}
use of com.bilibili.boxing.utils.CameraPickerHelper in project boxing by Bilibili.
the class PickerUtilTest method testCameraHelper.
@Test
public void testCameraHelper() {
CameraPickerHelper helper = new CameraPickerHelper(null);
boolean fail = helper.onActivityResult(0, 0);
assertFalse(fail);
fail = helper.onActivityResult(CameraPickerHelper.REQ_CODE_CAMERA, 0);
assertFalse(fail);
fail = helper.onActivityResult(0, Activity.RESULT_OK);
assertFalse(fail);
boolean suc = helper.onActivityResult(CameraPickerHelper.REQ_CODE_CAMERA, Activity.RESULT_OK);
Assert.assertTrue(suc);
}
Aggregations