Android: Improve share link handling

Created on 21 Jun 2018  Â·  18Comments  Â·  Source: nextcloud/android

as discussed in the forum with @jancborchardt and @jasonbayton: https://help.nextcloud.com/t/nextcloud-android-app-update-with-improved-user-interface-and-sharing/32900/15?u=jan

When a share link is created, copy it to the clipboard directly for fast sharing while not showing the "Send to" dialog anymore. This way the experience is smoother and the user can still edit the links permissions etc. without having to close the send action dialog but can do that anytime afterwards via the newly introduced menu item.

Upon initial creation when the link is auto copied into the clipboard show a Toast saying: "Share link copied"

approved enhancement good first issue pr exists

Most helpful comment

Nice one Andy!

All 18 comments

Yup! And showing a toast/snackbar (always mixing up the names … :D) with "Share link copied" for feedback.

Yes! Far better, thank you!

Yup! And showing a toast/snackbar (always mixing up the names … :D) with "Share link copied" for feedback.

@jancborchardt I extended the issue's description

In this case it'll be a Toast since Android still uses a Toast for clipboard while all other places have been replaced Toast->Snackbar already :)

implemented via #2730 / #2739 shipping with 3.2.1

Nice one Andy!

Thanks @jasonbayton, let's see if it works the way everbody wanted it to be :)

Sorry, prematurely closed... the details view still launches the send link to dialog when activating share by link... :(

@AndyScherzinger care to elaborate on what's not working as intended?

  • open details on a file, e.g. an image
  • go to sharing tab
  • share a link
  • after successful link creating, a dialog is shown
    2018-07-13-113204
  • instead only a "Share link copied" should be shown.

Hmm, I'm not able to reproduce this.

EDIT:

Showing file details first lets me reproduce the issue as you describe. The link is not copied to the clipboard though.

It's the FileDisplayActivity that triggers the ShareLinkToDialog when a link is created. I'm assuming we dont want to use that dialog at all when a link is created?

The problem is that the method that triggers the dialog to appear is called regardless of whether a link is created (toggleShareByLink()) or explicitly sent (showSendLinkTo()). Need to find a way to differentiate between the two different operations because they currently both use ACTION_CREATE_SHARE_VIA_LINK

@AndyScherzinger as you changed quite a lot there, maybe you have an hint, how to do this?

Well, @ardevd nailed it pretty much ;) Afaik @jancborchardt wanted

  • the ShareLinkToDialog to pop up in case the link is created via the bottom sheet and
  • copied to clipboard in case the link is created via the files details fragment.

So like @ardevd mentioned we would need to have to actions like ACTION_CREATE_SHARE_VIA_LINK_SEND_TO and ACTION_CREATE_SHARE_VIA_LINK_COPY_TP_CLIPBOARD :/

Then let us wait for confirmation by @jancborchardt and then we have to do it this way and implement two actions…

We mostly talked about the detail view I think. For consistency reasons and to fit the expectations, it’s best to do it the same in either view. Or do you have other feedback?

And instead of only a toast saying "Link copied" we could show a snackbar saying "Link copied" which on the right has an action for "Send to", which would launch the share sheet (and can be used if needed). This would enhance the way we want to do it in the detail view, and also improve it if we want to use the same method when the link is created via share bottom sheet:

screenshot from 2018-08-09 16-45-15

And because the bottom sheet already has all these "Send to other apps" options listed below our "Share" and "Share link" icons, we don’t need to have the ShareLinkToDialog directly show when using the "Share link" way. (Because then it just seems like a weird 2-step process for sharing a link, where for sharing with another app you might as well just use those direct icons in the bottom sheet which share the file itself, not a link.)

Does that make sense?

Does that make sense?

Took me a while do understand it :laughing: but makes sense to me now :+1:

@AndyScherzinger also added a quick illustration of the Snackbar for better understanding. :D

Thanks @jancborchardt

@tobiasKaminsky @ardevd I am fine with Jan's proposal, well, I even think that is the best solution :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JSoko picture JSoko  Â·  3Comments

AndyScherzinger picture AndyScherzinger  Â·  3Comments

Tie-fighter picture Tie-fighter  Â·  3Comments

tobiasKaminsky picture tobiasKaminsky  Â·  3Comments

tobiasKaminsky picture tobiasKaminsky  Â·  3Comments