android icon indicating copy to clipboard operation
android copied to clipboard

Allow Share Dialogs to create Shortcuts

Open newhinton opened this issue 3 years ago • 8 comments

  • [ ] 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
grafik grafik

newhinton avatar Jul 07 '22 16:07 newhinton

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.

newhinton avatar Jul 08 '22 10:07 newhinton

Codacy

Lint

TypemasterPR
Warnings8588
Errors00

SpotBugs

CategoryBaseNew
Bad practice2929
Correctness4646
Dodgy code353354
Experimental11
Internationalization99
Multithreaded correctness99
Performance5959
Security2828
Total534535

Lint increased!

SpotBugs increased!

github-actions[bot] avatar Jul 08 '22 18:07 github-actions[bot]

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/10491.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

github-actions[bot] avatar Jul 08 '22 18:07 github-actions[bot]

Codecov Report

Merging #10491 (fb1d2ba) into master (f6a99ef) will decrease coverage by 0.00%. The diff coverage is 8.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

codecov[bot] avatar Jul 08 '22 19:07 codecov[bot]

blue-Light-Screenshot test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/10491-Screenshot-blue-Light-19-17

github-actions[bot] avatar Jul 08 '22 19:07 github-actions[bot]

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.

AlvaroBrey avatar Jul 11 '22 15:07 AlvaroBrey

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.

newhinton avatar Jul 11 '22 16:07 newhinton

@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.

AlvaroBrey avatar Jul 12 '22 11:07 AlvaroBrey

Should we tag the design team?

newhinton avatar Aug 11 '22 10:08 newhinton

@nextcloud/designers

AlvaroBrey avatar Aug 11 '22 10:08 AlvaroBrey

@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 avatar Aug 11 '22 12:08 stefan-niedermann

@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)

newhinton avatar Aug 11 '22 12:08 newhinton

@AlvaroBrey Any news on this? If you like i can also move it to the overflow as you mentioned.

newhinton avatar Oct 17 '22 17:10 newhinton

@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.

AlvaroBrey avatar Oct 17 '22 17:10 AlvaroBrey

Is there an ETA for this? I could really use this functionality to be honest. I am willing to do the work for it.

newhinton avatar Oct 17 '22 17:10 newhinton

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â„¢

AlvaroBrey avatar Oct 18 '22 11:10 AlvaroBrey

@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

AlvaroBrey avatar Nov 18 '22 10:11 AlvaroBrey

From the screenshots i have seen it looks great! I will take time on the weekend to port this feature.

newhinton avatar Nov 18 '22 11:11 newhinton

@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.

newhinton avatar Nov 19 '22 13:11 newhinton