updated sample

pull/84/head
florent champigny 7 years ago
parent 9a247ea050
commit 9b395b0019
  1. 4
      app/src/main/AndroidManifest.xml
  2. 8
      app/src/main/java/com/github/florent37/camerafragment/sample/CameraFragmentMainActivity.java
  3. 8
      app/src/main/java/com/github/florent37/camerafragment/sample/CameraFragmentMainActivityCustoms.java
  4. 0
      app/src/main/res/layout/camerafragment_activity_main.xml
  5. 0
      app/src/main/res/layout/camerafragment_activity_main_customs.xml
  6. 0
      app/src/main/res/layout/camerafragment_sample_widgets.xml

@ -21,13 +21,13 @@
android:theme="@style/ThemeFullscreen" />
<activity
android:name="com.github.florent37.camerafragment.sample.MainActivityCustoms"
android:name="com.github.florent37.camerafragment.sample.CameraFragmentMainActivityCustoms"
android:screenOrientation="portrait"
android:theme="@style/ThemeFullscreen" >
</activity>
<activity
android:name="com.github.florent37.camerafragment.sample.MainActivity"
android:name="com.github.florent37.camerafragment.sample.CameraFragmentMainActivity"
android:screenOrientation="portrait"
android:theme="@style/ThemeFullscreen" >
<intent-filter>

@ -34,7 +34,7 @@ import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class MainActivity extends AppCompatActivity {
public class CameraFragmentMainActivity extends AppCompatActivity {
public static final String FRAGMENT_TAG = "camera";
private static final int REQUEST_CAMERA_PERMISSIONS = 931;
@ -63,7 +63,7 @@ public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setContentView(R.layout.camerafragment_activity_main);
ButterKnife.bind(this);
}
@ -165,13 +165,13 @@ public class MainActivity extends AppCompatActivity {
//cameraFragment.setResultListener(new CameraFragmentResultListener() {
// @Override
// public void onVideoRecorded(String filePath) {
// Intent intent = PreviewActivity.newIntentVideo(MainActivity.this, filePath);
// Intent intent = PreviewActivity.newIntentVideo(CameraFragmentMainActivity.this, filePath);
// startActivityForResult(intent, REQUEST_PREVIEW_CODE);
// }
//
// @Override
// public void onPhotoTaken(byte[] bytes, String filePath) {
// Intent intent = PreviewActivity.newIntentPhoto(MainActivity.this, filePath);
// Intent intent = PreviewActivity.newIntentPhoto(CameraFragmentMainActivity.this, filePath);
// startActivityForResult(intent, REQUEST_PREVIEW_CODE);
// }
//});

@ -28,7 +28,7 @@ import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class MainActivityCustoms extends AppCompatActivity {
public class CameraFragmentMainActivityCustoms extends AppCompatActivity {
private static final int REQUEST_CAMERA_PERMISSIONS = 931;
private static final int REQUEST_PREVIEW_CODE = 1001;
@ -47,7 +47,7 @@ public class MainActivityCustoms extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_customs);
setContentView(R.layout.camerafragment_activity_main_customs);
ButterKnife.bind(this);
}
@ -71,13 +71,13 @@ public class MainActivityCustoms extends AppCompatActivity {
cameraFragment.setResultListener(new CameraFragmentResultListener() {
@Override
public void onVideoRecorded(String filePath) {
Intent intent = PreviewActivity.newIntentVideo(MainActivityCustoms.this, filePath);
Intent intent = PreviewActivity.newIntentVideo(CameraFragmentMainActivityCustoms.this, filePath);
startActivityForResult(intent, REQUEST_PREVIEW_CODE);
}
@Override
public void onPhotoTaken(byte[] bytes, String filePath) {
Intent intent = PreviewActivity.newIntentPhoto(MainActivityCustoms.this, filePath);
Intent intent = PreviewActivity.newIntentPhoto(CameraFragmentMainActivityCustoms.this, filePath);
startActivityForResult(intent, REQUEST_PREVIEW_CODE);
}
});
Loading…
Cancel
Save