All Projects → nakshay → TextHighlighter

nakshay / TextHighlighter

Licence: Apache-2.0 license
TextHighlighter is a simple android library to show highlighted and styled text in android apps.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to TextHighlighter

Mark.js
JavaScript keyword highlighting. Mark text with with options that fit every application. Also available as jQuery plugin.
Stars: ✭ 2,004 (+7916%)
Mutual labels:  highlighter
kighlighter
Simple and extendable code highlighter in Kotlin Multiplatform
Stars: ✭ 22 (-12%)
Mutual labels:  highlighter
Forum-Advanced
This is built on Laravel Framework 5.5. This was built for demonstrate purpose.
Stars: ✭ 14 (-44%)
Mutual labels:  highlighter
Intellij Csv Validator
CSV validator, highlighter and formatter plugin for JetBrains Intellij IDEA, PyCharm, WebStorm, ...
Stars: ✭ 198 (+692%)
Mutual labels:  highlighter
Chroma
A general purpose syntax highlighter in pure Go
Stars: ✭ 3,013 (+11952%)
Mutual labels:  highlighter
vscode-xslt-tokenizer
VSCode extension for highlighting XSLT and XPath (upto 3.0/3.1)
Stars: ✭ 37 (+48%)
Mutual labels:  highlighter
Colorhighlight
🎨 Lightweight Color Highlight colorizer for Sublime Text
Stars: ✭ 76 (+204%)
Mutual labels:  highlighter
WSA-GA-Actions
Automated Script to bake WSA Packages with GApps, All that in just one click!
Stars: ✭ 18 (-28%)
Mutual labels:  android-apps
Go-Present-code-highlighter
Chrome extension that highlights syntax of golang code in Present (https://godoc.org/golang.org/x/tools/cmd/present) slides
Stars: ✭ 29 (+16%)
Mutual labels:  highlighter
USB Mass Storage Enabler
An app to mount memory card like pen drive
Stars: ✭ 32 (+28%)
Mutual labels:  android-apps
Codeview
Android Code Highlighter
Stars: ✭ 204 (+716%)
Mutual labels:  highlighter
Roam Highlighter
Chrome highlighter that quickly and easily puts your highlights into Roam format for easy pasting into your notes.
Stars: ✭ 207 (+728%)
Mutual labels:  highlighter
MeetMe
An Android apps that using google maps to track realtime location between two people that wanna meet with chat feature, and realtime tracking
Stars: ✭ 32 (+28%)
Mutual labels:  android-apps
Vscode Twitch Highlighter
This is a VS Code extension that will allow your Twitch chat to highlight a line of code via a command message. Example: `!line 8 server.js`. See master branch README.md for more details
Stars: ✭ 169 (+576%)
Mutual labels:  highlighter
Avi
🎬 Pocket online cinema for Android (Deprecated)
Stars: ✭ 18 (-28%)
Mutual labels:  android-apps
React Native Segmented Text Input
A wickedly customizable <TextInput /> for React Native. Useful for tags, spellchecking, whatever.
Stars: ✭ 104 (+316%)
Mutual labels:  highlighter
conanlight
Bring syntax highlighting to your conan file in VSCode 💡
Stars: ✭ 12 (-52%)
Mutual labels:  highlighter
applivery-android-sdk
Applivery Android SDK
Stars: ✭ 19 (-24%)
Mutual labels:  android-apps
dynodroid
Automatic Input Generation System for Android Apps
Stars: ✭ 31 (+24%)
Mutual labels:  android-apps
KeyLighter
Yet another syntax highlighter for PHP
Stars: ✭ 29 (+16%)
Mutual labels:  highlighter

TextHighlighter Download

TextHighlighter is simple android API for developers to show highlighted text in android apps, also provides methods to show styled text.

Description:

The purpose of TextHighlighter API is provide the simplest way to highlight the text in android apps. The API can be used with all andriod views which allows the rendering of text using Html.fromHtml() method.

Usage

Add below line in app build.gradle

dependencies {
	compile 'com.github.nakshay:texthighlighterapi:1.2.2'
}

Code snippets

Create the object of TextHighlighter

TextHighlighter highlighter=new TextHighlighter();

Set the color for specific word

highlighter.setColorForTheToken("Awesome","red");
highlighter.setColorForTheToken("Text","purple");
highlighter.setColorForTheToken("Highlighter","blue");

OR

set color for multiple words

highlighter.setColorForTheToken(String[],"color");

To set default color, if no color is specified.

highlighter.defaultColor="black" 

Call the method getHighlightedText(String textToBeHighlighted) and pass the text to be highlighted

set styles for specific word

highlighter.setStyleForTheToken("Awesome",TextHighlighter.BOLD);
highlighter.setStyleForTheToken("Text",TextHighlighter.UNDERLINE);
highlighter.setStyleForTheToken("Awesome",TextHighlighter.ITALIC);

OR

set style for multiple words

highligter.setStyleForTheToken(String[],style);

Call the method getStyledText(String textToBeStyled) and pass the text to be styled.

String highlightedText=highlighter.getHighlightedText("Awesome Text Highlighter");

both highlited and styled text can be used by passing highlited text to styled text and vice versa.

Pass the returned string to Html.fromHtml() to get highlighted text

textViewobj.setText(Html.fromHtml(highlightedText));

you can add extra tags by appending tags inside Html.fromHtml()

More methods

String = getColorForTheToken(String token);
String = getStyleForTheToken(String token);

String[] = getColorForTheToken(String[] token);
String[] = getStyleForTheToken(String[] token);

Note:

Named colors may not work always, you can use Hex values insted of named colors, hence using Hex values instead of named colors is recommended.

Example:-

highlighter.setColorForTheToken("Awesome","#D83400");

Supported tags for text styling

<b>
<i>
<u>
<sup>
<sub>

Visit www.htmlcolorcodes for awesome colors and their Hex values.

Default languages support

Now TextHighlighter supports automatic color highlighting for default langauges.

Currently supporting C, C++ and Java.

highlighter.setLanguage(highlighter.CPP);

The above line will select default color for highlighting C++ code and you can get rid of all settings for C++ code highlighting like setStyleForTheToken method call

Note: This is a major change in the library and API *may change in future. If you have any suggestions for default colors please open an issue. I am also ready to accept patches, refer contributing guidelines if interested.

Screenshot

alt tag alt tag

Current development

Please refer Wiki section to know more about current development

How to Contribute?

Please refer CONTRIBUTE.md to see contribute workflow.

License

Copyright 2016 AKSHAY NAIK

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].