Convert Figma logo to code with AI

hanks-zyh logoHTextView

Animation effects to text, not really textview

5,610
810
5,610
44

Top Related Projects

4,385

An Android text view with scrolling text change animation

A Span-based library to make your text jump like Mexican beans. Oh, and the "..."s in Hangouts.

A TextView that changes its content automatically every few seconds

A fluent Android animation library

Quick Overview

HTextView is an Android library that provides various animated text effects for TextView. It offers a collection of custom TextView implementations with different animation styles, allowing developers to easily add dynamic and visually appealing text transitions to their Android applications.

Pros

  • Wide variety of text animation effects
  • Easy integration into existing Android projects
  • Customizable animation parameters
  • Smooth and performant animations

Cons

  • Limited documentation and examples
  • Some animation effects may not be suitable for all use cases
  • Potential performance impact on older devices with complex animations
  • Lack of recent updates or maintenance

Code Examples

  1. Scale Animation:
HTextView hTextView = findViewById(R.id.text);
hTextView.setAnimateType(HTextViewType.SCALE);
hTextView.animateText("Hello, HTextView!");
  1. Evaporate Animation:
HTextView hTextView = findViewById(R.id.text);
hTextView.setAnimateType(HTextViewType.EVAPORATE);
hTextView.animateText("Evaporating text");
  1. Typer Animation:
HTextView hTextView = findViewById(R.id.text);
hTextView.setAnimateType(HTextViewType.TYPER);
hTextView.setTyperString("Typing effect|");
hTextView.animateText("Typed text");
  1. Custom Animation Duration:
HTextView hTextView = findViewById(R.id.text);
hTextView.setAnimateType(HTextViewType.FALL);
hTextView.setAnimationDuration(1500);
hTextView.animateText("Falling text");

Getting Started

  1. Add the dependency to your app's build.gradle file:
dependencies {
    implementation 'com.hanks:htextview-base:0.1.6'
    implementation 'com.hanks:htextview-fade:0.1.6'
    implementation 'com.hanks:htextview-line:0.1.6'
    // Add other effects as needed
}
  1. Add the HTextView to your layout XML:
<com.hanks.htextview.fade.FadeTextView
    android:id="@+id/text"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Hello, HTextView!" />
  1. Initialize and use the HTextView in your Activity or Fragment:
HTextView hTextView = findViewById(R.id.text);
hTextView.setAnimateType(HTextViewType.FADE);
hTextView.animateText("Animated text");

Competitor Comparisons

4,385

An Android text view with scrolling text change animation

Pros of ticker

  • More focused on number animations, making it ideal for financial applications
  • Smoother animations with better performance optimization
  • Supports custom typefaces and character lists

Cons of ticker

  • Limited to scrolling animations only
  • Less variety in text animation styles compared to HTextView
  • Requires more setup for complex animations

Code comparison

HTextView:

HTextView hTextView = findViewById(R.id.text);
hTextView.setAnimateType(HTextViewType.SCALE);
hTextView.animateText("Hello, HTextView!");

ticker:

TickerView tickerView = findViewById(R.id.tickerView);
tickerView.setCharacterLists(TickerUtils.provideNumberList());
tickerView.setText("1234");

Key differences

  • HTextView offers multiple animation types (scale, evaporate, fall, etc.), while ticker focuses on scrolling animations
  • ticker is more suitable for number-based animations, whereas HTextView is versatile for various text animations
  • HTextView provides easier setup for different animation styles, but ticker offers more control over character lists and animations

Use cases

  • HTextView: General text animations, creative UI elements, diverse text transitions
  • ticker: Financial data display, countdowns, number-heavy interfaces, smooth scrolling animations

Both libraries have their strengths, and the choice depends on the specific requirements of your project and the type of animations you need to implement.

A Span-based library to make your text jump like Mexican beans. Oh, and the "..."s in Hangouts.

Pros of JumpingBeans

  • Simpler implementation focused on a single animation effect (jumping text)
  • Lightweight library with minimal dependencies
  • Easy to integrate into existing TextView widgets

Cons of JumpingBeans

  • Limited to only one animation style (jumping text)
  • Less customization options for animation parameters
  • Not actively maintained (last update was several years ago)

Code Comparison

JumpingBeans:

JumpingBeans.with(textView)
    .appendJumpingDots()
    .build();

HTextView:

HTextView hTextView = findViewById(R.id.text);
hTextView.setAnimateType(HTextViewType.SCALE);
hTextView.animateText("Your text here");

Summary

JumpingBeans is a lightweight library focused on creating a simple jumping text animation effect. It's easy to implement but limited in functionality. HTextView, on the other hand, offers a wider range of text animation styles and more customization options. HTextView is more actively maintained and provides a more comprehensive solution for text animations in Android applications. The choice between the two depends on the specific requirements of the project and the desired level of animation complexity.

A TextView that changes its content automatically every few seconds

