stuff
This commit is contained in:
parent
11d14f2517
commit
5aeeee0b44
1 changed files with 18 additions and 8 deletions
|
@ -3,6 +3,7 @@ package com.example.cameraxtestappjava.segpasscamerra;
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.pm.ApplicationInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.graphics.ImageFormat;
|
import android.graphics.ImageFormat;
|
||||||
|
@ -156,7 +157,6 @@ public class Camera2NewLib {
|
||||||
private int mSensorOrientation;
|
private int mSensorOrientation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param activity: The (containing) activity where the Camera is invoked from.
|
* @param activity: The (containing) activity where the Camera is invoked from.
|
||||||
* @param textureView: The View used to show the Camera preview.
|
* @param textureView: The View used to show the Camera preview.
|
||||||
* @param listener: Custom listener to deal with camera and storage permissions.
|
* @param listener: Custom listener to deal with camera and storage permissions.
|
||||||
|
@ -169,7 +169,6 @@ public class Camera2NewLib {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param activity: The (containing) activity where the Camera is invoked from.
|
* @param activity: The (containing) activity where the Camera is invoked from.
|
||||||
* @param textureView: The View used to show the Camera preview.
|
* @param textureView: The View used to show the Camera preview.
|
||||||
* @param listener: Custom listener to deal with camera and storage permissions.
|
* @param listener: Custom listener to deal with camera and storage permissions.
|
||||||
|
@ -714,8 +713,19 @@ public class Camera2NewLib {
|
||||||
* Creates the custom folder {@link Camera2NewLib#mFileFolder} where pictures are saved.
|
* Creates the custom folder {@link Camera2NewLib#mFileFolder} where pictures are saved.
|
||||||
*/
|
*/
|
||||||
public void createFolder() {
|
public void createFolder() {
|
||||||
|
PackageManager pm = mActivity.getPackageManager();
|
||||||
|
String folderName;
|
||||||
|
|
||||||
|
try {
|
||||||
|
ApplicationInfo ai = pm.getApplicationInfo(mActivity.getPackageName(), 0);
|
||||||
|
folderName = pm.getApplicationLabel(ai).toString();
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e(TAG, "Can't find the package name.");
|
||||||
|
folderName = "CustomCameraLibraryFolder";
|
||||||
|
}
|
||||||
|
|
||||||
File folder = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
|
File folder = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
|
||||||
mFileFolder = new File(folder, "Camera2TestAppAgain");
|
mFileFolder = new File(folder, folderName);
|
||||||
if (!mFileFolder.exists()) {
|
if (!mFileFolder.exists()) {
|
||||||
mFileFolder.mkdirs();
|
mFileFolder.mkdirs();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue