****. Use the native and support library variants instead - https://developer.android.com/guide/topics/ui/look-and-feel/fonts-in-xml.html. An android library that makes it easy to add custom fonts to edittexts and textviews

Overview

Build Status

Add to your project

Add this line to your dependencies in build.gradle

compile 'in.workarounds.typography:typography:0.0.8'

Using the views

There are two important attributes that define a font

  • font_name Ex: 'Roboto', 'Helvetica'
  • font_variant Ex: 'Bold', 'Condensed'

So if you want to add a TextView with the font 'Roboto-Condensed', you add the following to your layout file

<in.workarounds.typography.TextView
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:font_name="Roboto"
    app:font_variant="Condensed"
    android:textSize="16sp"
/>

You can utilize the following views to improve the typography in your app: in.workarounds.typography.

  • TextView
  • EditText
  • AutoCompleteTextView
  • Button
  • Checkbox
  • RadioButton
  • ToggleButton

Font Files

Place your fonts in assets/fonts/ folder and use the following naming convention

`<font_name>-<font_variant>.<ext>`

<ext> can be ttf or otf. Both font_name and font_variant attribute are case insensitive.

Note: If you want to use Roboto.ttf, do not use the font_variant attribute.

FontLoader

FontLoader is the class responsible for caching the Typefaces and setting the fonts to the Views.

Set the default font name and font variant in your Application class

FontLoader.setDefaultFont(fontName, fontVariant)

Enable detailed logs(errors are always logged)

FontLoader.setLoggingEnabled(true)

You might also like...
Use your old Android device as an OctoPrint server.
Use your old Android device as an OctoPrint server.

Use your old Android device as an OctoPrint server.

Multitask、MultiThread(MultiConnection)、Breakpoint-resume、High-concurrency、Simple to use、Single/NotSingle-process
Multitask、MultiThread(MultiConnection)、Breakpoint-resume、High-concurrency、Simple to use、Single/NotSingle-process

FileDownloader Android multi-task file download engine. 中文文档 FileDownloader2 Now, FileDownloader2-OkDownload is released, okdownload will contain all

An instance-state saving fragment switcher, intended for use with navigation drawers or tabs.

FragmentSwitcher FragmentSwitcher is an adapter-based, state-saving fragment container similar to a ViewPager. It was designed with the NavigationDraw

Highly experimental predefined Bootstrap functions to use in Compose Web

bootstrap-compose Highly experimental predefined Bootstrap functions to use in Compose Web Install This package is uploaded to MavenCentral. repositor

Starter-Android-Library - Starter Android Library is an Android Project with Modular Architecture.
Starter-Android-Library - Starter Android Library is an Android Project with Modular Architecture.

Starter-Android-Library - Starter Android Library is an Android Project with Modular Architecture.

An android library for displaying fps from the choreographer and percentage of time with two or more frames dropped
An android library for displaying fps from the choreographer and percentage of time with two or more frames dropped

DEPRECATED TinyDancer is deprecated. No more development will be taking place. Check out the Google Android developer documentation for UI performance

A plug and play ;) android library for displaying a
A plug and play ;) android library for displaying a "rate this app" dialog

Easy Rating Dialog This lib provides a simple way to display an alert dialog for rating app. Default conditions to show: User opened the app more than

Tutorial For openJDK 11 and AGP 7.0.0+ | Tutorial Multi Library Android in 1 Project | Groovy
Tutorial For openJDK 11 and AGP 7.0.0+ | Tutorial Multi Library Android in 1 Project | Groovy

jitpack-library-guide For openJDK 11 and AGP 7.0.0 + Please read every single note for detail Tutorial Click Here Kotlin DSL Click Here Repository for

