make the whole storage analyzer scrollable

This commit is contained in:
tibbi 2021-10-13 11:12:34 +02:00
parent cc58ea1b87
commit 7c02fe8e90
2 changed files with 260 additions and 249 deletions

View File

@ -18,7 +18,6 @@ import kotlinx.android.synthetic.main.storage_fragment.view.*
import java.util.* import java.util.*
import kotlin.collections.HashMap import kotlin.collections.HashMap
class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerFragment(context, attributeSet) { class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerFragment(context, attributeSet) {
private val IMAGES = "images" private val IMAGES = "images"
private val VIDEOS = "videos" private val VIDEOS = "videos"

View File

@ -4,284 +4,296 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/storage_fragment" android:id="@+id/storage_fragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
tools:ignore="RelativeOverlap">
<RelativeLayout <ScrollView
android:id="@+id/free_space_holder" android:id="@+id/storage_scrollview"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:background="?attr/selectableItemBackground"
android:paddingStart="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView <RelativeLayout
android:id="@+id/free_space_value" android:id="@+id/storage_holder"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/storage_free_space_text_size" tools:ignore="RelativeOverlap">
tools:text="23 GB" />
<com.simplemobiletools.commons.views.MyTextView <RelativeLayout
android:id="@+id/free_space_label" android:id="@+id/free_space_holder"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_above="@+id/total_space" android:background="?attr/selectableItemBackground"
android:layout_alignBaseline="@+id/free_space_value" android:paddingStart="@dimen/activity_margin"
android:layout_alignBottom="@+id/free_space_value" android:paddingTop="@dimen/activity_margin"
android:layout_marginStart="@dimen/medium_margin" android:paddingEnd="@dimen/activity_margin">
android:layout_toEndOf="@+id/free_space_value"
android:text="@string/storage_free"
android:textSize="@dimen/big_text_size"
android:visibility="invisible" />
<com.google.android.material.progressindicator.LinearProgressIndicator <com.simplemobiletools.commons.views.MyTextView
android:id="@+id/main_storage_usage_progressbar" android:id="@+id/free_space_value"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/free_space_value" android:textSize="@dimen/storage_free_space_text_size"
android:layout_marginTop="@dimen/medium_margin" tools:text="23 GB" />
android:layout_marginBottom="@dimen/medium_margin"
android:max="100"
android:visibility="invisible"
app:trackThickness="4dp" />
<com.simplemobiletools.commons.views.MyTextView <com.simplemobiletools.commons.views.MyTextView
android:id="@+id/total_space" android:id="@+id/free_space_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/main_storage_usage_progressbar" android:layout_above="@+id/total_space"
android:layout_marginBottom="@dimen/big_margin" android:layout_alignBaseline="@+id/free_space_value"
android:textSize="@dimen/big_text_size" android:layout_alignBottom="@+id/free_space_value"
tools:text="Total storage: 64 GB" /> android:layout_marginStart="@dimen/medium_margin"
</RelativeLayout> android:layout_toEndOf="@+id/free_space_value"
android:text="@string/storage_free"
android:textSize="@dimen/big_text_size"
android:visibility="invisible" />
<RelativeLayout <com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/images_holder" android:id="@+id/main_storage_usage_progressbar"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/free_space_holder" android:layout_below="@+id/free_space_value"
android:background="?attr/selectableItemBackground" android:layout_marginTop="@dimen/medium_margin"
android:paddingStart="@dimen/activity_margin" android:layout_marginBottom="@dimen/medium_margin"
android:paddingTop="@dimen/normal_margin" android:max="100"
android:paddingEnd="@dimen/activity_margin" android:visibility="invisible"
android:paddingBottom="@dimen/normal_margin"> app:trackThickness="4dp" />
<com.simplemobiletools.commons.views.MyTextView <com.simplemobiletools.commons.views.MyTextView
android:id="@+id/images_label" 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:text="@string/images" android:layout_below="@+id/main_storage_usage_progressbar"
android:textSize="@dimen/bigger_text_size" /> android:layout_marginBottom="@dimen/big_margin"
android:textSize="@dimen/big_text_size"
tools:text="Total storage: 64 GB" />
</RelativeLayout>
<com.simplemobiletools.commons.views.MyTextView <RelativeLayout
android:id="@+id/images_size" android:id="@+id/images_holder"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_below="@+id/free_space_holder"
android:alpha="0.7" android:background="?attr/selectableItemBackground"
android:textSize="@dimen/normal_text_size" android:paddingStart="@dimen/activity_margin"
tools:text="20 GB" /> android:paddingTop="@dimen/normal_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/normal_margin">
<com.google.android.material.progressindicator.LinearProgressIndicator <com.simplemobiletools.commons.views.MyTextView
android:id="@+id/images_progressbar" android:id="@+id/images_label"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/images_label" android:text="@string/images"
android:layout_marginTop="@dimen/medium_margin" android:textSize="@dimen/bigger_text_size" />
android:layout_marginBottom="@dimen/medium_margin"
android:max="100"
app:trackThickness="2dp" />
</RelativeLayout>
<RelativeLayout <com.simplemobiletools.commons.views.MyTextView
android:id="@+id/videos_holder" android:id="@+id/images_size"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/images_holder" android:layout_alignParentEnd="true"
android:background="?attr/selectableItemBackground" android:alpha="0.7"
android:paddingStart="@dimen/activity_margin" android:textSize="@dimen/normal_text_size"
android:paddingTop="@dimen/normal_margin" tools:text="20 GB" />
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/normal_margin">
<com.simplemobiletools.commons.views.MyTextView <com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/videos_label" android:id="@+id/images_progressbar"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/videos" android:layout_below="@+id/images_label"
android:textSize="@dimen/bigger_text_size" /> android:layout_marginTop="@dimen/medium_margin"
android:layout_marginBottom="@dimen/medium_margin"
android:max="100"
app:trackThickness="2dp" />
</RelativeLayout>
<com.simplemobiletools.commons.views.MyTextView <RelativeLayout
android:id="@+id/videos_size" android:id="@+id/videos_holder"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_below="@+id/images_holder"
android:alpha="0.7" android:background="?attr/selectableItemBackground"
android:textSize="@dimen/normal_text_size" android:paddingStart="@dimen/activity_margin"
tools:text="20 GB" /> android:paddingTop="@dimen/normal_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/normal_margin">
<com.google.android.material.progressindicator.LinearProgressIndicator <com.simplemobiletools.commons.views.MyTextView
android:id="@+id/videos_progressbar" android:id="@+id/videos_label"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/videos_label" android:text="@string/videos"
android:layout_marginTop="@dimen/medium_margin" android:textSize="@dimen/bigger_text_size" />
android:layout_marginBottom="@dimen/medium_margin"
android:max="100"
app:trackThickness="2dp" />
</RelativeLayout>
<RelativeLayout <com.simplemobiletools.commons.views.MyTextView
android:id="@+id/audio_holder" android:id="@+id/videos_size"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/videos_holder" android:layout_alignParentEnd="true"
android:background="?attr/selectableItemBackground" android:alpha="0.7"
android:paddingStart="@dimen/activity_margin" android:textSize="@dimen/normal_text_size"
android:paddingTop="@dimen/normal_margin" tools:text="20 GB" />
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/normal_margin">
<com.simplemobiletools.commons.views.MyTextView <com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/audio_label" android:id="@+id/videos_progressbar"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/audio" android:layout_below="@+id/videos_label"
android:textSize="@dimen/bigger_text_size" /> android:layout_marginTop="@dimen/medium_margin"
android:layout_marginBottom="@dimen/medium_margin"
android:max="100"
app:trackThickness="2dp" />
</RelativeLayout>
<com.simplemobiletools.commons.views.MyTextView <RelativeLayout
android:id="@+id/audio_size" android:id="@+id/audio_holder"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_below="@+id/videos_holder"
android:alpha="0.7" android:background="?attr/selectableItemBackground"
android:textSize="@dimen/normal_text_size" android:paddingStart="@dimen/activity_margin"
tools:text="20 GB" /> android:paddingTop="@dimen/normal_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/normal_margin">
<com.google.android.material.progressindicator.LinearProgressIndicator <com.simplemobiletools.commons.views.MyTextView
android:id="@+id/audio_progressbar" android:id="@+id/audio_label"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/audio_label" android:text="@string/audio"
android:layout_marginTop="@dimen/medium_margin" android:textSize="@dimen/bigger_text_size" />
android:layout_marginBottom="@dimen/medium_margin"
android:max="100"
app:trackThickness="2dp" />
</RelativeLayout>
<RelativeLayout <com.simplemobiletools.commons.views.MyTextView
android:id="@+id/documents_holder" android:id="@+id/audio_size"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/audio_holder" android:layout_alignParentEnd="true"
android:background="?attr/selectableItemBackground" android:alpha="0.7"
android:paddingStart="@dimen/activity_margin" android:textSize="@dimen/normal_text_size"
android:paddingTop="@dimen/normal_margin" tools:text="20 GB" />
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/normal_margin">
<com.simplemobiletools.commons.views.MyTextView <com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/documents_label" android:id="@+id/audio_progressbar"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/documents" android:layout_below="@+id/audio_label"
android:textSize="@dimen/bigger_text_size" /> android:layout_marginTop="@dimen/medium_margin"
android:layout_marginBottom="@dimen/medium_margin"
android:max="100"
app:trackThickness="2dp" />
</RelativeLayout>
<com.simplemobiletools.commons.views.MyTextView <RelativeLayout
android:id="@+id/documents_size" android:id="@+id/documents_holder"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_below="@+id/audio_holder"
android:alpha="0.7" android:background="?attr/selectableItemBackground"
android:textSize="@dimen/normal_text_size" android:paddingStart="@dimen/activity_margin"
tools:text="20 GB" /> android:paddingTop="@dimen/normal_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/normal_margin">
<com.google.android.material.progressindicator.LinearProgressIndicator <com.simplemobiletools.commons.views.MyTextView
android:id="@+id/documents_progressbar" android:id="@+id/documents_label"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/documents_label" android:text="@string/documents"
android:layout_marginTop="@dimen/medium_margin" android:textSize="@dimen/bigger_text_size" />
android:layout_marginBottom="@dimen/medium_margin"
android:max="100"
app:trackThickness="2dp" />
</RelativeLayout>
<RelativeLayout <com.simplemobiletools.commons.views.MyTextView
android:id="@+id/archives_holder" android:id="@+id/documents_size"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/documents_holder" android:layout_alignParentEnd="true"
android:background="?attr/selectableItemBackground" android:alpha="0.7"
android:paddingStart="@dimen/activity_margin" android:textSize="@dimen/normal_text_size"
android:paddingTop="@dimen/normal_margin" tools:text="20 GB" />
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/normal_margin">
<com.simplemobiletools.commons.views.MyTextView <com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/archives_label" android:id="@+id/documents_progressbar"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/archives" android:layout_below="@+id/documents_label"
android:textSize="@dimen/bigger_text_size" /> android:layout_marginTop="@dimen/medium_margin"
android:layout_marginBottom="@dimen/medium_margin"
android:max="100"
app:trackThickness="2dp" />
</RelativeLayout>
<com.simplemobiletools.commons.views.MyTextView <RelativeLayout
android:id="@+id/archives_size" android:id="@+id/archives_holder"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_below="@+id/documents_holder"
android:alpha="0.7" android:background="?attr/selectableItemBackground"
android:textSize="@dimen/normal_text_size" android:paddingStart="@dimen/activity_margin"
tools:text="20 GB" /> android:paddingTop="@dimen/normal_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/normal_margin">
<com.google.android.material.progressindicator.LinearProgressIndicator <com.simplemobiletools.commons.views.MyTextView
android:id="@+id/archives_progressbar" android:id="@+id/archives_label"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/archives_label" android:text="@string/archives"
android:layout_marginTop="@dimen/medium_margin" android:textSize="@dimen/bigger_text_size" />
android:layout_marginBottom="@dimen/medium_margin"
android:max="100"
app:trackThickness="2dp" />
</RelativeLayout>
<RelativeLayout <com.simplemobiletools.commons.views.MyTextView
android:id="@+id/others_holder" android:id="@+id/archives_size"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/archives_holder" android:layout_alignParentEnd="true"
android:background="?attr/selectableItemBackground" android:alpha="0.7"
android:paddingStart="@dimen/activity_margin" android:textSize="@dimen/normal_text_size"
android:paddingTop="@dimen/normal_margin" tools:text="20 GB" />
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/normal_margin">
<com.simplemobiletools.commons.views.MyTextView <com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/others_label" android:id="@+id/archives_progressbar"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/others" android:layout_below="@+id/archives_label"
android:textSize="@dimen/bigger_text_size" /> android:layout_marginTop="@dimen/medium_margin"
android:layout_marginBottom="@dimen/medium_margin"
android:max="100"
app:trackThickness="2dp" />
</RelativeLayout>
<com.simplemobiletools.commons.views.MyTextView <RelativeLayout
android:id="@+id/others_size" android:id="@+id/others_holder"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_below="@+id/archives_holder"
android:alpha="0.7" android:background="?attr/selectableItemBackground"
android:textSize="@dimen/normal_text_size" android:paddingStart="@dimen/activity_margin"
tools:text="20 GB" /> android:paddingTop="@dimen/normal_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/normal_margin">
<com.google.android.material.progressindicator.LinearProgressIndicator <com.simplemobiletools.commons.views.MyTextView
android:id="@+id/others_progressbar" android:id="@+id/others_label"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/others_label" android:text="@string/others"
android:layout_marginTop="@dimen/medium_margin" android:textSize="@dimen/bigger_text_size" />
android:layout_marginBottom="@dimen/medium_margin"
android:max="100" <com.simplemobiletools.commons.views.MyTextView
app:trackThickness="2dp" /> android:id="@+id/others_size"
</RelativeLayout> android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:alpha="0.7"
android:textSize="@dimen/normal_text_size"
tools:text="20 GB" />
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/others_progressbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/others_label"
android:layout_marginTop="@dimen/medium_margin"
android:layout_marginBottom="@dimen/medium_margin"
android:max="100"
app:trackThickness="2dp" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>
</com.simplemobiletools.filemanager.pro.fragments.StorageFragment> </com.simplemobiletools.filemanager.pro.fragments.StorageFragment>