An extension of Android's TextView, EditText and Button that let's you use the font of your choice

Overview

AnyTextView (deprecated)

Android Arsenal

Note: AnyTextView is no longer being maintained. I recommend replacing AnyTextView with the Calligraphy library instead.

Frustration arise the moment you realise that you cannot set a custom font on TextView, EditText and Button views using the android:typeface XML-attribute. AnyTextView is here to relieve your pain.

Setup

If you're using Gradle (recommended), add the following to your build.gradle file:

dependencies {
    compile 'com.ctrlplusz.anytextview:library:1.2'
}

If you're using Maven, add the following to your pom.xml file:

<dependency>
  <groupId>com.ctrlplusz.anytextview</groupId>
  <artifactId>library</artifactId>
  <version>1.2</version>
  <type>aar</type>
</dependency>

Alternatively, download the .aar and reference it from your project.

How to use:

  1. Copy the fonts you want to use into the assets/fonts folder of your project

  2. Add your application namespace to the root element in the XML file that is to contain AnyTextView's, e.g

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:foobar="http://schemas.android.com/apk/res-auto"
		.. >
  1. Instead of using
<TextView ../>

<!-- ... or ... -->

<EditText ../>

<!-- ... or ... -->

<Button ../>

use

<com.ctrlplusz.anytextview.AnyTextView 
	foobar:typeface="FontFileName.ttf" ..> <!-- Where "foobar" is the namespace defined in step 2 -->

<!-- ... or ... -->

<com.ctrlplusz.anytextview.AnyEditTextView 
	foobar:typeface="FontFileName.ttf" ..> 
	
<!-- ... or ... -->

<com.ctrlplusz.anytextview.AnyButton 
	foobar:typeface="FontFileName.ttf" ..> 
  1. Profit!

Is your app using AnyTextView?

  • Feel free to submit a pull request for this file, and add your app to this list.

Changelog

Version 1.2

  • Project is now using Gradle instead of Maven for building
  • Packaging changed to be .aar instead of .apklib
  • Prepared project for release in Central
  • Bumped version numbers to 21 (Lollipop)

Version 1.1.1

  • Added missing .recycle() call on TypedArray
  • Bumped targetSdkVersion to 19 (KitKat)

Version 1.1

  • Made it possible to use custom typefaces in EditText's using AnyEditTextView. AnyEditTextView's shares cache with AnyTextView's.
  • minSdkVersion set to 4
  • No longer tries to render typefaces if code is running in a visual editor

Version 1.0

  • Use custom typefaces in TextView's using AnyTextView

License

Copyright 2015 Hans Petter Eide

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.
You might also like...
A module designed to encapsulate the use of an Android EditText field for gathering currency information from a user. Supports all ISO-3166 compliant locales/currencies.
A module designed to encapsulate the use of an Android EditText field for gathering currency information from a user. Supports all ISO-3166 compliant locales/currencies.

CurrencyEditText CurrencyEditText is an extension of Android's EditText view object. It is a module designed to provide ease-of-use when using an Edit

Android library contain custom realisation of EditText component for masking and formatting input text
Android library contain custom realisation of EditText component for masking and formatting input text

Masked-Edittext Masked-Edittext android library EditText widget wrapper add masking and formatting input text functionality. Install Maven dependency

Add text masking functionality to Android EditText. It will prevent user from inserting not allowed signs, and format input as well.
Add text masking functionality to Android EditText. It will prevent user from inserting not allowed signs, and format input as well.

MaskFormatter MaskFormatter adds mask functionality to your EditText. It will prevent user from inserting not allowed signs, and format input as well.

A custom EditText with a switchable icon which shows or hides the password
A custom EditText with a switchable icon which shows or hides the password

