make image loading work again
This commit is contained in:
parent
9043b99914
commit
df839b4c03
1 changed files with 3 additions and 2 deletions
|
@ -151,7 +151,7 @@ public class ItemDetailFragment extends FragmentBase<FragmentItemDetailBinding>
|
|||
var fileName = image.getPath().substring(image.getPath().lastIndexOf('/'));
|
||||
var path = this.requireActivity().getCacheDir().getAbsolutePath();
|
||||
new File(path, "images").mkdirs();
|
||||
path += new File(new File(path, "images"), fileName);
|
||||
path += "/images/" + fileName;
|
||||
|
||||
// TODO: check if there is a better buffer size to use
|
||||
// ideally I would use {@link java.nio.file.Files#copy(InputStream, Path, CopyOption...)} but it is not available on API level 21
|
||||
|
@ -177,7 +177,8 @@ public class ItemDetailFragment extends FragmentBase<FragmentItemDetailBinding>
|
|||
private Optional<Bitmap> getImageIfPresent(@NonNull URI uri) {
|
||||
var fileName = uri.getPath().substring(uri.getPath().lastIndexOf('/'));
|
||||
var path = this.requireActivity().getCacheDir().getAbsolutePath();
|
||||
var file = new File(new File(path, "images"), fileName);
|
||||
path += "/images/" + fileName;
|
||||
var file = new File(path);
|
||||
// Check if the image is present in the cache
|
||||
if (file.exists()) {
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue