Skip to content

ar-android/CustomTextView

Repository files navigation

CustomTextView

Simple library to change font of TextView

alt tag

This is an Android project allowing to change font of TextView in the simplest way possible.

Usage

To make a CustomTextView add in your layout XML and add CustomTextView library in your project or you can also grab it via Gradle:

Add it in your root build.gradle at the end of repositories:

allprojects {
   repositories {
    maven { url "https://jitpack.io" }
   }
}

Add dependencies :

dependencies {
     compile 'com.github.ar-android:CustomTextView:1.0.0'
}

XML

<ahmadrosid.com.lib.CustomTextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Lobster Regular"
    app:fontPath="@string/lobster_regular"/>

String path font

<string name="lobster_regular">fonts/Lobster-Regular.ttf</string>

By default this CustomTextView using font Lato Light

Don't forget to add font in your asset folder

alt tag

Tutorial

Open this tutorial to learn how to create an android library in simple way

https://medium.com/@ocittwo/yuk-buat-library-android-8ed01a329856

LICENCE

CustomTextView by Ahmad Rosid is licensed under a Apache License 2.0.