GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fixed camera intent issue · JoeView/Android-FilePicker@0a24e8d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • filepicker/src/main/java/droidninja/filepicker
    • cursors/loadercallbacks
      • PhotoDirLoaderCallbacks.java
    • utils
      • ImageCaptureManager.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎filepicker/src/main/java/droidninja/filepicker/cursors/loadercallbacks/PhotoDirLoaderCallbacks.java‎

Copy file name to clipboardExpand all lines: filepicker/src/main/java/droidninja/filepicker/cursors/loadercallbacks/PhotoDirLoaderCallbacks.java
+1-8Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
4242

4343
if (data == null) return;
4444
List<PhotoDirectory> directories = new ArrayList<>();
45-
PhotoDirectory photoDirectoryAll = new PhotoDirectory();
46-
photoDirectoryAll.setName(context.get().getString(R.string.all_images));
47-
photoDirectoryAll.setId("ALL");
4845

4946
while (data.moveToNext()) {
5047

@@ -67,12 +64,8 @@ public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
6764
directories.get(directories.indexOf(photoDirectory)).addPhoto(imageId, fileName, path);
6865
}
6966

70-
photoDirectoryAll.addPhoto(imageId, fileName,path);
7167
}
72-
if (photoDirectoryAll.getPhotoPaths().size() > 0) {
73-
photoDirectoryAll.setCoverPath(photoDirectoryAll.getPhotoPaths().get(0));
74-
}
75-
directories.add(INDEX_ALL_PHOTOS, photoDirectoryAll);
68+
7669
if (resultCallback != null) {
7770
resultCallback.onResultCallback(directories);
7871
}
Collapse file

‎filepicker/src/main/java/droidninja/filepicker/utils/ImageCaptureManager.java‎

Copy file name to clipboardExpand all lines: filepicker/src/main/java/droidninja/filepicker/utils/ImageCaptureManager.java
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import android.os.Bundle;
77
import android.os.Environment;
88
import android.provider.MediaStore;
9+
import android.provider.Settings;
910
import android.text.TextUtils;
1011
import android.util.Log;
1112

@@ -30,8 +31,8 @@ public ImageCaptureManager(Context mContext) {
3031

3132
private File createImageFile() throws IOException {
3233
// Create an image file name
33-
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.ENGLISH).format(new Date());
34-
String imageFileName = "JPEG_" + timeStamp + ".jpg";
34+
// String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.ENGLISH).format(new Date());
35+
String imageFileName = "JPEG_" + System.currentTimeMillis() + ".jpg";
3536
File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
3637

3738
if (!storageDir.exists()) {
@@ -59,6 +60,7 @@ public Intent dispatchTakePictureIntent() throws IOException {
5960
// Ensure that there's a camera activity to handle the intent
6061
if (takePictureIntent.resolveActivity(mContext.getPackageManager()) != null) {
6162
// Create the File where the photo should go
63+
takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(createImageFile()));
6264
return takePictureIntent;
6365
}
6466
return null;
@@ -77,7 +79,7 @@ public void galleryAddPic(Context context) {
7779
mediaScanIntent.setData(contentUri);
7880
mContext.sendBroadcast(mediaScanIntent);
7981

80-
notifyMediaStoreScanner(context, f);
82+
// notifyMediaStoreScanner(context, f);
8183
}
8284

8385
public final void notifyMediaStoreScanner(Context mContext, final File file) {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.