android
android copied to clipboard
Allow Share Dialogs to create Shortcuts
- [ ] Tests written, or not not needed
Closes #3175
This is based on #5522. Thanks to @wiwie!
This Pull request allows the user to create homescreen-shortcuts via the share dialog.
| Share for Folder | Share for Files |
|---|---|
![]() |
![]() |
You are right, i will fix those issues!
However, have the design/ui/ux-issues been solved? the shortcuts-feature was proposed eatlier, but that specific implementation has been rejected because it cluttered the ui.
Codacy
Lint
| Type | master | PR |
| Warnings | 85 | 88 |
| Errors | 0 | 0 |
SpotBugs
| Category | Base | New |
|---|---|---|
| Bad practice | 29 | 29 |
| Correctness | 46 | 46 |
| Dodgy code | 353 | 354 |
| Experimental | 1 | 1 |
| Internationalization | 9 | 9 |
| Multithreaded correctness | 9 | 9 |
| Performance | 59 | 59 |
| Security | 28 | 28 |
| Total | 534 | 535 |
Lint increased!
SpotBugs increased!
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/10491.apk
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
Codecov Report
Merging #10491 (fb1d2ba) into master (f6a99ef) will decrease coverage by
0.00%. The diff coverage is8.33%.
@@ Coverage Diff @@
## master #10491 +/- ##
============================================
- Coverage 31.01% 31.01% -0.01%
- Complexity 3247 3249 +2
============================================
Files 540 541 +1
Lines 40192 40276 +84
Branches 5551 5562 +11
============================================
+ Hits 12466 12490 +24
- Misses 25893 25933 +40
- Partials 1833 1853 +20
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...cloud/android/ui/activity/FileDisplayActivity.java | 25.89% <0.00%> (-0.30%) |
:arrow_down: |
| ...om/owncloud/android/ui/dialog/SendShareDialog.java | 0.00% <0.00%> (ø) |
|
| .../java/com/owncloud/android/utils/MimeTypeUtil.java | 87.14% <0.00%> (-2.52%) |
:arrow_down: |
| ...in/java/com/owncloud/android/utils/ShortcutUtil.kt | 0.00% <0.00%> (ø) |
|
| ...android/ui/fragment/FileDetailSharingFragment.java | 37.68% <77.77%> (+1.89%) |
:arrow_up: |
| .../java/com/nextcloud/client/jobs/OfflineSyncWork.kt | 20.31% <0.00%> (-31.25%) |
:arrow_down: |
| ...va/com/owncloud/android/utils/FilesSyncHelper.java | 21.34% <0.00%> (-5.62%) |
:arrow_down: |
| ...ain/java/com/owncloud/android/db/UploadResult.java | 41.02% <0.00%> (-1.29%) |
:arrow_down: |
| ...ncloud/android/operations/UploadFileOperation.java | 60.39% <0.00%> (-0.50%) |
:arrow_down: |
| ...loud/android/datamodel/FileDataStorageManager.java | 57.80% <0.00%> (-0.41%) |
:arrow_down: |
| ... and 11 more |
blue-Light-Screenshot test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/10491-Screenshot-blue-Light-19-17
However, have the design/ui/ux-issues been solved? the shortcuts-feature was proposed eatlier, but that specific implementation has been rejected because it cluttered the ui.
So after thinking about this a bit, I don't think this is the right place for adding a widget. The share menus are for... well, sharing, which is not what adding a widget is.
@jancborchardt had the right idea in https://github.com/nextcloud/android/pull/5522 ; I think we should just provide a 1x1 widget that can be configured to open a specific folder, instead. If "pin to homescreen" was to be added somewhere that would be in the overflow menu, but that's overcrowded already. Maybe this can be revisited when we eventually transform that menu into a bottomsheet.
Honestly, i think the widget is a different (but very similar) usecase. For one, i dont actually use a widget, but shortcuts, which are specifically made for this usecase (widgets are not). Secondary: adding a shortcut should be quick. Adding a fully blown configuration screen, for a widget that a user would have to stumble upon by accident seems overkill if i just want to add a quick way to a very deeply nested folder. Not only do i have to know that the widget is, but i also have to configure it and navigate to a folder that i already found.
It is highly probable that a user will eventually share a file and then see the shortcut, which cant be said about a widget.
From a maintenance perspective, widgets are a nightmare, while shortcuts are rather easy to handle since they require a lot less code.
I agree with the original idea of the overflow menu. It is crowded, and therefore we should probably not put it there. I also agree that it is not really 'sharing' in the original term, but imho it is fitting enough, and it does not crowd the ui (too much)
A compromise could be to add the functionality to the details-view-overflow-menu, where it would be more appropriate, but less visible.
To be honest, i consider this rather important, because it is nearly impossible to quickly navigate folder structures. Favorites are quite buggy, and there is no other quick way to get to a target reliably. We should not let perfect get in the way of good enough, since this seems like a good compromise already
Edit:
That does not mean we cant/should not implement a widget eventually, but from the state of the tickets it does not seem likely that something so complex as a widget will be done anytime soon, so we should have something in the meantime.
@jancborchardt what do you think of this? I'd honestly even prefer it in the overflow menu, where it makes more sense conceptually, but it does look a bit overcrowded already.
Should we tag the design team?
@nextcloud/designers
@jancborchardt had the right idea in https://github.com/nextcloud/android/pull/5522 ; I think we should just provide a 1x1 widget that can be configured to open a specific folder, instead.
I can only strongly recommend you to not hack a shortcut (which it is) with a 1x1 widget. We did this mistake once with the Notes Android app and suffered by
- badly scaling graphics
- missing long press actions (like going to the apps details)
- missing labels
- inconsistent behavior with the other app launchers
- missing possibility to move it to the android bottom bar for the ~5 most important apps
- ...
Please. Don't misuse widgets as shortcuts.
About this actual PR proposal:
This is not the first place I would looking for shortcuts and while one can argue that it behaves a bit like the Windows context menu (send to desktop for creating a link there = share to homescreen for creating a shortcut there), it honestly feels a bit off.
I already proposed another possible solution which does effectively prevent cluttering any existing UI elements which I'd like to bring up here again as an alternative: https://github.com/nextcloud/android/issues/6363
@stefan-niedermann I fully agree what you said about widgets.
I disagree (to some extend) with your proposal. In itself, its a great idea, and should be done, but it does not adress one usecase that you mentioned. There is simply no way to quickly add a shortcut from where you are. You always have to know that the "Add Shortcut" menu exist (which many dont) and even if, you have to go back and find it again. It simply cannot do what this pr would allow the user todo. (That does not mean it has to be merged, but it is a sligthly different but complementary issue to yours)
@AlvaroBrey Any news on this? If you like i can also move it to the overflow as you mentioned.
@AlvaroBrey Any news on this? If you like i can also move it to the overflow as you mentioned.
We're going to be changing the overflow dropdown into a bottom sheet soon. Once that's done, that would be the appropriate place for a shortcut functionality, I think, as a bottom sheet can contain more options without losing too much usability.
Is there an ETA for this? I could really use this functionality to be honest. I am willing to do the work for it.
Is there an ETA for this? I could really use this functionality to be honest. I am willing to do the work for it.
should be the next thing I work on, barring unexpected urgent things. I can give no ETA other than Soonâ„¢
@newhinton The file actions menu redesign has been merged: https://github.com/nextcloud/android/pull/11008
If you need any guidance to adapt to it, let me know at alvaro.brey AT nextcloud.com
From the screenshots i have seen it looks great! I will take time on the weekend to port this feature.
@AlvaroBrey I have created a new PR since it was a bit easier and i needed to redo the ui-part anyway. Also they are not quite the same from a ux-standpoint.

