diff --git a/app/src/main/java/com/dazuoye/filemanager/fileSystem/WrappedFile.kt b/app/src/main/java/com/dazuoye/filemanager/fileSystem/WrappedFile.kt index 8907477..c9ac5c8 100644 --- a/app/src/main/java/com/dazuoye/filemanager/fileSystem/WrappedFile.kt +++ b/app/src/main/java/com/dazuoye/filemanager/fileSystem/WrappedFile.kt @@ -27,7 +27,7 @@ class WrappedFile(private val f: File, skipCalculateDirectorySize: Boolean = fal var unit = SizeUnit.B while (sizeFirst > 1024u && unit != SizeUnit.GB) { - sizeLast = size.mod(1024u).toInt() + sizeLast = sizeFirst.mod(1024u).toInt() sizeFirst /= 1024u unit = when (unit) { SizeUnit.B -> SizeUnit.KB diff --git a/app/src/main/java/com/dazuoye/filemanager/fileSystem/adapters/Image.kt b/app/src/main/java/com/dazuoye/filemanager/fileSystem/adapters/Image.kt index c24efca..9251516 100644 --- a/app/src/main/java/com/dazuoye/filemanager/fileSystem/adapters/Image.kt +++ b/app/src/main/java/com/dazuoye/filemanager/fileSystem/adapters/Image.kt @@ -2,6 +2,7 @@ package com.dazuoye.filemanager.fileSystem.adapters import android.content.Context import android.graphics.Bitmap +import android.graphics.BitmapFactory import android.media.ThumbnailUtils import android.util.Size import android.view.LayoutInflater @@ -25,7 +26,7 @@ class ImageModel(image: File) { if (!image.isFile) { throw RuntimeException("No such Image") } - thumbnail = ThumbnailUtils.createImageThumbnail(image, Size(512, 512), null) + thumbnail = ThumbnailUtils.createImageThumbnail(image, Size(80, 120), null) } } diff --git a/app/src/main/java/com/dazuoye/filemanager/picture_page.kt b/app/src/main/java/com/dazuoye/filemanager/picture_page.kt index d32960d..03d91d5 100644 --- a/app/src/main/java/com/dazuoye/filemanager/picture_page.kt +++ b/app/src/main/java/com/dazuoye/filemanager/picture_page.kt @@ -291,4 +291,9 @@ class picture_page : AppCompatActivity() { loadingText(loadingTextView, defaultText, next) } } + + override fun onDestroy() { + super.onDestroy() + System.gc() + } } \ No newline at end of file diff --git a/app/src/main/rust/libfshelper/src/lib.rs b/app/src/main/rust/libfshelper/src/lib.rs index cde4892..3ba2d42 100644 --- a/app/src/main/rust/libfshelper/src/lib.rs +++ b/app/src/main/rust/libfshelper/src/lib.rs @@ -15,7 +15,7 @@ pub extern "system" fn Java_com_dazuoye_filemanager_utils_FSHelper_getFolderSize .expect("failed to parse input") .into(); - if !fs::exists(&dir).expect(format!("Cannot stat {}", dir).as_str()) { + if !fs::exists(&dir).expect(format!("Cannot stat {dir}").as_str()) { return env .new_string(format!("{} not exists!", dir)) .expect("Couldn't create java string!") @@ -30,7 +30,7 @@ pub extern "system" fn Java_com_dazuoye_filemanager_utils_FSHelper_getFolderSize match item.metadata() { Ok(metadata) => size += metadata.len(), Err(e) => { - eprintln!("Error getting metadata for item: {:?}", e); + eprintln!("Error getting metadata for item: {e:?}"); continue; } }