Temp commit

v2
Mattia Iavarone 7 years ago
parent b59bb8800b
commit 6e6714dec4
  1. 13
      demo/src/main/java/com/otaliastudios/cameraview/demo/CameraActivity.java

@ -35,7 +35,8 @@ public class CameraActivity extends AppCompatActivity implements View.OnClickLis
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, getWindow().setFlags(
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
setContentView(R.layout.activity_camera); setContentView(R.layout.activity_camera);
CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE); CameraLogger.setLogLevel(CameraLogger.LEVEL_VERBOSE);
@ -45,12 +46,7 @@ public class CameraActivity extends AppCompatActivity implements View.OnClickLis
camera.addCameraListener(new CameraListener() { camera.addCameraListener(new CameraListener() {
public void onCameraOpened(CameraOptions options) { onOpened(); } public void onCameraOpened(CameraOptions options) { onOpened(); }
public void onPictureTaken(PictureResult result) { onPicture(result); } public void onPictureTaken(PictureResult result) { onPicture(result); }
public void onVideoTaken(VideoResult result) { onVideo(result.getFile()); }
@Override
public void onVideoTaken(VideoResult result) {
super.onVideoTaken(result);
onVideo(result.getFile());
}
}); });
findViewById(R.id.edit).setOnClickListener(this); findViewById(R.id.edit).setOnClickListener(this);
@ -64,7 +60,8 @@ public class CameraActivity extends AppCompatActivity implements View.OnClickLis
Control[] controls = Control.values(); Control[] controls = Control.values();
for (Control control : controls) { for (Control control : controls) {
ControlView view = new ControlView(this, control, this); ControlView view = new ControlView(this, control, this);
group.addView(view, ViewGroup.LayoutParams.MATCH_PARENT, group.addView(view,
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT); ViewGroup.LayoutParams.WRAP_CONTENT);
} }

Loading…
Cancel
Save