Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

An android textview that supports highlighting parts or all of the text contained in it

License

Notifications You must be signed in to change notification settings

lizardmia/EmphasisTextView

Open more actions menu
 
 

Repository files navigation

EmphasisTextView

Hex.pm Platform Android Arsenal

An android TextView that supports highlighting parts or all of the text contained in it.

Screenshots

Demo Screenshot

How to

To set the highlight areas you can add the following statements programmatically:

emphasisTextView.setText("SALAD");
emphasisTextView.setTextToHighlight("sa");
emphasisTextView.setHighlightColor("#ff3393b4"); 
emphasisTextView.setCaseInsensitive(true);
emphasisTextView.highlight();

Please check the sample project for some more working examples.

Add it to your project

This library is hosted in jcenter

For gradle, you can import it with:

dependencies {
    compile 'com.athkalia.emphasis:emphasis:0.3'
}

For maven, you can import it with:

<dependency>
    <groupId>com.athkalia.emphasis</groupId>
    <artifactId>emphasis</artifactId>
    <type>aar</type>
    <version>0.3</version>
</dependency>

Todos

Feel free to open a pull request for anything that you want to see added.

What I have in mind:

  1. Introduce a delegate when someone is using another class that is already extending from TextView (possibly another library).

  2. Create similar functionality via xml attributes.

About

An android textview that supports highlighting parts or all of the text contained in it

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.