The Startup
Published in

The Startup

Binding Texts With Charm

Easier binding of texts for data binding library

Successfully bound user facing texts. Tobias Keller

The Problem

Artistic representation of Context, colorized. Coco Van Oppens
@android.view.RemotableViewMethod
public final void setText(CharSequence text) {
...
}
@android.view.RemotableViewMethod
public final void setText(@StringRes int resid) {
...
}

The Library

Like this but more complicated, right? 😵
DynamicText.from(
"Formatted Text with %d and %.4f and %s",
45,
0.345,
"everything"
)
DynamicText.from(
R.string.formatted_string_with_two_ints_and_a_string,
45,
0.345,
"everything"
)
DynamicText.plural(R.plurals.months_no_number, Quantity(quantity))

That’s about it

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store