Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ kirai Public
forked from pwittchen/kirai

Flavored Android string formatting library

License

sidn753/kirai

 
 

Repository files navigation

Kirai - flavored Android string formatting

Build Status Android Arsenal

Kirai means phrase in Swahili language.

Project is inspired by phrase, TaggerString and BabushkaText. Kirai has fluent API similar to phrase with additional formatting similar to TaggerString and allows to add formatted pieces of text like BabushkaText.

Usage

Basic

CharSequence formatted = Kirai
   .from("Hi {first_name}, your are {age} years old.")
   .put("first_name", firstName)
   .put("age", age)
   .format();

Flavored

CharSequence formatted = Kirai
   .from("Hi {first_name}, your are {age} years old.")
   .put(Piece.put("first_name", firstName).bold().italic().big())
   .put(Piece.put("age", age).underline().color("#FF0000"))
   .format();

In TextView

textView.setText(formatted);

Download

You can depend on the library through Maven:

<dependency>
    <groupId>com.github.pwittchen.kirai</groupId>
    <artifactId>library</artifactId>
    <version>1.0.0</version>
</dependency>

or through Gradle:

dependencies {
  compile 'com.github.pwittchen.kirai:library:1.0.0'
}

Tests

Unit Tests are available in androidTest directory of the library project. We need launched and attached Android device or emulator in order to run them. Tests were written according to TDD methodology. They determine library specification and check if project is fault-tolerant.

License

Copyright 2015 Piotr Wittchen

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.

About

Flavored Android string formatting library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%