Skip to content

Instantly share code, notes, and snippets.

@frikisama
Created September 15, 2021 20:42
Show Gist options
  • Save frikisama/ff736e69be0a8732735fc34477ab25a8 to your computer and use it in GitHub Desktop.
Save frikisama/ff736e69be0a8732735fc34477ab25a8 to your computer and use it in GitHub Desktop.
Index: app/src/main/java/com/particlesdevs/photoncamera/ui/camera/viewmodel/CameraFragmentViewModel.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/src/main/java/com/particlesdevs/photoncamera/ui/camera/viewmodel/CameraFragmentViewModel.java b/app/src/main/java/com/particlesdevs/photoncamera/ui/camera/viewmodel/CameraFragmentViewModel.java
--- a/app/src/main/java/com/particlesdevs/photoncamera/ui/camera/viewmodel/CameraFragmentViewModel.java (revision 629b98b02c422c94dd4f5fadcc0d18b86c64fc5c)
+++ b/app/src/main/java/com/particlesdevs/photoncamera/ui/camera/viewmodel/CameraFragmentViewModel.java (revision 852519c7d2023afed98a648f8e9b1555bcf77221)
@@ -90,20 +90,20 @@
}
public void updateGalleryThumb() {
- List<File> allFiles = FileManager.getAllImageFiles();
- if (allFiles.isEmpty())
- return;
- File lastImage = allFiles.get(0);
- if (lastImage != null) {
- if (thumbnailThread != null && thumbnailThread.isAlive()) {
- new Handler(thumbnailThread.getLooper()).post(() -> {
+ if (thumbnailThread != null && thumbnailThread.isAlive()) {
+ new Handler(thumbnailThread.getLooper()).post(() -> {
+ List<File> allFiles = FileManager.getAllImageFiles();
+ if (allFiles.isEmpty())
+ return;
+ File lastImage = allFiles.get(0);
+ if (lastImage != null) {
Bitmap bitmap = BitmapDecoder.from(Uri.fromFile(lastImage))
.quality(Quality.LOWEST_OPAQUE)
.scaleBy(0.1f)
.decode();
cameraFragmentModel.setBitmap(bitmap);
- });
- }
+ }
+ });
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment