adding some storage search improvements
This commit is contained in:
parent
bce66e3cde
commit
cd426324df
|
@ -1,6 +1,7 @@
|
||||||
package com.simplemobiletools.filemanager.pro.fragments
|
package com.simplemobiletools.filemanager.pro.fragments
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
|
import android.app.Activity
|
||||||
import android.app.usage.StorageStatsManager
|
import android.app.usage.StorageStatsManager
|
||||||
import android.content.ContentResolver
|
import android.content.ContentResolver
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
@ -31,6 +32,7 @@ import java.util.*
|
||||||
class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerFragment(context, attributeSet), ItemOperationsListener {
|
class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerFragment(context, attributeSet), ItemOperationsListener {
|
||||||
private val SIZE_DIVIDER = 100000
|
private val SIZE_DIVIDER = 100000
|
||||||
private var allDeviceListItems = ArrayList<ListItem>()
|
private var allDeviceListItems = ArrayList<ListItem>()
|
||||||
|
private var lastSearchedText = ""
|
||||||
|
|
||||||
override fun setupFragment(activity: SimpleActivity) {
|
override fun setupFragment(activity: SimpleActivity) {
|
||||||
if (this.activity == null) {
|
if (this.activity == null) {
|
||||||
|
@ -64,7 +66,6 @@ class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
|
||||||
override fun onResume(textColor: Int) {
|
override fun onResume(textColor: Int) {
|
||||||
getSizes()
|
getSizes()
|
||||||
context.updateTextColors(storage_fragment)
|
context.updateTextColors(storage_fragment)
|
||||||
search_holder.setBackgroundColor(context.getProperBackgroundColor())
|
|
||||||
|
|
||||||
val properPrimaryColor = context.getProperPrimaryColor()
|
val properPrimaryColor = context.getProperPrimaryColor()
|
||||||
main_storage_usage_progressbar.setIndicatorColor(properPrimaryColor)
|
main_storage_usage_progressbar.setIndicatorColor(properPrimaryColor)
|
||||||
|
@ -93,6 +94,10 @@ class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
|
||||||
val pinkColor = context.resources.getColor(R.color.md_pink_700)
|
val pinkColor = context.resources.getColor(R.color.md_pink_700)
|
||||||
others_progressbar.setIndicatorColor(pinkColor)
|
others_progressbar.setIndicatorColor(pinkColor)
|
||||||
others_progressbar.trackColor = pinkColor.adjustAlpha(LOWER_ALPHA)
|
others_progressbar.trackColor = pinkColor.adjustAlpha(LOWER_ALPHA)
|
||||||
|
|
||||||
|
search_holder.setBackgroundColor(context.getProperBackgroundColor())
|
||||||
|
progress_bar.setIndicatorColor(properPrimaryColor)
|
||||||
|
progress_bar.trackColor = properPrimaryColor.adjustAlpha(LOWER_ALPHA)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun launchMimetypeActivity(mimetype: String) {
|
private fun launchMimetypeActivity(mimetype: String) {
|
||||||
|
@ -239,6 +244,8 @@ class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun searchQueryChanged(text: String) {
|
override fun searchQueryChanged(text: String) {
|
||||||
|
lastSearchedText = text
|
||||||
|
|
||||||
if (text.isNotEmpty()) {
|
if (text.isNotEmpty()) {
|
||||||
if (search_holder.alpha < 1f) {
|
if (search_holder.alpha < 1f) {
|
||||||
search_holder.fadeIn()
|
search_holder.fadeIn()
|
||||||
|
@ -250,10 +257,31 @@ class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
|
||||||
}.start()
|
}.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (text.isNotEmpty()) {
|
if (text.length == 1) {
|
||||||
val filtered = allDeviceListItems.filter { it.mName.contains(text, true) }.toMutableList() as ArrayList<ListItem>
|
search_results_list.beGone()
|
||||||
(search_results_list.adapter as? ItemsAdapter)?.updateItems(filtered, text)
|
search_placeholder.beVisible()
|
||||||
search_placeholder.beVisibleIf(filtered.isEmpty())
|
search_placeholder_2.beVisible()
|
||||||
|
hideProgressBar()
|
||||||
|
} else if (text.isEmpty()) {
|
||||||
|
search_results_list.beGone()
|
||||||
|
hideProgressBar()
|
||||||
|
} else {
|
||||||
|
showProgressBar()
|
||||||
|
ensureBackgroundThread {
|
||||||
|
val start = System.currentTimeMillis()
|
||||||
|
val filtered = allDeviceListItems.filter { it.mName.contains(text, true) }.toMutableList() as ArrayList<ListItem>
|
||||||
|
if (lastSearchedText != text) {
|
||||||
|
return@ensureBackgroundThread
|
||||||
|
}
|
||||||
|
|
||||||
|
(context as? Activity)?.runOnUiThread {
|
||||||
|
(search_results_list.adapter as? ItemsAdapter)?.updateItems(filtered, text)
|
||||||
|
search_results_list.beVisible()
|
||||||
|
search_placeholder.beVisibleIf(filtered.isEmpty())
|
||||||
|
search_placeholder_2.beGone()
|
||||||
|
hideProgressBar()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -281,7 +309,7 @@ class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addItems() {
|
private fun addItems() {
|
||||||
ItemsAdapter(context as SimpleActivity, allDeviceListItems, this, search_results_list, false, null, false) {
|
ItemsAdapter(context as SimpleActivity, ArrayList(), this, search_results_list, false, null, false) {
|
||||||
clickedPath((it as FileDirItem).path)
|
clickedPath((it as FileDirItem).path)
|
||||||
}.apply {
|
}.apply {
|
||||||
search_results_list.adapter = this
|
search_results_list.adapter = this
|
||||||
|
@ -338,6 +366,14 @@ class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
|
||||||
return fileDirItems
|
return fileDirItems
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun showProgressBar() {
|
||||||
|
progress_bar.show()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun hideProgressBar() {
|
||||||
|
progress_bar.hide()
|
||||||
|
}
|
||||||
|
|
||||||
private fun getRecyclerAdapter() = search_results_list.adapter as? ItemsAdapter
|
private fun getRecyclerAdapter() = search_results_list.adapter as? ItemsAdapter
|
||||||
|
|
||||||
override fun refreshFragment() {
|
override fun refreshFragment() {
|
||||||
|
|
|
@ -6,352 +6,372 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/storage_nested_scrollview"
|
android:id="@+id/storage_holder"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:fillViewport="true">
|
tools:ignore="HardcodedText">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<RelativeLayout
|
||||||
android:id="@+id/storage_holder"
|
android:id="@+id/free_space_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
tools:ignore="HardcodedText">
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:paddingStart="@dimen/activity_margin"
|
||||||
|
android:paddingTop="@dimen/activity_margin"
|
||||||
|
android:paddingEnd="@dimen/activity_margin"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<RelativeLayout
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
android:id="@+id/free_space_holder"
|
android:id="@+id/free_space_value"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="…"
|
||||||
|
android:textSize="@dimen/storage_free_space_text_size"
|
||||||
|
tools:text="23 GB" />
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/free_space_label"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_above="@+id/total_space"
|
||||||
|
android:layout_alignBaseline="@+id/free_space_value"
|
||||||
|
android:layout_alignBottom="@+id/free_space_value"
|
||||||
|
android:layout_marginStart="@dimen/medium_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
|
||||||
|
android:id="@+id/main_storage_usage_progressbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:layout_below="@+id/free_space_value"
|
||||||
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
|
android:layout_marginBottom="@dimen/medium_margin"
|
||||||
|
android:max="100"
|
||||||
|
app:trackThickness="4dp" />
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/total_space"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/main_storage_usage_progressbar"
|
||||||
|
android:layout_marginBottom="@dimen/big_margin"
|
||||||
|
android:textSize="@dimen/big_text_size"
|
||||||
|
tools:text="Total storage: 64 GB" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/images_holder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:paddingStart="@dimen/activity_margin"
|
||||||
|
android:paddingTop="@dimen/normal_margin"
|
||||||
|
android:paddingEnd="@dimen/activity_margin"
|
||||||
|
android:paddingBottom="@dimen/normal_margin"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/free_space_holder">
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/images_label"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_toStartOf="@+id/images_size"
|
||||||
|
android:text="@string/images"
|
||||||
|
android:textSize="@dimen/bigger_text_size" />
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/images_size"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:alpha="0.7"
|
||||||
|
android:text="…"
|
||||||
|
android:textSize="@dimen/normal_text_size"
|
||||||
|
tools:text="20 GB" />
|
||||||
|
|
||||||
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
|
android:id="@+id/images_progressbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/images_label"
|
||||||
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
|
android:layout_marginBottom="@dimen/medium_margin"
|
||||||
|
android:max="100"
|
||||||
|
app:trackThickness="2dp" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/videos_holder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:paddingStart="@dimen/activity_margin"
|
||||||
|
android:paddingTop="@dimen/normal_margin"
|
||||||
|
android:paddingEnd="@dimen/activity_margin"
|
||||||
|
android:paddingBottom="@dimen/normal_margin"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/images_holder">
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/videos_label"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_toStartOf="@+id/videos_size"
|
||||||
|
android:text="@string/videos"
|
||||||
|
android:textSize="@dimen/bigger_text_size" />
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/videos_size"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:alpha="0.7"
|
||||||
|
android:text="…"
|
||||||
|
android:textSize="@dimen/normal_text_size"
|
||||||
|
tools:text="20 GB" />
|
||||||
|
|
||||||
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
|
android:id="@+id/videos_progressbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/videos_label"
|
||||||
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
|
android:layout_marginBottom="@dimen/medium_margin"
|
||||||
|
android:max="100"
|
||||||
|
app:trackThickness="2dp" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/audio_holder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:paddingStart="@dimen/activity_margin"
|
||||||
|
android:paddingTop="@dimen/normal_margin"
|
||||||
|
android:paddingEnd="@dimen/activity_margin"
|
||||||
|
android:paddingBottom="@dimen/normal_margin"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/videos_holder">
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/audio_label"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_toStartOf="@+id/audio_size"
|
||||||
|
android:text="@string/audio"
|
||||||
|
android:textSize="@dimen/bigger_text_size" />
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/audio_size"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:alpha="0.7"
|
||||||
|
android:text="…"
|
||||||
|
android:textSize="@dimen/normal_text_size"
|
||||||
|
tools:text="20 GB" />
|
||||||
|
|
||||||
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
|
android:id="@+id/audio_progressbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/audio_label"
|
||||||
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
|
android:layout_marginBottom="@dimen/medium_margin"
|
||||||
|
android:max="100"
|
||||||
|
app:trackThickness="2dp" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/documents_holder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:paddingStart="@dimen/activity_margin"
|
||||||
|
android:paddingTop="@dimen/normal_margin"
|
||||||
|
android:paddingEnd="@dimen/activity_margin"
|
||||||
|
android:paddingBottom="@dimen/normal_margin"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/audio_holder">
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/documents_label"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_toStartOf="@+id/documents_size"
|
||||||
|
android:text="@string/documents"
|
||||||
|
android:textSize="@dimen/bigger_text_size" />
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/documents_size"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:alpha="0.7"
|
||||||
|
android:text="…"
|
||||||
|
android:textSize="@dimen/normal_text_size"
|
||||||
|
tools:text="20 GB" />
|
||||||
|
|
||||||
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
|
android:id="@+id/documents_progressbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/documents_label"
|
||||||
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
|
android:layout_marginBottom="@dimen/medium_margin"
|
||||||
|
android:max="100"
|
||||||
|
app:trackThickness="2dp" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/archives_holder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:paddingStart="@dimen/activity_margin"
|
||||||
|
android:paddingTop="@dimen/normal_margin"
|
||||||
|
android:paddingEnd="@dimen/activity_margin"
|
||||||
|
android:paddingBottom="@dimen/normal_margin"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/documents_holder">
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/archives_label"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_toStartOf="@+id/archives_size"
|
||||||
|
android:text="@string/archives"
|
||||||
|
android:textSize="@dimen/bigger_text_size" />
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/archives_size"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:alpha="0.7"
|
||||||
|
android:text="…"
|
||||||
|
android:textSize="@dimen/normal_text_size"
|
||||||
|
tools:text="20 GB" />
|
||||||
|
|
||||||
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
|
android:id="@+id/archives_progressbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/archives_label"
|
||||||
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
|
android:layout_marginBottom="@dimen/medium_margin"
|
||||||
|
android:max="100"
|
||||||
|
app:trackThickness="2dp" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/others_holder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:paddingStart="@dimen/activity_margin"
|
||||||
|
android:paddingTop="@dimen/normal_margin"
|
||||||
|
android:paddingEnd="@dimen/activity_margin"
|
||||||
|
android:paddingBottom="@dimen/normal_margin"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/archives_holder">
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/others_label"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_toStartOf="@+id/others_size"
|
||||||
|
android:text="@string/others"
|
||||||
|
android:textSize="@dimen/bigger_text_size" />
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/others_size"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:alpha="0.7"
|
||||||
|
android:text="…"
|
||||||
|
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
|
||||||
|
android:id="@+id/search_holder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:alpha="0"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
|
android:id="@+id/progress_bar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:indeterminate="true"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:hideAnimationBehavior="outward"
|
||||||
|
app:showAnimationBehavior="inward"
|
||||||
|
app:showDelay="250"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/search_placeholder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:alpha="0.8"
|
||||||
|
android:gravity="center"
|
||||||
android:paddingStart="@dimen/activity_margin"
|
android:paddingStart="@dimen/activity_margin"
|
||||||
android:paddingTop="@dimen/activity_margin"
|
android:paddingTop="@dimen/activity_margin"
|
||||||
android:paddingEnd="@dimen/activity_margin"
|
android:paddingEnd="@dimen/activity_margin"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
android:text="@string/no_items_found"
|
||||||
|
android:textSize="@dimen/bigger_text_size"
|
||||||
|
android:textStyle="italic"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
android:id="@+id/free_space_value"
|
android:id="@+id/search_placeholder_2"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="…"
|
|
||||||
android:textSize="@dimen/storage_free_space_text_size"
|
|
||||||
tools:text="23 GB" />
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
|
||||||
android:id="@+id/free_space_label"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_above="@+id/total_space"
|
|
||||||
android:layout_alignBaseline="@+id/free_space_value"
|
|
||||||
android:layout_alignBottom="@+id/free_space_value"
|
|
||||||
android:layout_marginStart="@dimen/medium_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
|
|
||||||
android:id="@+id/main_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"
|
|
||||||
app:trackThickness="4dp" />
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
|
||||||
android:id="@+id/total_space"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/main_storage_usage_progressbar"
|
|
||||||
android:layout_marginBottom="@dimen/big_margin"
|
|
||||||
android:textSize="@dimen/big_text_size"
|
|
||||||
tools:text="Total storage: 64 GB" />
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/images_holder"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/search_placeholder"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:alpha="0.8"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
android:paddingStart="@dimen/activity_margin"
|
android:gravity="center"
|
||||||
android:paddingTop="@dimen/normal_margin"
|
android:padding="@dimen/activity_margin"
|
||||||
android:paddingEnd="@dimen/activity_margin"
|
android:text="@string/type_2_characters"
|
||||||
android:paddingBottom="@dimen/normal_margin"
|
android:textSize="@dimen/bigger_text_size"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/free_space_holder">
|
android:textStyle="italic"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
<com.simplemobiletools.commons.views.MyRecyclerView
|
||||||
android:id="@+id/images_label"
|
android:id="@+id/search_results_list"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_toStartOf="@+id/images_size"
|
|
||||||
android:text="@string/images"
|
|
||||||
android:textSize="@dimen/bigger_text_size" />
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
|
||||||
android:id="@+id/images_size"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:alpha="0.7"
|
|
||||||
android:text="…"
|
|
||||||
android:textSize="@dimen/normal_text_size"
|
|
||||||
tools:text="20 GB" />
|
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
|
||||||
android:id="@+id/images_progressbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/images_label"
|
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
|
||||||
android:layout_marginBottom="@dimen/medium_margin"
|
|
||||||
android:max="100"
|
|
||||||
app:trackThickness="2dp" />
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/videos_holder"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:layout_alignParentTop="true"
|
||||||
android:paddingStart="@dimen/activity_margin"
|
android:layout_alignParentBottom="true"
|
||||||
android:paddingTop="@dimen/normal_margin"
|
android:clipToPadding="false"
|
||||||
android:paddingEnd="@dimen/activity_margin"
|
android:layoutAnimation="@anim/layout_animation"
|
||||||
android:paddingBottom="@dimen/normal_margin"
|
android:paddingTop="@dimen/small_margin"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/images_holder">
|
android:scrollbars="none"
|
||||||
|
app:layoutManager="com.simplemobiletools.commons.views.MyGridLayoutManager" />
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
</RelativeLayout>
|
||||||
android:id="@+id/videos_label"
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_toStartOf="@+id/videos_size"
|
|
||||||
android:text="@string/videos"
|
|
||||||
android:textSize="@dimen/bigger_text_size" />
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
|
||||||
android:id="@+id/videos_size"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:alpha="0.7"
|
|
||||||
android:text="…"
|
|
||||||
android:textSize="@dimen/normal_text_size"
|
|
||||||
tools:text="20 GB" />
|
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
|
||||||
android:id="@+id/videos_progressbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/videos_label"
|
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
|
||||||
android:layout_marginBottom="@dimen/medium_margin"
|
|
||||||
android:max="100"
|
|
||||||
app:trackThickness="2dp" />
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/audio_holder"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="?attr/selectableItemBackground"
|
|
||||||
android:paddingStart="@dimen/activity_margin"
|
|
||||||
android:paddingTop="@dimen/normal_margin"
|
|
||||||
android:paddingEnd="@dimen/activity_margin"
|
|
||||||
android:paddingBottom="@dimen/normal_margin"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/videos_holder">
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
|
||||||
android:id="@+id/audio_label"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_toStartOf="@+id/audio_size"
|
|
||||||
android:text="@string/audio"
|
|
||||||
android:textSize="@dimen/bigger_text_size" />
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
|
||||||
android:id="@+id/audio_size"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:alpha="0.7"
|
|
||||||
android:text="…"
|
|
||||||
android:textSize="@dimen/normal_text_size"
|
|
||||||
tools:text="20 GB" />
|
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
|
||||||
android:id="@+id/audio_progressbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/audio_label"
|
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
|
||||||
android:layout_marginBottom="@dimen/medium_margin"
|
|
||||||
android:max="100"
|
|
||||||
app:trackThickness="2dp" />
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/documents_holder"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="?attr/selectableItemBackground"
|
|
||||||
android:paddingStart="@dimen/activity_margin"
|
|
||||||
android:paddingTop="@dimen/normal_margin"
|
|
||||||
android:paddingEnd="@dimen/activity_margin"
|
|
||||||
android:paddingBottom="@dimen/normal_margin"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/audio_holder">
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
|
||||||
android:id="@+id/documents_label"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_toStartOf="@+id/documents_size"
|
|
||||||
android:text="@string/documents"
|
|
||||||
android:textSize="@dimen/bigger_text_size" />
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
|
||||||
android:id="@+id/documents_size"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:alpha="0.7"
|
|
||||||
android:text="…"
|
|
||||||
android:textSize="@dimen/normal_text_size"
|
|
||||||
tools:text="20 GB" />
|
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
|
||||||
android:id="@+id/documents_progressbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/documents_label"
|
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
|
||||||
android:layout_marginBottom="@dimen/medium_margin"
|
|
||||||
android:max="100"
|
|
||||||
app:trackThickness="2dp" />
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/archives_holder"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="?attr/selectableItemBackground"
|
|
||||||
android:paddingStart="@dimen/activity_margin"
|
|
||||||
android:paddingTop="@dimen/normal_margin"
|
|
||||||
android:paddingEnd="@dimen/activity_margin"
|
|
||||||
android:paddingBottom="@dimen/normal_margin"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/documents_holder">
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
|
||||||
android:id="@+id/archives_label"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_toStartOf="@+id/archives_size"
|
|
||||||
android:text="@string/archives"
|
|
||||||
android:textSize="@dimen/bigger_text_size" />
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
|
||||||
android:id="@+id/archives_size"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:alpha="0.7"
|
|
||||||
android:text="…"
|
|
||||||
android:textSize="@dimen/normal_text_size"
|
|
||||||
tools:text="20 GB" />
|
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
|
||||||
android:id="@+id/archives_progressbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/archives_label"
|
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
|
||||||
android:layout_marginBottom="@dimen/medium_margin"
|
|
||||||
android:max="100"
|
|
||||||
app:trackThickness="2dp" />
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/others_holder"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="?attr/selectableItemBackground"
|
|
||||||
android:paddingStart="@dimen/activity_margin"
|
|
||||||
android:paddingTop="@dimen/normal_margin"
|
|
||||||
android:paddingEnd="@dimen/activity_margin"
|
|
||||||
android:paddingBottom="@dimen/normal_margin"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/archives_holder">
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
|
||||||
android:id="@+id/others_label"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_toStartOf="@+id/others_size"
|
|
||||||
android:text="@string/others"
|
|
||||||
android:textSize="@dimen/bigger_text_size" />
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
|
||||||
android:id="@+id/others_size"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:alpha="0.7"
|
|
||||||
android:text="…"
|
|
||||||
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
|
|
||||||
android:id="@+id/search_holder"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:alpha="0"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
|
||||||
android:id="@+id/search_placeholder"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:alpha="0.8"
|
|
||||||
android:gravity="center"
|
|
||||||
android:paddingStart="@dimen/activity_margin"
|
|
||||||
android:paddingTop="@dimen/activity_margin"
|
|
||||||
android:paddingEnd="@dimen/activity_margin"
|
|
||||||
android:text="@string/no_items_found"
|
|
||||||
android:textSize="@dimen/bigger_text_size"
|
|
||||||
android:textStyle="italic"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyRecyclerView
|
|
||||||
android:id="@+id/search_results_list"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:clipToPadding="false"
|
|
||||||
android:layoutAnimation="@anim/layout_animation"
|
|
||||||
android:paddingTop="@dimen/small_margin"
|
|
||||||
android:scrollbars="none"
|
|
||||||
app:layoutManager="com.simplemobiletools.commons.views.MyGridLayoutManager" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
</androidx.core.widget.NestedScrollView>
|
|
||||||
</com.simplemobiletools.filemanager.pro.fragments.StorageFragment>
|
</com.simplemobiletools.filemanager.pro.fragments.StorageFragment>
|
||||||
|
|
Loading…
Reference in New Issue