mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-02-17 04:10:39 +01:00
improve OTG file fetching
This commit is contained in:
parent
174d55ee37
commit
521545191c
@ -174,12 +174,13 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
|
|||||||
skipItemUpdating = false
|
skipItemUpdating = false
|
||||||
Thread {
|
Thread {
|
||||||
if (activity?.isDestroyed == false && activity?.isFinishing == false) {
|
if (activity?.isDestroyed == false && activity?.isFinishing == false) {
|
||||||
if (context!!.isPathOnOTG(path)) {
|
val config = context!!.config
|
||||||
val getProperFileSize = context!!.config.sorting and SORT_BY_SIZE != 0
|
if (context!!.isPathOnOTG(path) && config.OTGTreeUri.isNotEmpty()) {
|
||||||
context!!.getOTGItems(path, context!!.config.shouldShowHidden, getProperFileSize) {
|
val getProperFileSize = config.sorting and SORT_BY_SIZE != 0
|
||||||
|
context!!.getOTGItems(path, config.shouldShowHidden, getProperFileSize) {
|
||||||
callback(path, getListItemsFromFileDirItems(it))
|
callback(path, getListItemsFromFileDirItems(it))
|
||||||
}
|
}
|
||||||
} else if (!context!!.config.enableRootAccess || !context!!.isPathOnRoot(path)) {
|
} else if (!config.enableRootAccess || !context!!.isPathOnRoot(path)) {
|
||||||
getRegularItemsOf(path, callback)
|
getRegularItemsOf(path, callback)
|
||||||
} else {
|
} else {
|
||||||
RootHelpers(activity!!).getFiles(path, callback)
|
RootHelpers(activity!!).getFiles(path, callback)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user