From 49103cc405f08eedcf060da0824f6f24f7b76b8b Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 11 Oct 2021 22:57:09 +0200 Subject: [PATCH] show the videos size too --- .../pro/fragments/StorageFragment.kt | 9 ++++- app/src/main/res/layout/storage_fragment.xml | 34 +++++++++++++++++-- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/StorageFragment.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/StorageFragment.kt index a04f7570..f3e37ddb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/StorageFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/StorageFragment.kt @@ -30,6 +30,9 @@ class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPage activity.runOnUiThread { images_size.text = imagesSize.formatSize() images_progressbar.progress = (imagesSize / 1000000).toInt() + + videos_size.text = videosSize.formatSize() + videos_progressbar.progress = (videosSize / 1000000).toInt() } } } @@ -45,6 +48,10 @@ class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPage val redColor = context.resources.getColor(R.color.md_red_700) images_progressbar.setIndicatorColor(redColor) images_progressbar.trackColor = redColor.adjustAlpha(0.3f) + + val greenColor = context.resources.getColor(R.color.md_green_700) + videos_progressbar.setIndicatorColor(greenColor) + videos_progressbar.trackColor = greenColor.adjustAlpha(0.3f) } private fun getMediaTypeSize(uri: Uri): Long { @@ -82,7 +89,7 @@ class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPage val freeSpace = storageStatsManager.getFreeBytes(uuid) activity.runOnUiThread { - arrayOf(main_storage_usage_progressbar, images_progressbar).forEach { + arrayOf(main_storage_usage_progressbar, images_progressbar, videos_progressbar).forEach { it.max = (totalSpace / 1000000).toInt() } diff --git a/app/src/main/res/layout/storage_fragment.xml b/app/src/main/res/layout/storage_fragment.xml index c0304c61..e25d2840 100644 --- a/app/src/main/res/layout/storage_fragment.xml +++ b/app/src/main/res/layout/storage_fragment.xml @@ -52,7 +52,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/total_space" - android:layout_marginTop="@dimen/big_text_size" + android:layout_marginTop="@dimen/big_margin" android:text="@string/images" android:textSize="@dimen/bigger_text_size" /> @@ -62,7 +62,7 @@ android:layout_height="wrap_content" android:layout_below="@+id/total_space" android:layout_alignParentEnd="true" - android:layout_marginTop="@dimen/big_text_size" + android:layout_marginTop="@dimen/big_margin" android:alpha="0.7" android:textSize="@dimen/normal_text_size" tools:text="20 GB" /> @@ -77,4 +77,34 @@ android:max="100" app:trackThickness="2dp" /> + + + + + +