From 997a44f857321488011fce4ff915194705716cfe Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 11 Oct 2021 16:06:12 +0200 Subject: [PATCH] adding some size fetching into the Storage fragment --- .../filemanager/pro/fragments/StorageFragment.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 acdb7c86..5e92089a 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 @@ -2,14 +2,22 @@ package com.simplemobiletools.filemanager.pro.fragments import android.content.Context import android.net.Uri +import android.os.Environment import android.provider.MediaStore import android.util.AttributeSet import com.simplemobiletools.commons.extensions.getLongValue +import com.simplemobiletools.commons.extensions.getProperSize import com.simplemobiletools.commons.extensions.queryCursor import com.simplemobiletools.filemanager.pro.activities.SimpleActivity class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerFragment(context, attributeSet) { - override fun setupFragment(activity: SimpleActivity) {} + override fun setupFragment(activity: SimpleActivity) { + val imagesSize = getMediaTypeSize(MediaStore.Images.Media.EXTERNAL_CONTENT_URI) + val videosSize = getMediaTypeSize(MediaStore.Video.Media.EXTERNAL_CONTENT_URI) + val audioSize = getMediaTypeSize(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI) + val documents = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS).getProperSize(true) + val downloads = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getProperSize(true) + } override fun refreshFragment() {}