Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

ARK-Retouch#75: ARK Filepicker enhancements #19

Closed
wants to merge 27 commits into from
Closed

Conversation

shubertm
Copy link
Member

shubertm and others added 27 commits December 20, 2022 21:49
…-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 {
Copy link
Member

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:

  1. Filepicker should start in classic mode.
  2. If user switches to ARK mode, we check presence of the roots file.
  3. If the roots file exists, we just take roots from it.
  4. Otherwise, we suggest scanning to the user.
  5. 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?

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member Author

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 {
Copy link
Member

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 {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty coroutine?

@kirillt
Copy link
Member

kirillt commented Sep 7, 2023

Automatic scanning is more difficult than it was anticipated.
See #21 for newer definition of the task.

ARK-Builders/ARK-Retouch#75 should be done without automatic scanning.

@kirillt kirillt closed this Sep 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants