-
Notifications
You must be signed in to change notification settings - Fork 1
ARK-Retouch#75: ARK Filepicker enhancements #19
Conversation
…nto grouping-root-and-fav-actions
…-actions # Conflicts: # arkfilepicker/src/main/java/space/taran/arkfilepicker/folders/FoldersRepo.kt # arkfilepicker/src/main/java/space/taran/arkfilepicker/presentation/filepicker/ArkFilePickerFragment.kt # arkfilepicker/src/main/java/space/taran/arkfilepicker/presentation/folderstree/FolderItemView.kt # arkfilepicker/src/main/java/space/taran/arkfilepicker/presentation/folderstree/FoldersTreeView.kt # arkfilepicker/src/main/res/layout/ark_file_picker_item_favorite.xml # arkfilepicker/src/main/res/layout/ark_file_picker_item_root.xml
import kotlin.io.path.isDirectory | ||
import kotlin.io.path.listDirectoryEntries | ||
|
||
class ArkRootsScan { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scanning in Filepicker should work like this:
- Filepicker should start in classic mode.
- If user switches to ARK mode, we check presence of the roots file.
- If the roots file exists, we just take roots from it.
- Otherwise, we suggest scanning to the user.
- We do scanning, write to the roots file.
Also, Navigator should call the code from Filepicker in order to avoid duplication.
@ShubertMunthali @mdrlzy does it work like this now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user doesn't switch to ARK mode, scanning should not happen and should not be suggested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filepicker should also remember in which mode it was used last time.
If last time was ARK mode, the user should start in ARK mode next time.
If last time was classic mode, the user starts in classic mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it works that way now, only that user cannot choose to use ARK-Mode or not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about this? We need new preference for this, I guess.
Filepicker should also remember in which mode it was used last time.
If last time was ARK mode, the user should start in ARK mode next time.
If last time was classic mode, the user starts in classic mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
@@ -310,7 +311,11 @@ open class ArkFilePickerFragment : | |||
|
|||
fun newInstance(config: ArkFilePickerConfig) = | |||
ArkFilePickerFragment().apply { | |||
setConfig(config) | |||
runBlocking { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mdrlzy is blocking fine here?
@@ -107,6 +111,12 @@ internal class ArkFilePickerViewModel( | |||
} | |||
} | |||
|
|||
private fun onScanArkRoots() { | |||
viewModelScope.launch { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty coroutine?
Automatic scanning is more difficult than it was anticipated. ARK-Builders/ARK-Retouch#75 should be done without automatic scanning. |
ARK-Builders/ARK-Retouch#75