• Stars
    star
    442
  • Rank 96,366 (Top 2 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Androids EditText that animates the typed text. EditText is extended to create AnimatedEditText and a PinEntryEditText.

Build Status Android Arsenal

AnimatedEditText for Android

This repository contains AnimatedEditText and TextDrawable all of which extend the behaviour of EditText and implement features that are otherwise not available.

NOTE: PinEntryEditText has been moved to it's own repo on GitHub.

pop in animation

Features

AnimatedEditText

  • Text animates in as typed (4 animations available).
  • Text animates out when cleared using setText(null) or setText("").
  • Smooth forward movement of cursor (API 16+).
  • Smooth backward movement of cursor when clear is called (API 16+, see known issues).
  • Lets you specify any character to be used as a mask for input.

PinEntryEditText

PinEntryEditText has been moved to it's own repo on GitHub.

Others

  • TextDrawable which allows you to set and use text as a drawable.

Usage

Below is a fast guide to getting started. However, if you need to read about these widgets in details. Read more about AnimatedEditText, PinEntryEditText, TextDrawable.

STEP-1

Gradle

If using Jetpack use version Download

dependencies {
    implementation ('com.alimuzaffar.lib:animated-edit-text:2.0.2') {
        // Exclude is only needed if you already have the library
        // mentioned below as a dependency in your app
        exclude group: 'androidx.appcompat', module: 'appcompat'
    }
}

If not using Jetpack use version 1.x Download

dependencies {
    implementation ('com.alimuzaffar.lib:animated-edit-text:1.2.3') {
        // Exclude is only needed if you already have the library
        // mentioned below as a dependency in your app
        exclude group: 'com.android.support', module: 'appcompat-v7'
    }
}

Note: You don't need to exclude all the support groups. However, it's a good idea to do this as your code is likely to use a different version from the library.

STEP-2

Setup AnimatedTextView and PinEntryView in your layout

<com.alimuzaffar.lib.widgets.AnimatedEditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="Animate pop in"
    android:inputType="textNoSuggestions" //recommended when typing text to avoid autocomplete.
    app:animationType="popIn|fromBottom|fromRight|fromMiddle|none" //Optional, default popIn
    app:animateCursor="true|false" //Optional, default true
    app:animateTextClear="true|false" /> //Optional, default true

Use in your code

Use in your code like you would use a regular EditText

EditText regular = (AnimatedEditText) findViewById(R.id.txt_regular);
if (regular != null) {
    String input = regular.getText().toString();
}

Effects :

  1. PopIn (default)
  2. Bottom Up
  3. In from right
  4. In from middle

Demo

Pop-in animation

pop in animation

Bottom Up Animations

bottom up animation

In from right

animate in from right

In from middle

animate in from middle

You can see a YouTube video of all the animations here: YouTube video

Issues :

  • Only works for single line input, the second the line has to wrap, the animation breaks.
  • Animation will work best if android:inputType="textNoSuggestions" is set.
  • Animations are only triggered when adding to the end of the string.
  • Only android:gravity="left|right|center_horizontal" is supported.
  • Smooth back movement of cursor when text is cleared doesn't work too well for android:gravity="center_horizontal"
  • No RTL language support.
  • Animate in from middle doesn't work properly except from android:gravity="left"
  • Not all features of EditText will work
  • Using some Unicode characters as masks causes the cursor to lose position. If this happens, I recommend setting cursor visibility to false or setting textPassword or numberPassword as the input type for the fields which improves the situation but doesn't really solve it in all cases.

License

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.

More Repositories

1

PinEntryEditText

An EditText that looks like a pin entry field. It is highly customisable and even animated text.
Java
668
star
2

android-widget-ticktock

Count down, count up, tick... tock...
Java
201
star
3

android-widget-fanmenu

Android fan menu
Java
197
star
4

android-widget-connectpattern

Draw a pattern to confirm the action, unlock the screen etc.
Java
135
star
5

android-MVVM-DataBinding-RecyclerViewExample

A demo of how to use Jetpack architecture and lifecycle component to implement a RecyclerView. The example has async image loading and item click handling.
Java
101
star
6

ThreadPoolWithCameraPreview

Demo of using threadpools to improve performance on Android
Java
88
star
7

LoopingViewPagerDemo

A demo app for trying to implement a looping ViewPager with a page indicator
Java
65
star
8

PrayTime-Android

Android app for calculating Muslim prayer times and setting and alarm for the prayer times.
Java
64
star
9

android-MVVM-DataBinding-FormExample

A demo of how to use Jetpack architecture and lifecycle component to implement a form. This includes validation and submit.
Java
63
star
10

KotlinFullstackSample

A sample project using Kotlin for backend and front-end (JavaScript)
Kotlin
54
star
11

android-gestures-tutorial

How to detect multiple gestures on Android. Most applications tend to only listen for a simple touch gesture, perhaps the odd app with listen for a swipe or fling... what if you had an application that in a single view had to handle a LOT of Gestures and Taps.
Java
47
star
12

FrostyBackgroundTestApp

An android app demonstrating how to create a blurred and frosted background effect.
Java
39
star
13

RxAndroidDemo

Sample app using RxJava and RxAndroid
Java
31
star
14

android-widget-dotsprogressindicator

Indeterminate progress indicator for android that shows a dots bouncing animation for the progress indicator.
Kotlin
25
star
15

RatioImageView

An Android ImageView that increases the height of the image view automatically so that the image loaded in it retains it's aspect ratio
Java
25
star
16

ReflowTextExample

How to perform shared element activity transition on text while changing text size and color.
Java
14
star
17

Group-Deal-Clone

A Java clone for sites such as GroupOn. This uses Spring 3, Hibernate 4, Apache Tiles and Maven.
Java
10
star
18

sun-status-app

An Android app to calculate the sunrise and sunset times and to allow you to set alerts for sunrise or sunset.
Java
6
star
19

reactjs-webpack-bundle-not-working-demo

This project shows how to reproduce and fix an issue with react projects where webpack-dev-server does not automatically bundle files after changes.
JavaScript
5
star
20

GitHubReleasesDownloader

A quick and dirty application that allows you to download APKs from your GitHub releases. After the file downloads, an install is automatically triggered. This can be useful for testers and small teams to distribute builds internally. It also really helps if you build APKs on Travis and push the APKs to GitHub releases.
Java
5
star
21

android-app-bootstrap-kotlin

An Android app (kotlin) that is pre-configured Dagger, Retrofit, Room and Jetpack
Kotlin
4
star
22

android-child-lock

In development - a way to lock apps and protect access to them using a pin
Java
4
star
23

GPRC-Gateway-Example

A simple example of using GoLang with GRPC and GRPC Gateway to create a RESTful API that connects to MySql.
Go
3
star
24

android-ics-query-calendar

Example on how to query android's local calendar.
Java
2
star
25

GoogleVolleyWithApache4

Google Volley built using Apache 4 (Currently 4.4.1.2)
Java
2
star
26

WeatheringHeights

Weather app based off OpenWeather API
Java
2
star
27

yo-android-app

A Yeoman generator for an android app that uses Dagger, Retrofit, Room, Jetpack and Glide.
Java
2
star
28

lotto-picker-in-c

A lotto picker that has been written in C. Guaranteed to pick winning numbers randomly! (Note: winning numbers may not be for lotteries of past decade)
C
2
star
29

jQuery-Checkbox-Search-Plugin

jQuery Checkbox Search plugin lets you search all checkboxes in a page and select them from within a input field (text)
1
star
30

GDPR-for-developers

A quick write-up on what developers need to know about GDPR.
1
star
31

c-hard-way-learning-exercises

The exercises I did from Zed Shaw's learn C the hard way. http://c.learncodingthehardway.org
C
1
star
32

wallstreet-test-graphql

JavaScript
1
star
33

sypht-android-sample

Preview bills that have been emailed to you by using Sypht API
Kotlin
1
star
34

java-datastructures-algorithms

Java implementation of some common datastructures and algorithms
Java
1
star
35

power-nap-widget

Power nap widget is a simple Android widget that displays 4 buttons and displaying time intervals and lets the user select how long they want to nap for. After the selected period of time an alarm is sound.
Java
1
star