TextBuilder

Easily build cool looking texts for TextView

Лицензия

Лицензия

Группа

Группа

com.vanniktech
Идентификатор

Идентификатор

textbuilder
Последняя версия

Последняя версия

0.2.0
Дата

Дата

Тип

Тип

aar
Описание

Описание

TextBuilder
Easily build cool looking texts for TextView
Ссылка на сайт

Ссылка на сайт

https://github.com/vanniktech/TextBuilder
Система контроля версий

Система контроля версий

https://github.com/vanniktech/TextBuilder

Скачать textbuilder

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.vanniktech/textbuilder/ -->
<dependency>
    <groupId>com.vanniktech</groupId>
    <artifactId>textbuilder</artifactId>
    <version>0.2.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.vanniktech/textbuilder/
implementation 'com.vanniktech:textbuilder:0.2.0'
// https://jarcasting.com/artifacts/com.vanniktech/textbuilder/
implementation ("com.vanniktech:textbuilder:0.2.0")
'com.vanniktech:textbuilder:aar:0.2.0'
<dependency org="com.vanniktech" name="textbuilder" rev="0.2.0">
  <artifact name="textbuilder" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.vanniktech', module='textbuilder', version='0.2.0')
)
libraryDependencies += "com.vanniktech" % "textbuilder" % "0.2.0"
[com.vanniktech/textbuilder "0.2.0"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
androidx.annotation » annotation jar 1.0.0

runtime (1)

Идентификатор библиотеки Тип Версия
androidx.appcompat » appcompat jar 1.1.0

Модули Проекта

Данный проект не имеет модулей.

TextBuilder

Provides a Class with a builder pattern for building beautiful text super easily. Internally it uses the Spannable API.

new TextBuilder(this) // Context
    .addText(R.string.some_text)
    .addWhiteSpace()
    .addColoredTextRes("in green", R.color.green)
    .addWhiteSpace()
    .addColoredText("and blue", Color.BLUE)
    .addWhiteSpace()
    .into(textView);

Also certain parts of a text can be formatted:

new TextBuilder(this) // Context
    .addFormableText("Terms of use and privacy terms")
    .format("Terms of use")
      .textColor(Color.RED)
      .bold()
      .clickable(() -> Log.d(TAG, "Clicked on Terms of Use"))
    .done()
    .format("privacy terms")
      .underline()
      .bold()
      .clickable(() -> Log.d(TAG, "Clicked on Privacy Terms"))
    .done()
    .into(textView);

Displaying images is also not a problem:

new TextBuilder(this)
    .addDrawable(R.drawable.ic_done_black_18dp)
    .addWhiteSpace()
    .addText("Shopping")
    .addNewLine()
    .addText("Cleaning")
    .into(textView);

For now only the basic things are supported and some features may be lacking. I'm open for any suggestions or new APIs.

Setup

build.gradle

compile 'com.vanniktech:textbuilder:0.2.0'
compile 'com.vanniktech:textbuilder:0.3.0-SNAPSHOT'

Modules are located on Maven Central.

Proguard

No configuration needed.

License

Copyright (C) 2017 Vanniktech - Niklas Baudy

Licensed under the Apache License, Version 2.0

Версии библиотеки

Версия
0.2.0
0.1.0