Pros of fading-text-view

  • Simpler implementation focused specifically on fading text animations
  • Easier to integrate for basic fading text effects
  • Lightweight library with minimal dependencies

Cons of fading-text-view

  • Limited animation options compared to HTextView's diverse effects
  • Less customization potential for complex text animations
  • Smaller community and fewer updates/maintenance

Code Comparison

HTextView:

HTextView hTextView = findViewById(R.id.text);
hTextView.setAnimateType(HTextViewType.SCALE);
hTextView.animateText("Hello HTextView");

fading-text-view:

FadingTextView fadingTextView = findViewById(R.id.fading_text_view);
String[] texts = {"Text 1", "Text 2", "Text 3"};
fadingTextView.setTexts(texts);
fadingTextView.setTimeout(1, TimeUnit.SECONDS);

HTextView offers more animation types and customization options, while fading-text-view provides a straightforward implementation for fading text effects. HTextView is better suited for complex text animations, whereas fading-text-view is ideal for simple, quick implementations of fading text transitions.

A fluent Android animation library

Pros of ViewAnimator

  • More versatile, allowing animations for various UI elements beyond text
  • Supports chaining multiple animations together for complex effects
  • Provides a fluent API for easier animation creation and customization

Cons of ViewAnimator

  • Less specialized for text animations compared to HTextView
  • May require more code to achieve specific text effects
  • Potentially higher learning curve for developers new to animation libraries

Code Comparison

HTextView:

HTextView hTextView = findViewById(R.id.text);
hTextView.setAnimateType(HTextViewType.SCALE);
hTextView.animateText("Hello, HTextView!");

ViewAnimator:

ViewAnimator
    .animate(textView)
    .scale(0, 1)
    .duration(1000)
    .start();

Key Differences

  • HTextView focuses specifically on text animations, offering pre-built effects
  • ViewAnimator provides a more general-purpose animation solution for various views
  • HTextView may be easier to use for quick text animations, while ViewAnimator offers more flexibility for complex animations across different UI elements

Use Cases

  • Choose HTextView for projects requiring primarily text-based animations with minimal setup
  • Opt for ViewAnimator when needing diverse animations for multiple view types or when creating custom animation sequences

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

HTextView

Animation effects with custom font support to TextView

see iOS Effects
see Flutter Effects


Screenshot

typegif
Scale
Evaporate
Fall
Line
Typer
Rainbow
Fade

Usage

def htextview_version = "0.1.6"
// as 3.0 use implementation
compile "com.hanks:htextview-base:$htextview_version"        // base library

compile "com.hanks:htextview-fade:$htextview_version"        // optional
compile "com.hanks:htextview-line:$htextview_version"        // optional
compile "com.hanks:htextview-rainbow:$htextview_version"     // optional
compile "com.hanks:htextview-typer:$htextview_version"       // optional

compile "com.hanks:htextview-scale:$htextview_version"       // optional
compile "com.hanks:htextview-evaporate:$htextview_version"   // optional
compile "com.hanks:htextview-fall:$htextview_version"        // optional

line

<com.hanks.htextview.line.LineTextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="right"
    android:paddingRight="10dp"
    android:text="This is LineTextView\nToday is Monday"
    android:textSize="16sp"
    app:animationDuration="3000"
    app:lineColor="#1367bc"
    app:lineWidth="4dp"/>

fade

<com.hanks.htextview.fade.FadeTextView
    android:layout_width="240dp"
    android:layout_height="150dp"
    android:gravity="left"
    android:letterSpacing="0.08"
    android:lineSpacingMultiplier="1.3"
    android:text="This is FadeTextView"
    android:textColor="#fff"
    android:textSize="20sp"
    app:animationDuration="1500"/>

typer

<com.hanks.htextview.typer.TyperTextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="this is init sentence."
    app:charIncrease="3"
    app:typerSpeed="80"/>

rainbow

<com.hanks.htextview.rainbow.RainbowTextView
    android:layout_width="120dp"
    android:layout_height="wrap_content"
    android:gravity="right"
    android:text="this is init sentence"
    android:textSize="20sp"
    app:colorSpace="150dp"
    app:colorSpeed="4dp"/>

scale (single line)

<com.hanks.htextview.scale.ScaleTextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="this is init sentence"
    android:textSize="16sp"/>

evaporate (single line)

<com.hanks.htextview.evaporate.EvaporateTextView
    android:layout_width="match_parent"
    android:layout_height="100dp"
    android:gravity="center"
    android:paddingTop="8dp"
    android:text="this is init sentence"
    android:textSize="20sp"/>

fall (single line)

<com.hanks.htextview.fall.FallTextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingBottom="20dp"
    android:text="this is init sentence"
    android:textSize="16sp"/>

Third Party Bindings

React Native

You may now use this library with React Native via the module here

License

This library is licensed under the Apache Software License, Version 2.0.

See LICENSE for full of the license text.

Copyright (C) 2015 [Hanks](https://github.com/hanks-zyh)

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.