diff --git a/build.gradle b/build.gradle index e293b0d3..db868459 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.1.0-alpha3' + classpath 'com.android.tools.build:gradle:2.1.0-alpha4' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/demo/src/main/AndroidManifest.xml b/demo/src/main/AndroidManifest.xml index 912faf5d..59065aba 100644 --- a/demo/src/main/AndroidManifest.xml +++ b/demo/src/main/AndroidManifest.xml @@ -14,12 +14,14 @@ + + + android:theme="@style/Theme.Demo"> diff --git a/demo/src/main/java/com/google/android/cameraview/demo/MainActivity.java b/demo/src/main/java/com/google/android/cameraview/demo/MainActivity.java index 76be2b55..1dbcad50 100644 --- a/demo/src/main/java/com/google/android/cameraview/demo/MainActivity.java +++ b/demo/src/main/java/com/google/android/cameraview/demo/MainActivity.java @@ -16,15 +16,34 @@ package com.google.android.cameraview.demo; +import com.google.android.cameraview.CameraView; + import android.os.Bundle; import android.support.v7.app.AppCompatActivity; public class MainActivity extends AppCompatActivity { + private CameraView mCameraView; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); + mCameraView = (CameraView) findViewById(R.id.camera); + } + + @Override + protected void onResume() { + super.onResume(); + mCameraView.onResume(); + mCameraView.startPreview(); + } + + @Override + protected void onPause() { + mCameraView.stopPreview(); + mCameraView.onPause(); + super.onPause(); } } diff --git a/demo/src/main/res/values/styles.xml b/demo/src/main/res/values/styles.xml index 39a975aa..e4ea791d 100644 --- a/demo/src/main/res/values/styles.xml +++ b/demo/src/main/res/values/styles.xml @@ -14,7 +14,7 @@ -