question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make the TextView API more extensible

See original GitHub issue

Is your feature request related to a problem? Please describe. Currently TextView only supports syntax highlighting through SetXXXColor(List<System.Rune> line, int idx) APIs, which doesn’t even tell us what line we are on. This blocks 2 things in our use-case:

  • Syntax highlighting for languages where tokens can span multiple lines.
  • Highlighting the background of the currently executed statement in a debugger, which needs a line number.

Describe the solution you’d like Expose all lines and the currently highlighted line index in some way. If the API was SetXXXColor(List<List<Rune>> lines, int lineIndex, int columnIndex), it would be a huge improvement and could technically solve both issues. Tho I understand that this isn’t too nice of an API either.

Describe alternatives you’ve considered I’m not familiar with other existing APIs that aren’t too specific to syntax highlighting, so can’t think of any.

Issue Analytics

  • State:open
  • Created 4 months ago
  • Comments:11

github_iconTop GitHub Comments

2reactions
tznindcommented, May 28, 2023

To be clear, I WILL be changing cell to use either List of Runes or a string…

Well that is now complicating my work 😃 TextModel works better with Rune. With a List I can managed it but with strings the code will be much more complicate. I’m really think to create a dedicate type for TextModel. I’m not advance more with this without we clarify what we really going to do.

I think its ok to make a new Type for TextModel. Its a 2 property class so no big deal to just have TextModelCell or something if it makes things easier.

Thanks for taking this work on @BDisp I think its gonna be pretty awesome.

1reaction
BDispcommented, May 28, 2023

Or we could switch TextModel to using Cell instead of Rune for the data model. That way we wouldn’t have 2 lists that could get out of sync.

This is a great idea. I’ll explore it. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - How to add multiple expandable TextViews
In my layout I made a LinearLayout with multiple ScrollViews in it, it's supposed to hold a FAQs section there, in the Scrollviews...
Read more >
Autosize TextViews
With Android 8.0 (API level 26) and higher, you can instruct a TextView to let the text size expand or contract automatically to...
Read more >
Expandable Text View Using Kotlin and Android Studio
Expandable Text View is an android library that allows the users to create the text view which can expand and collapse to read...
Read more >
Expandable TextView with LayoutTransition. Part 1
My goal was to get required expanding functionality for regular TextView class with the help of LayoutTransition.class.
Read more >
How to truncate text in your Android app effectively
Expandable text with “read more” action in Android — not an easy task ... Why it can get tricky to add expandable text...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found