mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-04-22 22:27:20 +02:00
show the file last modified at the right side
This commit is contained in:
parent
07c054fa52
commit
12f0d5c193
@ -51,7 +51,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.simplemobiletools:commons:5.13.10'
|
implementation 'com.simplemobiletools:commons:5.13.11'
|
||||||
implementation 'com.github.Stericson:RootTools:df729dcb13'
|
implementation 'com.github.Stericson:RootTools:df729dcb13'
|
||||||
implementation 'com.github.Stericson:RootShell:1.6'
|
implementation 'com.github.Stericson:RootShell:1.6'
|
||||||
implementation 'com.alexvasilkov:gesture-views:2.5.2'
|
implementation 'com.alexvasilkov:gesture-views:2.5.2'
|
||||||
|
@ -656,12 +656,17 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
|
|||||||
item_name.text = if (textToHighlight.isEmpty()) fileName else fileName.highlightTextPart(textToHighlight, adjustedPrimaryColor)
|
item_name.text = if (textToHighlight.isEmpty()) fileName else fileName.highlightTextPart(textToHighlight, adjustedPrimaryColor)
|
||||||
item_name.setTextColor(textColor)
|
item_name.setTextColor(textColor)
|
||||||
item_details.setTextColor(textColor)
|
item_details.setTextColor(textColor)
|
||||||
|
item_date.setTextColor(textColor)
|
||||||
|
|
||||||
if (listItem.isDirectory) {
|
if (listItem.isDirectory) {
|
||||||
item_icon.setImageDrawable(folderDrawable)
|
item_icon.setImageDrawable(folderDrawable)
|
||||||
item_details.text = getChildrenCnt(listItem)
|
item_details.text = getChildrenCnt(listItem)
|
||||||
|
item_date.beGone()
|
||||||
} else {
|
} else {
|
||||||
item_details.text = listItem.size.formatSize()
|
item_details.text = listItem.size.formatSize()
|
||||||
|
item_date.beVisible()
|
||||||
|
item_date.text = listItem.modified.formatDate(activity)
|
||||||
|
|
||||||
val options = RequestOptions()
|
val options = RequestOptions()
|
||||||
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
||||||
.error(fileDrawable)
|
.error(fileDrawable)
|
||||||
|
@ -229,13 +229,13 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
|
|||||||
file.length()
|
file.length()
|
||||||
}
|
}
|
||||||
|
|
||||||
return ListItem(curPath, curName, isDirectory, children, size, false)
|
return ListItem(curPath, curName, isDirectory, children, size, file.lastModified(), false)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getListItemsFromFileDirItems(fileDirItems: ArrayList<FileDirItem>): ArrayList<ListItem> {
|
private fun getListItemsFromFileDirItems(fileDirItems: ArrayList<FileDirItem>): ArrayList<ListItem> {
|
||||||
val listItems = ArrayList<ListItem>()
|
val listItems = ArrayList<ListItem>()
|
||||||
fileDirItems.forEach {
|
fileDirItems.forEach {
|
||||||
val listItem = ListItem(it.path, it.name, it.isDirectory, it.children, it.size, false)
|
val listItem = ListItem(it.path, it.name, it.isDirectory, it.children, it.size, it.modified, false)
|
||||||
listItems.add(listItem)
|
listItems.add(listItem)
|
||||||
}
|
}
|
||||||
return listItems
|
return listItems
|
||||||
@ -295,7 +295,7 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
|
|||||||
files.forEach {
|
files.forEach {
|
||||||
val parent = it.mPath.getParentPath()
|
val parent = it.mPath.getParentPath()
|
||||||
if (parent != previousParent) {
|
if (parent != previousParent) {
|
||||||
listItems.add(ListItem("", context!!.humanizePath(parent), false, 0, 0, true))
|
listItems.add(ListItem("", context!!.humanizePath(parent), false, 0, 0, 0, true))
|
||||||
previousParent = parent
|
previousParent = parent
|
||||||
}
|
}
|
||||||
listItems.add(it)
|
listItems.add(it)
|
||||||
|
@ -44,7 +44,7 @@ class RootHelpers(val activity: Activity) {
|
|||||||
val file = File(path, line)
|
val file = File(path, line)
|
||||||
val fullLine = fullLines.firstOrNull { it.endsWith(" $line") }
|
val fullLine = fullLines.firstOrNull { it.endsWith(" $line") }
|
||||||
val isDirectory = fullLine?.startsWith('d') ?: file.isDirectory
|
val isDirectory = fullLine?.startsWith('d') ?: file.isDirectory
|
||||||
val fileDirItem = ListItem(file.absolutePath, line, isDirectory, 0, 0, false)
|
val fileDirItem = ListItem(file.absolutePath, line, isDirectory, 0, 0, 0, false)
|
||||||
files.add(fileDirItem)
|
files.add(fileDirItem)
|
||||||
super.commandOutput(id, line)
|
super.commandOutput(id, line)
|
||||||
}
|
}
|
||||||
|
@ -2,5 +2,6 @@ package com.simplemobiletools.filemanager.pro.models
|
|||||||
|
|
||||||
import com.simplemobiletools.commons.models.FileDirItem
|
import com.simplemobiletools.commons.models.FileDirItem
|
||||||
|
|
||||||
data class ListItem(val mPath: String, val mName: String = "", var mIsDirectory: Boolean = false, var mChildren: Int = 0, var mSize: Long = 0L, var isSectionTitle: Boolean)
|
data class ListItem(val mPath: String, val mName: String = "", var mIsDirectory: Boolean = false, var mChildren: Int = 0, var mSize: Long = 0L, var mModified: Long = 0L,
|
||||||
: FileDirItem(mPath, mName, mIsDirectory, mChildren, mSize)
|
var isSectionTitle: Boolean)
|
||||||
|
: FileDirItem(mPath, mName, mIsDirectory, mChildren, mSize, mModified)
|
||||||
|
@ -37,13 +37,26 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/item_details"
|
android:id="@+id/item_details"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/item_name"
|
android:layout_below="@+id/item_name"
|
||||||
android:layout_toEndOf="@+id/item_icon"
|
android:layout_toEndOf="@+id/item_icon"
|
||||||
|
android:alpha="0.6"
|
||||||
android:paddingStart="@dimen/small_margin"
|
android:paddingStart="@dimen/small_margin"
|
||||||
android:textSize="@dimen/smaller_text_size"
|
android:textSize="@dimen/smaller_text_size"
|
||||||
tools:text="1 KB"/>
|
tools:text="1 KB"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/item_date"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignTop="@+id/item_details"
|
||||||
|
android:layout_alignBottom="@+id/item_details"
|
||||||
|
android:layout_toEndOf="@+id/item_details"
|
||||||
|
android:alpha="0.6"
|
||||||
|
android:gravity="end"
|
||||||
|
android:textSize="@dimen/smaller_text_size"
|
||||||
|
tools:text="1.1.1970"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user