Skip to content
This repository has been archived by the owner on Nov 14, 2018. It is now read-only.

SpannableStringBuilder extensions #436

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

feiyanke
Copy link

add wrappers for SuperscriptSpan, SubscriptSpan, TypefaceSpan and URLSpan

Copy link
Contributor

@JakeWharton JakeWharton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice tests

*
* @see SpannableStringBuilder.inSpans
*/
inline fun SpannableStringBuilder.down(builderAction: SpannableStringBuilder.() -> Unit) =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think "up" and "down" correctly convey the behavior. "superscript" and "subscript" seem fine.

Also are these common enough that they warrant inclusion? I can't remember using them once.

*
* @see SpannableStringBuilder.inSpans
*/
inline fun SpannableStringBuilder.font(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm torn between calling this "font" or "typeface" to match the span name. I suspect matching the span name will improve discoverability.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matching name seems like better, I renamed the methods - "up", "down", "font" to "superscript", "subscript" and "typeface" .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants