Skip to content

Commit cc58ea1

Browse files
committed
make the storage analyzer items clickable
1 parent 0961ceb commit cc58ea1

File tree

2 files changed

+274
-198
lines changed

2 files changed

+274
-198
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/StorageFragment.kt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ package com.simplemobiletools.filemanager.pro.fragments
33
import android.annotation.SuppressLint
44
import android.app.usage.StorageStatsManager
55
import android.content.Context
6+
import android.content.Intent
67
import android.os.storage.StorageManager
78
import android.provider.MediaStore
9+
import android.provider.Settings
810
import android.util.AttributeSet
911
import androidx.appcompat.app.AppCompatActivity
1012
import com.simplemobiletools.commons.extensions.*
@@ -16,6 +18,7 @@ import kotlinx.android.synthetic.main.storage_fragment.view.*
1618
import java.util.*
1719
import kotlin.collections.HashMap
1820

21+
1922
class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerFragment(context, attributeSet) {
2023
private val IMAGES = "images"
2124
private val VIDEOS = "videos"
@@ -82,6 +85,22 @@ class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
8285
others_progressbar.progress = (othersSize / SIZE_DIVIDER).toInt()
8386
}
8487
}
88+
89+
free_space_holder.setOnClickListener {
90+
try {
91+
val storageSettingsIntent = Intent(Settings.ACTION_INTERNAL_STORAGE_SETTINGS)
92+
activity.startActivity(storageSettingsIntent)
93+
} catch (e: Exception) {
94+
activity.showErrorToast(e)
95+
}
96+
}
97+
98+
images_holder.setOnClickListener { }
99+
videos_holder.setOnClickListener { }
100+
audio_holder.setOnClickListener { }
101+
documents_holder.setOnClickListener { }
102+
archives_holder.setOnClickListener { }
103+
others_holder.setOnClickListener { }
85104
}
86105

87106
override fun refreshFragment() {}

0 commit comments

Comments
 (0)