A TextView library that allows the user to increase/decrease font size with a two finger gesture by the user.

Overview

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 access to the library, add the dependency to your build.gradle:

	compile 'com.androidessence:pinchzoomtextview:1.0.1'

Developer Notes

By default, the zoom feature is always enabled. If for any reason you want to disable it, simply call the PinchZoomTextView#setZoomEnabled(boolean enabled) method.

Sample

To see the library in action, here is a sample of the text size changing:

Credits & Contact

PinchZoomTextView was created by:

With special thanks to Eric Cugota for helping me get this into Bintray and make it available for you.

And it's released under Android Essence blog.

License

PinchZoomTextView is available under the MIT License. You are free to do with it what you want. If you submit a pull request, please add your name to the credits section. :)

You might also like...
Android experiment showing a sinking TextView
Android experiment showing a sinking TextView

Titanic is an Android experiment reproducing this effect.

A Custom TextView with trim text
A Custom TextView with trim text

ReadMoreTextView A Custom TextView with trim text Download To add the ReadMoreTextView library to your Android Studio project, simply add the followin

Advanced Android TextView

Advanced Android TextView Companion app for my Advanced Android TextView talk, demostrating: Animated CompoundDrawable Text shadow Custom font Non-bre

AutoLinkTextView is TextView that supports Hashtags (#), Mentions (@) , URLs (http://), Phone and Email automatically detecting and ability to handle clicks.
AutoLinkTextView is TextView that supports Hashtags (#), Mentions (@) , URLs (http://), Phone and Email automatically detecting and ability to handle clicks.

AutoLinkTextView Deprecated Please use the new version of AutoLinkTextView AutoLinkTextView is TextView that supports Hashtags (#), Mentions (@) , URL

Implementation of a TextView and all its direct/indirect subclasses with native support for the Roboto fonts, includes the brand new Roboto Slab fonts.
Implementation of a TextView and all its direct/indirect subclasses with native support for the Roboto fonts, includes the brand new Roboto Slab fonts.

Android-RobotoTextView Implementation of a TextView and all its direct/indirect subclasses with native support for the Roboto fonts, includes the bran

A TextView that simulates the effect from the app Secret where the characters fade in/out at different speeds.
A TextView that simulates the effect from the app Secret where the characters fade in/out at different speeds.

SecretTextView A TextView that simulates the effect from the app Secret where the characters fade in/out at different speeds. How To Use Use it just l

This is based on an open source autosizing textview for Android.

SizeAdjustingTextView This is based on an open source autosizing textview for Android I found a few weeks ago. The initial approach didn't resize mult

Simple way to create linked text, such as @username or #hashtag, in Android TextView and EditText
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

Customized and Expandable TextView
Customized and Expandable TextView

Customized and Expandable TextView Simple library to change the Textview as rectangle, circle and square shapes by adding one line of code in xml file

Comments
  • Killing the Android Glyph cache

    Killing the Android Glyph cache

    You might want to think about setting the LINEAR_TEXT_FLAG flag when the ACTION_DOWN even happens and removing it on the ACTION_UP/ACTION_CANCEL event. You can use TextView.setPaintFlags to achieve this.

    https://developer.android.com/reference/android/graphics/Paint.html#LINEAR_TEXT_FLAG

    enhancement 
    opened by slightfoot 9
  • Bug: Scaling assumes an initial font size that's not accurate.

    Bug: Scaling assumes an initial font size that's not accurate.

    When this was initially built, it assumed an initial font size of 13: https://github.com/androidessence/PinchZoomTextView/blob/develop/lib-kotlin/src/main/java/com/adammcneilly/pinchzoomtextview/kotlin/PinchZoomTextView.kt#L86

    That's not always accurate, and if our font size is something else, the scale doesn't seem right. To reproduce:

    1. Set your text view size to something large, like 30sp.
    2. Pinch to try and scale up, but the font size goes down rather than up, because of the line linked.

    We need to get the initial text size and store that, and consider that in our scaling.

    bug 
    opened by AdamMc331 0
  • Add Kotlin Version

    Add Kotlin Version

    While Java and Kotlin are fully interoperable, I thought it would be a fun exercise for academic purposes to create a Kotlin module for this. Aside from the personal experience, other developers could choose between a Kotlin library and Java library to import into their project, and not have to worry about any of the interrop issues.

    enhancement 
    opened by AdamMc331 0
Owner
null
An extension of Android's TextView, EditText and Button that let's you use the font of your choice

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

Hans Petter Eide 165 Nov 11, 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
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 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
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
Lightweight android library for highlighting sections of a textview, with optional callbacks.

Linker Lightweight android library for highlighting Strings inside of a textview (ignoring case), with optional callbacks. Language: Java MinSDK: 17 J

Josh Gainey 35 Apr 30, 2022
Animation effects to text, not really textview

HTextView Animation effects with custom font support to TextView see iOS Effects see Flutter Effects Screenshot type gif Scale Evaporate Fall Line Typ

hanks 5.5k Jan 5, 2023
Android's TextView that can expand/collapse like the Google Play's app description

ExpandableTextView ExpandableTextView is an Android library that allows developers to easily create an TextView which can expand/collapse just like th

Manabu S. 4k Dec 28, 2022
A TextView that automatically resizes text to fit perfectly within its bounds.

AutoFitTextView A TextView that automatically resizes text to fit perfectly within its bounds. Usage dependencies { compile 'me.grantland:autofitt

Grantland Chew 4.2k Jan 1, 2023