https://github.com/zach-klippenstein/phrase-styling-example
Demonstrates a couple of different ways to style text with Phrase
https://github.com/zach-klippenstein/phrase-styling-example
Last synced: about 1 month ago
JSON representation
Demonstrates a couple of different ways to style text with Phrase
- Host: GitHub
- URL: https://github.com/zach-klippenstein/phrase-styling-example
- Owner: zach-klippenstein
- Created: 2015-04-28T14:18:34.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-28T15:05:25.000Z (about 10 years ago)
- Last Synced: 2025-01-29T08:11:51.640Z (3 months ago)
- Language: Java
- Homepage:
- Size: 645 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Phrase Styling Example
Demonstrates a couple of different ways to style text with [Phrase](https://github.com/square/phrase).
Phrase uses Android's text framework, so preserves any spans on both the pattern and values.## HTML in strings
Android supports using a subset of HTML tags to style text directly in string resource files:

Use `Resources#getText()` to parse the marked-up string into a `CharSequence`:

## Manually create `Spanned` strings
You can do the same thing from code, using `SpannableString` or `SpannableStringBuilder` to define the style:

## Screenshot
