Skip to content

Commit

Permalink
Allow CaptureStrategy to specify Pictures subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
oxc authored and REBOOTERS committed Sep 14, 2018
1 parent 1336b7c commit 2687f00
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ public class CaptureStrategy {

public final boolean isPublic;
public final String authority;
public final String directory;

public CaptureStrategy(boolean isPublic, String authority) {
this(isPublic, authority, null);
}

public CaptureStrategy(boolean isPublic, String authority, String directory) {
this.isPublic = isPublic;
this.authority = authority;
this.directory = directory;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ private File createImageFile() throws IOException {
} else {
storageDir = mContext.get().getExternalFilesDir(Environment.DIRECTORY_PICTURES);
}
if (mCaptureStrategy.directory != null) {
storageDir = new File(storageDir, mCaptureStrategy.directory);
}

// Avoid joining path components manually
File tempFile = new File(storageDir, imageFileName);
Expand Down

0 comments on commit 2687f00

Please sign in to comment.