Deprecated This library is deprecated now as there is an official way to use the password toggle with the TextInputLayout (inside the support library

A single EditText instead of a classical form. Library that implements flavienlaurent's singleinputform
A single EditText instead of a classical form. Library that implements flavienlaurent's singleinputform

material-singleinputform A single EditText instead of a classical form. This Library is a library implementation of flavienlaurent's "Single input for

A single EditText instead of a classical form. Library that implements flavienlaurent's singleinputform
A single EditText instead of a classical form. Library that implements flavienlaurent's singleinputform

material-singleinputform A single EditText instead of a classical form. This Library is a library implementation of flavienlaurent's "Single input for

A simple Android Tag EditText
A simple Android Tag EditText

TagEditText A simple Android Tag EditText. Setup The easiest way to add the TagEditText library to your project is by adding it as a dependency to you

An Android App example of how to create a custom EditText using DoubleLinkedList Data Structure
An Android App example of how to create a custom EditText using DoubleLinkedList Data Structure

DoubleLinkedListEditText Library This is a library to create an EditText based on the Doubly Linked List data structure so that the user can enter cod

Uma máscara personalizável para EditText, que pode ser adicionada como um TextWatcher.

Custom-Mask-for-EditText 🎭 ( Máscara personalizável para EditTexts!) Uma máscara customizável que pode ser adicionada aos seus EditTexts, e adaptada

Comments
  • Release 1.1.1 over Maven central?

    Release 1.1.1 over Maven central?

    Hey there, We'd like to use your library in one of our projects. Could you please release the current Version to Maven central? The refactoring and additions you made in 1.1.1 are very useful.

    Thank you in advance!

    opened by rzimmer 5
  • Deploy as aar

    Deploy as aar

    In current state library is hardly usable with Gradle based projects (which is a majority of new projects at the time) as Gradle does not support apklib dependencies.

    Could you instead deploy it as aar, so both Maven and Gradle users will be happy?

    opened by dmitry-zaitsev 4
  • Duplicate files copied in APK AndroidManifest.xml in Android Studio

    Duplicate files copied in APK AndroidManifest.xml in Android Studio

    I'm not sure why but I get this error when adding AnyTextView dependency

    Gradle: Execution failed for task ':XXX:packageDebug'.
    > Duplicate files copied in APK AndroidManifest.xml
        File 1:     /Users/patrick91/AndroidStudioProjects/XXX/XXX/build/libs/XXX-debug.ap_
        File 2:     /Users/patrick91/AndroidStudioProjects/XXX/XXX/build/libs/XXX-debug.ap_
    

    This is in the build.gradle file

    dependencies {
        compile 'com.android.support:appcompat-v7:18.0.0'
        compile 'com.android.support:support-v4:18.0.0'
        compile 'com.google.android.gms:play-services:3.2.25'
        compile 'com.ctrlplusz:anytextview:1.1'
    }
    
    opened by patrick91 3
  • Fixed package prefix to com.ctrlplusz

    Fixed package prefix to com.ctrlplusz

    In usage sample the package name was: com.ctrplusz.anytextview.AnyTextView

    so it was missing 'l' letter in "ctrl". I have changed it to: com.ctrlplusz.anytextview.AnyTextView

    Cheers!

    opened by MaciejCiemiega 0
Releases(v1.2)
Owner
Hans Petter Eide
Hans Petter Eide
Androids EditText that animates the typed text. EditText is extended to create AnimatedEditText and a PinEntryEditText.

AnimatedEditText for Android This repository contains AnimatedEditText and TextDrawable all of which extend the behaviour of EditText and implement fe

Ali Muzaffar 439 Nov 29, 2022
Android form edit text is an extension of EditText that brings data validation facilities to the edittext.

Android Form EditText Android form edit text is an extension of EditText that brings data validation facilities to the edittext. Example App I built a

Andrea 1.5k Dec 14, 2022
A TextView that automatically fit its font and line count based on its available size and content

AutoFitTextView A TextView that automatically fit its font and line count based on its available size and content This code is heavily based on this S

null 899 Jan 2, 2023
A TextView library that allows the user to increase/decrease font size with a two finger gesture by the user.

PinchZoomTextView Library This library allows you to have a TextView that will grow/shrink the font size using gestures from the user. Usage To have a

null 311 Nov 23, 2022
Form validation and feedback library for Android. Provides .setText for more than just TextView and EditText widgets. Provides easy means to validate with dependencies.

android-formidable-validation Form validation and feedback library for Android. Provides .setText for more than just TextView and EditText widgets. Pr

Linden 147 Nov 20, 2022
Simple way to create linked text, such as @username or #hashtag, in Android TextView and EditText

Simple Linkable Text Simple way to create link text, such as @username or #hashtag, in Android TextView and EditText Installation Gradle Add dependenc

Aditya Pradana Sugiarto 76 Nov 29, 2022
A library to show emoji in TextView, EditText (like WhatsApp) for Android

Discontinued This projected is discontinued. Please consider using other alternative, i.e EmojiCompat. Contact me if you want to continue working on a

Hieu Rocker 3.6k Jan 5, 2023
AutosizeEditText for Android is an extension of native EditText that offer a smooth auto scale text size.

AutoscaleEditText AutosizeEditText for Android is an extension of native EditText that offer a smooth auto scale text size. Latest Version How to use

Txus Ballesteros 354 Nov 28, 2022
A simple and flexible Checked TextView or Checkable TextView

CheckableTextView Checkable TextView [KOTLIN] ⚡ A simple and flexible Checked TextView or Checkable TextView written in Kotlin ⚡ What's New Animation

null 110 Nov 20, 2022
Mentions-TextView - Make Mentions and hashtags clickable in Textview

Mentions Textview Custome Textview with Mentions and hashtags being clickable. D

null 2 Jan 9, 2022