ZXing (
ZXing ("Zebra Crossing") barcode scanning library for Java, Android

Project in Maintenance Mode Only The project is in maintenance mode, meaning, changes are driven by contributed patches. Only bug fixes and minor enha

Comments
  • Problem with build: local.properties - no such file or directory

    Problem with build: local.properties - no such file or directory

    Could not build project:

    ➜  typography git:(master) ./gradlew assembleDebug
    
    FAILURE: Build failed with an exception.
    
    * Where:
    Script 'https://gist.githubusercontent.com/madki/e85785036b9ef3b85c63/raw/1fd9bc500586ddd2780fe045aeea05c3bb72e0d8/bintrayv1.gradle' line: 26
    
    * What went wrong:
    A problem occurred evaluating script.
    > /Users/vbauer/Documents/workspace/java/typography/local.properties (No such file or directory)
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    
    BUILD FAILED
    
    Total time: 7.937 secs
    

    It will be useful to make the local.properties file an optional (it is needed for bintray publishing)

    opened by vbauer 8
  • Could not read script 'installv1.gradle' as it does not exist

    Could not read script 'installv1.gradle' as it does not exist

    Could not build project:

    ➜  typography git:(master) ./gradlew assembleDebug
    
    FAILURE: Build failed with an exception.
    
    * Where:
    Build file '/Users/vbauer/Documents/workspace/java/typography/typography/build.gradle' line: 54
    
    * What went wrong:
    A problem occurred evaluating project ':typography'.
    > Could not read script 'https://gist.githubusercontent.com/themadhukiran/6fb1b85f8be3d2bba733/raw/33bbbd3fbc103276cbb48d4a6e3c5e4d12e5f555/installv1.gradle' as it does not exist.
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    
    BUILD FAILED
    
    Total time: 8.05 secs
    
    opened by vbauer 2
Owner
Workarounds
Workarounds
Tired of manually setup test data of Kotlin data classes or POJOs? Instantiator creates Instances of any class for you so that you can focus on writing tests instead of spending time and effort to setup test data

Instantiator Tired of manually setup test data of Kotlin data classes or POJOs? Instantiator creates Instances of any class for you so that you can fo

Hannes Dorfmann 54 Dec 30, 2022
Galaxy Merchant Trading Guide with python

GALAXY MERCHANT TRADING GUIDE Permasalahan Anda memutuskan untuk pergi dari bumi setelah keruntuhan finansial terbaru meninggalkan 99,99% populasi bum

null 2 Oct 21, 2021
Android validation library which helps developer boil down the tedious work to three easy steps.

AwesomeValidation Introduction Implement validation for Android within only 3 steps. Developers should focus on their awesome code, and let the librar

Jing Li 1.1k Dec 17, 2022
Makes Google play in app purchase library (BillingClient) into a flowable that can easily be used in compose world

Billy the android Our goal is to make a modern api of BillingClient so that it is easier to use in compose world. This library is still early beta and

Stefan Wärting 16 Dec 14, 2022
A Utility to Add all of your installed steam games to the Start Launcher for Windows

Steam Start Launcher The Steam Start launcher is a small tool that will scan your computer for isntalled steam games and create a shortcut for each ga

null 1 Dec 1, 2021
A Java client for the Sixpack A/B testing framework https://github.com/seatgeek/sixpack

sixpack-java A Java client for SeatGeek's Sixpack a/b testing framework: https://github.com/seatgeek/sixpack Installing Sixpack-java is currently only

null 135 Oct 7, 2022
A gradle plugin for getting java lambda support in java 6, 7 and android

Gradle Retrolambda Plugin This plugin will automatically build your java or android project with retrolambda, giving you lambda goodness on java 6 or

Evan Tatarka 5.3k Jan 5, 2023
Cache support for any video player with help of single line

Video cache support for Android Table of Content Why AndroidVideoCache? Features Get started Recipes Disk cache limit Listen caching progress Providin

Alexey Danilov 5.1k Jan 6, 2023
Ktorm migration support

ktorm-migration Ktorm migration support Status Needs a full tutorial, supporting tools, and more testing, but otherwise complete. Usage In your app, u

KTORM.ORG 12 Sep 15, 2022
Extension for Voisek App on React Native

react-native-voisek-app-extension Voisek App Extension for React Native Installation npm install react-native-voisek-app-extension Usage import Voisek

Omar Ramos Espinosa 2 Dec 21, 2021