This library provides set of custom views which are easy to use to apply your custom font.
First of all place all your custom font files in directory assets/fonts For reference see below screenshot:
##How to use this library into your project
<dependency>
<groupId>com.vikasverma.customfontviews</groupId>
<artifactId>customfontviews</artifactId>
<version>1.0</version>
<type>pom</type>
</dependency>
compile 'com.vikasverma.customfontviews:customfontviews:1.0'
<dependency org='com.vikasverma.customfontviews' name='customfontviews' rev='1.0'>
<artifact name='$AID' ext='pom'></artifact>
</dependency>
You will only need to use one attribute i.e. fontName
custom:fontName="Your custom fontName with extension"
Here font file can be of any type ttf or otf
####1. UITextView
<com.vikasverma.customfontviews.UI.UITextView
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Demo Text"
android:textSize="18sp"
custom:fontName="AdobeArabic-Regular.otf"/>
####2. UICheckBox
<com.vikasverma.customfontviews.UI.UICheckBox
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Demo Text"
android:textSize="18sp"
custom:fontName="AdobeArabic-Regular.otf"/>
####3. UIRadioButton
<com.vikasverma.customfontviews.UI.UIRadioButton
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Demo Text"
android:textSize="18sp"
custom:fontName="AdobeArabic-Regular.otf"/>
####4. UIButton
<com.vikasverma.customfontviews.UI.UIButton
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Demo Text"
android:textSize="18sp"
custom:fontName="AdobeArabic-Regular.otf"/>
####5. UIEditText
<com.vikasverma.customfontviews.UI.UIEditText
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Demo Text"
android:textSize="18sp"
custom:fontName="AdobeArabic-Regular.otf"/>
####6. UICheckedTextView
<com.vikasverma.customfontviews.UI.UICheckedTextView
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Demo Text"
android:textSize="18sp"
custom:fontName="AdobeArabic-Regular.otf"/>
Also you can change fonts programmatically as mentioned below:
Take reference of these view and call method as
UITextView textView=new UITextView(this);
textView.setFontName("Helvetica.ttf");
Apart from above this library contains one more custom view i.e. UIProgressBar which can be used to show circular progress bar with color of your choice.
##UIProgressBar
To define your color for progress bar ring you can use attribute ringColor as mentioned below:
<com.vikasverma.customfontviews.UI.UIProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
vikas:ringColor="@android:color/holo_green_dark"/>
Copyright [2016] [Vikas Verma]
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.