Skip to content

Repository files navigation

MultiColorTextViewDownload

This is a simple library to display text with multicolor.

samplesamplesample

How to Install

Add to your app module build.gradle

compile 'com.lombokcyberlab.android.multicolortextview:MultiColorTextView:1.0.0'

or for gradle 3.x

implementation 'com.lombokcyberlab.android.multicolortextview:MultiColorTextView:1.0.0'

or maven add to your pom file:

<dependency>
<groupId>com.lombokcyberlab.android.multicolortextview</groupId>
<artifactId>MultiColorTextView</artifactId>
<version>1.0.0</version>
<type>pom</type>
</dependency>

Usage

Using Color sheme

<com.lombokcyberlab.android.multicolortextview.MultiColorTextView
android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerInParent="true"app:text="Google Colors"app:colorScheme="google"app:textStyle="bold"app:textSize="40"/>

Using Custom Colors

First define your colors:

<string-arrayname="colorIndonesia">
<item>#FF0000</item>
<item>#FF0000</item>
<item>#FF0000</item>
<item>#FF0000</item>
<item>#FF0000</item>
<item>#FFFFFF</item>
<item>#FFFFFF</item>
<item>#FFFFFF</item>
<item>#FFFFFF</item>
<item>#FFFFFF</item>
<item>#FFFFFF</item>
<item>#FFFFFF</item>
</string-array>

Then use it:

<com.lombokcyberlab.android.multicolortextview.MultiColorTextView
android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerInParent="true"app:colors="@array/colorIndonesia"app:text="MERAH PUTIH"app:textSize="40"app:textStyle="bold" />

Available Options

OptionsDescription
app:textText to display
app:colorsArray reference of colors
app:colorSchemeUse predefined color schemes.
app:textSizeText Size
app:textStyleonly bold is available

Limitation

  • Only displaying single line text (unwrapped).
  • Limited color scheme
  • one color in colors array for one character.

Buy Me A Coffee

About

No description or website provided.

Topics

Resources

Stars

20 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages