Code Monkey home page Code Monkey logo

customfontview's Introduction

CustomFontView

API Android Arsenal

Custom font classes for TextView, EditText & Buttons

screenshot_20170816-153601

How to integrate the library in your app?

Gradle Dependecy
dependencies {
        compile 'com.an.customfontview:customfont:0.1.0'
}

Maven Dependecy

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

Add fonts

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

Usage

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

xmlns:app="http://schemas.android.com/apk/res-auto"

Custom TextView

.....
       <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" />
.....

Custom EditText

.....
       <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" />
.....

Custom Buttons

.....
           <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!

customfontview's People

Contributors

anitaa1990 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.