FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

(WIP) feat: TappableSpan support by edusperoni · Pull Request #7076 · NativeScript/NativeScript · GitHub

(WIP) feat: TappableSpan support - #7076

Closed
edusperoni wants to merge 8 commits into
NativeScript:masterfrom
edusperoni:clickablespan
Closed

edusperoni wants to merge 8 commits into
NativeScript:masterfrom
edusperoni:clickablespan

Conversation

Copy link
Copy Markdown
Contributor

PR Checklist

What is the current behavior?

There is no way to add links to Labels/TextViews.

What is the new behavior?

Span now has a linkClick event which, when bound, makes it possible for it to be interacted with via tap.

Implements #3671.

cla-bot Bot added the cla: yes label Mar 26, 2019
ghost added the ♥ community PR label Mar 26, 2019

edusperoni commented Mar 26, 2019 •
edited
Loading

Copy link
Copy Markdown
Contributor Author

If possible, I'd like that the core team test this implementation on Android and validate it's styling, so I can replicate it on iOS.

Challenges:

  1. On iOS, making a Label clickable requires a dirty hack. This is only a problem with UILabel.
  2. I have no idea if this works when the parent is a button (further testing needed).

There's an option to use the usual link highlighting (some adaptations are needed, or we could depend on https://github.com/saket/Better-Link-Movement-Method) to get this effect:

We could accomplish it by setting something like android.highlightColor, but when you override the span's background color, the highlight color never appears. This means we would not be able to create a span with a background that highlights.

This is also not possible on iOS (at least not in a trivial way). If our goal is to have the same style on both platforms, we can skip this step.

ghost assigned manoldonev Apr 5, 2019
ghost added in progress and removed ♥ community PR labels Apr 5, 2019

shiv19 commented May 6, 2019

Copy link
Copy Markdown
Member

Hi @edusperoni!
Can we please rename this to TappableSpan,
and change the name of the event to linktap since "click" is not a term that is used on mobile. :)

Copy link
Copy Markdown
Contributor Author

@shiv19 Absolutely, I used CliackableSpan because Android actually defines it like that (https://developer.android.com/reference/android/text/style/ClickableSpan). I'll update it to match TappableSpan

edusperoni changed the title (WIP) feat: ClickableSpan support (WIP) feat: TappableSpan support May 6, 2019

Copy link
Copy Markdown

Hello ! Great improvement, look forward to it being implemented :) Thank you very much for your work.

Copy link
Copy Markdown
Contributor Author

Closing in favor of #8256

edusperoni closed this Jan 17, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

4 participants


Back | FazBrowse Home | New Git URL