SkillAgentSearch skills...

CustomFontView

Custom View classes for TextView, EditText & Buttons - to set custom fonts

Install / Use

/learn @anitaa1990/CustomFontView

README

CustomFontView

<img src="https://camo.githubusercontent.com/7a097bb07d47506d643804b222bb8ad2be336498/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4150492d392532422d6f72616e67652e7376673f7374796c653d666c6174" alt="API" data-canonical-src="https://img.shields.io/badge/API-9%2B-orange.svg?style=flat" style="max-width:100%;"> Android Arsenal

Custom font classes for TextView, EditText & Buttons

screenshot_20170816-153601

<h2>How to integrate the library in your app?</h2> <b>Gradle Dependecy</b></br>
dependencies {
        compile 'com.an.customfontview:customfont:0.1.0'
}

<b>Maven Dependecy</b></br>

<dependency>
  <groupId>com.an.customfontview</groupId>
  <artifactId>customfont</artifactId>
  <version>0.1.0</version>
  <type>pom</type>
</dependency>
<h2>Add fonts</h2>

Add your custom fonts to assets/ .</br> If the assets directory does not already exist, you should create it under src/main/ in your project directory.</br> You might consider creating a fonts/ subdirectory in the assets directory (as in examples).

<h2>Usage</h2>

Add the below line to the root layout of your xml file:

xmlns:app="http://schemas.android.com/apk/res-auto"
<h3>Custom TextView</h3>
.....
       <com.an.customfontview.CustomTextView
          android:layout_gravity="center"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          app:textFontPath="fonts/gotham_bold.otf"
          android:text="Works for any number of fonts" />
.....
<h3>Custom EditText</h3>
.....
       <com.an.customfontview.CustomEditText
          android:text="Works for edit text too!"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          app:editFontPath="fonts/product_sans.ttf" />
.....
<h3>Custom Buttons</h3>
.....
           <com.an.customfontview.CustomButton
              android:layout_gravity="center"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              app:btnFontPath="fonts/gt_medium.otf"
              android:text="Works for me too!"/>
.....

That's all folks!

Related Skills

View on GitHub
GitHub Stars27
CategoryDevelopment
Updated3y ago
Forks4

Languages

Java

Security Score

80/100

Audited on Oct 4, 2022

No findings