An Android library that allows you to build text layouts more easily.
See the code
Build text Layouts easily on Android.
Layouts easily.Layouts.Layouts of commonly used strings.If using Gradle, add this to your build.gradle:
compile 'com.facebook.fbui.textlayoutbuilder:textlayoutbuilder:1.7.0'
or, if using Maven:
<dependency>
<groupId>com.facebook.fbui.textlayoutbuilder</groupId>
<artifactId>textlayoutbuilder</artifactId>
<version>1.7.0</version>
<type>aar</type>
</dependency>
TextLayoutBuilder:TextLayoutBuilder builder = new TextLayoutBuilder()
.setText("TextLayoutBuilder makes life easy")
.setTextColor(Color.BLUE)
.setWidth(400 /*, MEASURE_MODE_EXACTLY */);
build() on the builder to get a Layout:Layout layout = builder.build();
Layout in your code:public class CustomView extends View {
private Layout layout;
public CustomView(Context context) {
super(context);
}
public void setLayout(Layout layout) {
this.layout = layout;
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
// Draw the layout.
layout.draw(canvas);
}
}
TextLayoutBuilder.textLayoutBuilder.setShouldCacheLayout(true);
GlyphWarmer for the TextLayoutBuilder.textLayoutBuilder
.setShouldWarmText(true)
.setGlyphWarmer(new GlyphWarmerImpl());
TextLayoutBuilder object.ResourceTextLayoutHelper.updateFromStyleResource(
textLayoutBuilder, // builder object
context, // Activity context
resId); // style resource id
TextLayoutBuilder is Apache-2-licensed.
Overall
Maintained
Code review
Latest release
Releases this year
1,252 followers · starred Jun 2022
783 followers · starred Feb 2017
570 followers · starred Dec 2016
2,766 followers · starred Dec 2016
An Android library that allows you to build text layouts more easily.
See the code
Build text Layouts easily on Android.
Layouts easily.Layouts.Layouts of commonly used strings.If using Gradle, add this to your build.gradle:
compile 'com.facebook.fbui.textlayoutbuilder:textlayoutbuilder:1.7.0'
or, if using Maven:
<dependency>
<groupId>com.facebook.fbui.textlayoutbuilder</groupId>
<artifactId>textlayoutbuilder</artifactId>
<version>1.7.0</version>
<type>aar</type>
</dependency>
TextLayoutBuilder:TextLayoutBuilder builder = new TextLayoutBuilder()
.setText("TextLayoutBuilder makes life easy")
.setTextColor(Color.BLUE)
.setWidth(400 /*, MEASURE_MODE_EXACTLY */);
build() on the builder to get a Layout:Layout layout = builder.build();
Layout in your code:public class CustomView extends View {
private Layout layout;
public CustomView(Context context) {
super(context);
}
public void setLayout(Layout layout) {
this.layout = layout;
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
// Draw the layout.
layout.draw(canvas);
}
}
TextLayoutBuilder.textLayoutBuilder.setShouldCacheLayout(true);
GlyphWarmer for the TextLayoutBuilder.textLayoutBuilder
.setShouldWarmText(true)
.setGlyphWarmer(new GlyphWarmerImpl());
TextLayoutBuilder object.ResourceTextLayoutHelper.updateFromStyleResource(
textLayoutBuilder, // builder object
context, // Activity context
resId); // style resource id
TextLayoutBuilder is Apache-2-licensed.
Overall
Maintained
Code review
Latest release
Releases this year
1,252 followers · starred Jun 2022
783 followers · starred Feb 2017
570 followers · starred Dec 2016
2,766 followers · starred Dec 2016