mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-02-17 04:10:39 +01:00
adding a storage usage progress indicator
This commit is contained in:
parent
17343f5448
commit
1741888d74
@ -70,6 +70,10 @@ class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
|
|||||||
val freeSpace = storageStatsManager.getFreeBytes(uuid)
|
val freeSpace = storageStatsManager.getFreeBytes(uuid)
|
||||||
|
|
||||||
activity.runOnUiThread {
|
activity.runOnUiThread {
|
||||||
|
storage_usage_progressbar.max = (totalSpace / 1000).toInt()
|
||||||
|
storage_usage_progressbar.progress = ((totalSpace - freeSpace) / 1000).toInt()
|
||||||
|
storage_usage_progressbar.beVisible()
|
||||||
|
|
||||||
free_space_value.text = freeSpace.formatSizeThousand()
|
free_space_value.text = freeSpace.formatSizeThousand()
|
||||||
total_space.text = String.format(context.getString(R.string.total_storage), totalSpace.formatSizeThousand())
|
total_space.text = String.format(context.getString(R.string.total_storage), totalSpace.formatSizeThousand())
|
||||||
free_space_label.beVisible()
|
free_space_label.beVisible()
|
||||||
|
@ -26,11 +26,21 @@
|
|||||||
android:textSize="@dimen/big_text_size"
|
android:textSize="@dimen/big_text_size"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
|
android:id="@+id/storage_usage_progressbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/free_space_value"
|
||||||
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
|
android:layout_marginBottom="@dimen/medium_margin"
|
||||||
|
android:max="100"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
android:id="@+id/total_space"
|
android:id="@+id/total_space"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/free_space_value"
|
android:layout_below="@+id/storage_usage_progressbar"
|
||||||
android:textSize="@dimen/big_text_size"
|
android:textSize="@dimen/big_text_size"
|
||||||
tools:text="Total storage: 64 GB" />
|
tools:text="Total storage: 64 GB" />
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user