优化细节
This commit is contained in:
@@ -55,7 +55,10 @@ public class CaptureActivity extends AppCompatActivity implements OnCaptureCallb
|
||||
*/
|
||||
public void initUI(){
|
||||
surfaceView = findViewById(getSurfaceViewId());
|
||||
viewfinderView = findViewById(getViewfinderViewId());
|
||||
int viewfinderViewId = getViewfinderViewId();
|
||||
if(viewfinderViewId != 0){
|
||||
viewfinderView = findViewById(viewfinderViewId);
|
||||
}
|
||||
int ivTorchId = getIvTorchId();
|
||||
if(ivTorchId != 0){
|
||||
ivTorch = findViewById(ivTorchId);
|
||||
@@ -88,7 +91,7 @@ public class CaptureActivity extends AppCompatActivity implements OnCaptureCallb
|
||||
|
||||
/**
|
||||
* {@link #viewfinderView} 的 ID
|
||||
* @return
|
||||
* @return 默认返回{@code R.id.viewfinderView}, 如果不需要扫码框可以返回0
|
||||
*/
|
||||
public int getViewfinderViewId(){
|
||||
return R.id.viewfinderView;
|
||||
|
||||
Reference in New Issue
Block a user