Search in sources :

Example 1 with CameraPickerHelper

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));
}
Also used : BoxingConfig(com.bilibili.boxing.model.config.BoxingConfig) CameraPickerHelper(com.bilibili.boxing.utils.CameraPickerHelper)

Example 2 with CameraPickerHelper

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);
}
Also used : CameraPickerHelper(com.bilibili.boxing.utils.CameraPickerHelper) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test) PrepareOnlyThisForTest(org.powermock.core.classloader.annotations.PrepareOnlyThisForTest)

Aggregations

CameraPickerHelper (com.bilibili.boxing.utils.CameraPickerHelper)2 BoxingConfig (com.bilibili.boxing.model.config.BoxingConfig)1 Test (org.junit.Test)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1 PrepareOnlyThisForTest (org.powermock.core.classloader.annotations.PrepareOnlyThisForTest)1