mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-01-08 05:16:05 +01:00
use the Pictures and Movies folders for saving photos and videos
This commit is contained in:
parent
0021981bcc
commit
a57691bc2a
@ -69,14 +69,20 @@ public class Utils {
|
|||||||
|
|
||||||
private static File getFolderName(Context context, boolean isPhoto) {
|
private static File getFolderName(Context context, boolean isPhoto) {
|
||||||
final Resources res = context.getResources();
|
final Resources res = context.getResources();
|
||||||
final String appName = res.getString(R.string.app_name);
|
|
||||||
final String sharedPath = new File(Environment.getExternalStorageDirectory(), appName).getAbsolutePath();
|
|
||||||
String typeDirectory = res.getString(R.string.photo_directory);
|
String typeDirectory = res.getString(R.string.photo_directory);
|
||||||
if (!isPhoto) {
|
if (!isPhoto) {
|
||||||
typeDirectory = res.getString(R.string.video_directory);
|
typeDirectory = res.getString(R.string.video_directory);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new File(sharedPath, typeDirectory);
|
return new File(getMainDirectory(isPhoto), typeDirectory);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static File getMainDirectory(boolean isPhoto) {
|
||||||
|
String type = Environment.DIRECTORY_MOVIES;
|
||||||
|
if (isPhoto) {
|
||||||
|
type = Environment.DIRECTORY_PICTURES;
|
||||||
|
}
|
||||||
|
return Environment.getExternalStoragePublicDirectory(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void scanFile(String path, Context context) {
|
public static void scanFile(String path, Context context) {
|
||||||
|
Loading…
Reference in New Issue
Block a user