Skip to content

Use correct array of options#346

Merged
AndyScherzinger merged 3 commits intomasterfrom
sortFix
Nov 10, 2016
Merged

Use correct array of options#346
AndyScherzinger merged 3 commits intomasterfrom
sortFix

Conversation

@AndyScherzinger
Copy link
Member

@AndyScherzinger AndyScherzinger commented Oct 17, 2016

Resolves: #336

android app crashes when trying to sort a directory of photos to upload

@tobiasKaminsky please review - This is a work in progress since imho the implementation is broken for a simply reason. OCFIleList and LocalFileList both use the same preference for the sorting choice. So if you choose BySize in the main screen and then open upload via the FAB it'll load "by Size" and will try to sort this way. Unfortunately the local file sorting by size also sorts folders, by recursively calculating their size which takes around one minute on my phone... So imho we either need to

  • remove folders from the local file sorting as in sort by size with folders on top sorted alphabetically or
  • split the sorting choice into two preferences and don't offer sorting by size at all.

What do you think @tobiasKaminsky - I vote for ignore folders during size sorting (locally)

@tobiasKaminsky
Copy link
Member

What about a async folder computation which updates the list one after one?

@AndyScherzinger
Copy link
Member Author

That would be an option but seems very expensive as is battery consumption to be able to sort by size including folders and their subfolders. So for local files we could still go for folders first alphabetically and files by size.

What do you think @jancborchardt? Local complete would be nice and consistent but there is a high price to pay for imho.

@AndyScherzinger
Copy link
Member Author

To speed up things for now and fix the bug (crash!), I'd say lets not support sort by size for the local view and fall back to alphabetical sorting in that case.

Agreed?

@jancborchardt
Copy link
Member

Sorting method by size is not that crazily important anyway – so if it causes an issue it’s fine to not have it.

@AndyScherzinger
Copy link
Member Author

@tobiasKaminsky ready to review 😃 Sort by size is now also supported in the manual upload view, while folders are sorted alphabetically at the top. Tested on my Nexus5X

@AndyScherzinger
Copy link
Member Author

pushed to beta branch

@tobiasKaminsky
Copy link
Member

👍

@AndyScherzinger AndyScherzinger merged commit b3678f2 into master Nov 10, 2016
@AndyScherzinger AndyScherzinger deleted the sortFix branch November 10, 2016 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants