Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

activity: finish the activity when pressing back from the root folder. #3815

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ardevd
Copy link
Collaborator

@ardevd ardevd commented Mar 31, 2019

When browsing for files to upload a storage location selection prompt is shown when hitting the back toolbar button when in the root directory. It probably makes more sense to finish the activity.

Fixes #3811

When browsing for files to upload a storage location selection prompt is shown when hitting the back toolbar button when in the root directory. It probably makes more sense to finish the activity.

Fixes #3811

Signed-off-by: ardevd <[email protected]>
@nextcloud-android-bot
Copy link
Collaborator

Lint

TypemasterPR
Warnings5757
Errors00

FindBugs (new)

Warning TypeNumber
Bad practice Warnings32
Correctness Warnings116
Internationalization Warnings15
Malicious code vulnerability Warnings5
Multithreaded correctness Warnings9
Performance Warnings119
Security Warnings56
Dodgy code Warnings121
Total473

FindBugs (master)

Warning TypeNumber
Bad practice Warnings32
Correctness Warnings116
Internationalization Warnings15
Malicious code vulnerability Warnings5
Multithreaded correctness Warnings9
Performance Warnings119
Security Warnings56
Dodgy code Warnings121
Total473

@codecov
Copy link

codecov bot commented Mar 31, 2019

Codecov Report

Merging #3815 into master will increase coverage by <.01%.
The diff coverage is 0%.

@@             Coverage Diff             @@
##             master   #3815      +/-   ##
===========================================
+ Coverage      6.33%   6.34%   +<.01%     
  Complexity        1       1              
===========================================
  Files           323     323              
  Lines         31254   31254              
  Branches       4473    4473              
===========================================
+ Hits           1981    1982       +1     
+ Misses        28979   28978       -1     
  Partials        294     294
Impacted Files Coverage Δ Complexity Δ
...cloud/android/ui/activity/UploadFilesActivity.java 0% <0%> (ø) 0 <0> (ø) ⬇️
.../third_parties/daveKoeller/AlphanumComparator.java 83.33% <0%> (+1.19%) 0% <0%> (ø) ⬇️

1 similar comment
@codecov
Copy link

codecov bot commented Mar 31, 2019

Codecov Report

Merging #3815 into master will increase coverage by <.01%.
The diff coverage is 0%.

@@             Coverage Diff             @@
##             master   #3815      +/-   ##
===========================================
+ Coverage      6.33%   6.34%   +<.01%     
  Complexity        1       1              
===========================================
  Files           323     323              
  Lines         31254   31254              
  Branches       4473    4473              
===========================================
+ Hits           1981    1982       +1     
+ Misses        28979   28978       -1     
  Partials        294     294
Impacted Files Coverage Δ Complexity Δ
...cloud/android/ui/activity/UploadFilesActivity.java 0% <0%> (ø) 0 <0> (ø) ⬇️
.../third_parties/daveKoeller/AlphanumComparator.java 83.33% <0%> (+1.19%) 0% <0%> (ø) ⬇️

@ardevd
Copy link
Collaborator Author

ardevd commented Apr 1, 2019

Not entirely sure how we can determine whether the folder is not accessible and not the root (of /sdcard) considering how that partition is mounted in a plethora of different ways across different devices.

@tobiasKaminsky
Copy link
Member

Right, this is indeed a bit tricky…
I am not sure when we want to
a) show storage chooser
b) close activity

What about this:

  • never show storage chooser
  • close activity only when in "/"

So if you chose external sdcard, which might be in /emulated/1908-1233/ and you navigate up, you might see /emulated (read-only) with no content, but still can navigate up to "/".

@tobiasKaminsky
Copy link
Member

@AndyScherzinger we discussed this a while ago on irc…do you remember our conclusion?

@AndyScherzinger
Copy link
Member

we discussed this a while ago on irc…do you remember our conclusion?

Unfortunately no :( But couldn't we just show the chooser except in cases where we can't navigate one-up -> then we close the screen.

@ardevd
Copy link
Collaborator Author

ardevd commented Apr 2, 2019

we discussed this a while ago on irc…do you remember our conclusion?

Unfortunately no :( But couldn't we just show the chooser except in cases where we can't navigate one-up -> then we close the screen.

How do you differentiate between navigating one-up and navigating down?

EDIT: obviously, when pressing the back button you will be navigating up. So the current PR kinda works I guess?

@AndyScherzinger
Copy link
Member

obviously, when pressing the back button you will be navigating up. So the current PR kinda works I guess?

Not sure because you can navigate one up (to the root) while you can't read it. So this PR will close the screen when being in the root folder instad of showing the chooser. If you are in the root, canceled the chooser and then try to move one up (which is impossible of course) then I'd say we close the screen.

As for navigating down, well that is a different scenario in my opinion. If you navigate down (into a non-readable folder) then we should rather either a) not navigate down but show a Snackbar that the folder is non-readable) or b) navigate into that folder and show an empty list with the information that the folder is non-readable (navigatioin back up is then still possible).

What do you think @ardevd @tobiasKaminsky maybe also looping in @jancborchardt and @nextcloud/designers and please beware that the original solution proposed by @jancborchardt (displaying the choosers content instead of the file listing when hitting the root folder) is still valid but I never found the time to implement that since that would take more time than I had/have so we went for the actual implementation to at least solve the general problem and optimize for a nicer solution later.

@tobiasKaminsky
Copy link
Member

I am fine with either way.
For navigation down: please let us open up a new issue, if we further need to talk about it

@AndyScherzinger
Copy link
Member

For navigation down: please let us open up a new issue, if we further need to talk about it

I also vote for separating that part

@jancborchardt
Copy link
Member

@ardevd could you post a screenshot for context?

Maybe it’s better then to indicate somewhere in the header of that dialog (like top right) which storage you are in (like icons for either "Internal storage" with a phone icon or "SD card" with SD card icon). Tapping it would open a picker for the storage, rather than having it as a parent view. That way you can also switch storages when somewhere lower down the hierarchy. Does that make sense?

b) navigate into that folder and show an empty list with the information that the folder is non-readable (navigatioin back up is then still possible).

@AndyScherzinger agree with that one, better than the toast. But yes as has already been said it’s a separate issue. :)

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.

Back-Navigation in File-Upload
5 participants