Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi!
I've started using your RubyTextView recently and found a few issues that I fixed in this PR. First, my app used to target API 15 and above, but your library targets 21 or above. There's really no reason why it can't target 16, and the first commit ensures it can even target 15 like my app (lineSpacingExtra was added in 16).
Then, I set the text programmatically, not statically in the XML, which lead to a crash which I fixed in the second commit.
I also use a dark theme, so the hard-coded black color for the ruby text was almost not visible. Instead, the third patch replaces it to default to the default text color, just like the rest of the text.
Finally, I had a few issues with measurement and the way the text was painted. First, I needed to use the widget with
width="wrapContent"
, but the measurement always returns the parent size, so the widget took all the space, leaving no space for the rest of my layout on the right. I fixed that by returning instead the width of the largest line. I also have some furigana that exceeds the size of the kanji it is related to, and this presents two issues: it can overflow on the left and be hidden, and it can be overwritten by the next furigana block. I fixed that by creating additional spacing between text blocks when the ruby text is longer than the text it is related to.