A little animation framework which could help you to show message in a nice looking way

Overview

TextSurface

A little animation framework which could help you to show message in a nice looking way.

Usage

  1. Create TextSurface instance or add it in your layout.
  2. Create Text instancies with TextBuilder defining appearance of text and position:
Text textDaai = TextBuilder
		.create("Daai")
		.setSize(64)
		.setAlpha(0)
		.setColor(Color.WHITE)
		.setPosition(Align.SURFACE_CENTER).build();
  1. Create animations and pass them to the TextSurface instance:
textSurface.play(
		new Sequential(
				Slide.showFrom(Side.TOP, textDaai, 500),
				Delay.duration(500),
				Alpha.hide(textDaai, 1500)
		)
);

See full sample here.

Adjusting animations

  • To play animations sequentially use Sequential.java

  • To play animations simultaneously use Parallel.java

  • Animations/effects could be combined like this:

    new Parallel(Alpha.show(textA, 500), ChangeColor.to(textA, 500, Color.RED))

    i.e. alpha and color of text will be changed simultaneously in 500ms

Adding your own animations/effects

There're two basic classes which you could extend to add custom animation:

Proguard configuration

The framework is based on standard android animation classes which uses reflection extensively. To avoid obfuscation you need to exclude classes of the framework:

-keep class su.levenetc.android.textsurface.** { *; }

Download

repositories {
    maven { url "https://jitpack.io" }
}
//...
dependencies {
    //...
    compile 'com.github.elevenetc:textsurface:0.9.1'
}

Licence

http://www.apache.org/licenses/LICENSE-2.0

Comments
  • Its not working with proguard build

    Its not working with proguard build

    i put this in my proguard build to try and help but it did not help:

    -keepclasseswithmembernames class xsu.levenetc.android.textsurface.** { }

    what im experiencing is not a failure but rather the animation wont run on release builds.

    opened by j2emanue 2
  • Remove unnecessary tag in manifest

    Remove unnecessary tag in manifest

    Manifest merge error has occurred.

      1 Error:Execution failed for task ':myapp:processDebugManifest'.
      2 > Manifest merger failed : Attribute application@label value=(My app name) from AndroidManifest.xml:33:5-32
      3     is also present at [com.github.elevenetc:textsurface:0.9.1] AndroidManifest.xml:13:9-41 value=(@string/app_name)
      4         Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:7:3-10:7 to
    
    

    Can you merge?

    opened by ogaclejapan 1
  • Remove unnecessary tag in manifest

    Remove unnecessary tag in manifest

    Manifest merge error has occurred.

      1 Error:Execution failed for task ':myapp:processDebugManifest'.
      2 > Manifest merger failed : Attribute application@label value=(My app name) from AndroidManifest.xml:33:5-32
      3     is also present at [com.github.elevenetc:textsurface:0.9.1] AndroidManifest.xml:13:9-41 value=(@string/app_name)
      4         Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:7:3-10:7 to
    
    

    Can you merge?

    opened by ogaclejapan 1
  • call backs for listening to animation events

    call backs for listening to animation events

    Why is there no listener ? how do i know when the animation ends ? You should create a listener with hooks so i know when animation ends so i can do something when it completes. Even if i hook into setLayoutAnimationListener no call backs come.

    opened by j2emanue 1
  • Failed to resolve: com.github.elevenetc:textsurface:0.9.1

    Failed to resolve: com.github.elevenetc:textsurface:0.9.1

    Hi !

    I would like to use your code, but when i just add "compile 'com.github.elevenetc:textsurface:0.9.1' " (i tried with "implementation" too), the build fail with this error...

    ERROR: Failed to resolve: com.github.elevenetc:textsurface:0.9.1

    Any idea to solve this issue ?

    Thx !

    opened by Hobyrr 0
  • IllegalArgumentException , android 11

    IllegalArgumentException , android 11

    java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed at android.graphics.Canvas.checkValidClipOp(Canvas.java:853) at android.graphics.Canvas.clipRect(Canvas.java:992) at su.levenetc.android.textsurface.animations.Slide.apply(Slide.java:157) at su.levenetc.android.textsurface.Text.onDraw(Text.java:112) at su.levenetc.android.textsurface.TextSurface.onDraw(TextSurface.java:88) at android.view.View.draw(View.java:22350) at android.view.View.updateDisplayListIfDirty(View.java:21226) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473) at android.view.View.updateDisplayListIfDirty(View.java:21186) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473) at android.view.View.updateDisplayListIfDirty(View.java:21186) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473) at android.view.View.updateDisplayListIfDirty(View.java:21186) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473) at android.view.View.updateDisplayListIfDirty(View.java:21186) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)

    i think the fix for this could be here: https://stackoverflow.com/q/52922866/835883

    can you see how can help resolve this ? on older device not seeing the issue.

    opened by j2emanue 1
  • Kotlin migration

    Kotlin migration

    • Converted to Kotlin
      • ScaleValue and Position converted into data classes
      • Getters and setters replaced with fields where possible
      • Static utility methods replaced extensions functions where possible
      • Java collections replaced with Kotlin ones
      • Functional interfaces replaced with lambdas
      • String concat replaced with kotlin templates
    • Improved package structure
    • Simplified core entities hierarchy
    • Removed excessive invalidate calls (text reveal animations)
    • Renamed generic Debug to TextSurfaceDebug to avoid spoiling namespace
    • Renamed TextBuilder > Text.Builder
    • Added @CallSuper to TextEffect.onStart
    • Added @CallSuper to SurfaceAnimation.cancel
    • Added support of ScrollView Fixes #13
    opened by elevenetc 0
  • To open a new activity when the display get over.

    To open a new activity when the display get over.

    i was trying to open the new activity as when the display or hole text is displayed and there was some problem and it is not running...so how can i open a new activity when the text id displayed.

    opened by ANKIT-KUMAR-SRIVASTAVA 3
  • java.lang.UnsupportedOperationException

    java.lang.UnsupportedOperationException

    #1838 03-20 17:15:20.929 30309 E AndroidRuntime FATAL EXCEPTION: main #1839 03-20 17:15:20.929 30309 E AndroidRuntime java.lang.UnsupportedOperationException #1840 03-20 17:15:20.929 30309 E AndroidRuntime at android.view.GLES20Canvas.clipPath(GLES20Canvas.java:446) #1841 03-20 17:15:20.929 30309 E AndroidRuntime at su.levenetc.android.textsurface.animations.SideCut.clip(SideCut.java:118) #1842 03-20 17:15:20.929 30309 E AndroidRuntime at su.levenetc.android.textsurface.animations.ShapeReveal.apply(ShapeReveal.java:43) #1843 03-20 17:15:20.929 30309 E AndroidRuntime at su.levenetc.android.textsurface.Text.onDraw(Text.java:112) #1844 03-20 17:15:20.929 30309 E AndroidRuntime at su.levenetc.android.textsurface.TextSurface.onDraw(TextSurface.java:88) #1845 03-20 17:15:20.929 30309 E AndroidRuntime at android.view.View.draw(View.java:11014) #1846 03-20 17:15:20.929 30309 E AndroidRuntime at android.widget.FrameLayout.draw(FrameLayout.java:450) #1847 03-20 17:15:20.929 30309 E AndroidRuntime at android.view.View.getDisplayList(View.java:10444) #1848 03-20 17:15:20.929 30309 E AndroidRuntime at android.view.ViewGroup.drawChild(ViewGroup.java:3167) #1849 03-20 17:15:20.929 30309 E AndroidRuntime at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2793) #1850 03-20 17:15:20.929 30309 E AndroidRuntime at android.view.View.getDisplayList(View.java:10442) #1851 03-20 17:15:20.929 30309 E AndroidRuntime at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2904) #1852 03-20 17:15:20.929 30309 E AndroidRuntime at android.view.View.getDisplayList(View.java:10407) #1853 03-20 17:15:20.929 30309 E AndroidRuntime at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2904) #1854 03-20 17:15:20.929 30309 E AndroidRuntime at android.view.View.getDisplayList(View.java:10407) #1855 03-20 17:15:20.929 30309 E AndroidRuntime at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2904) #1856 03-20 17:15:20.929 30309 E AndroidRuntime at android.view.View.getDisplayList(View.java:10407) #1857 03-20 17:15:20.929 30309 E AndroidRuntime at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2904) #1858 03-20 17:15:20.929 30309 E AndroidRuntime at android.view.View.getDisplayList(View.java:10407) #1859 03-20 17:15:20.929 30309 E AndroidRuntime at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:903) #1860 03-20 17:15:20.929 30309 E AndroidRuntime at android.view.ViewRootImpl.draw(ViewRootImpl.java:2123) #1861 03-20 17:15:20.929 30309 E AndroidRuntime at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1810) #1862 03-20 17:15:20.929 30309 E AndroidRuntime at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2700) #1863 03-20 17:15:20.929 30309 E AndroidRuntime at android.os.Handler.dispatchMessage(Handler.java:99) #1864 03-20 17:15:20.929 30309 E AndroidRuntime at android.os.Looper.loop(Looper.java:156) #1865 03-20 17:15:20.929 30309 E AndroidRuntime at android.app.ActivityThread.main(ActivityThread.java:5109) #1866 03-20 17:15:20.929 30309 E AndroidRuntime at java.lang.reflect.Method.invokeNative(Native Method) #1867 03-20 17:15:20.929 30309 E AndroidRuntime at java.lang.reflect.Method.invoke(Method.java:511) #1868 03-20 17:15:20.929 30309 E AndroidRuntime at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:991) #1869 03-20 17:15:20.929 30309 E AndroidRuntime at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:758) #1870 03-20 17:15:20.929 30309 E AndroidRuntime at dalvik.system.NativeStart.main(Native Method)

    opened by tengbinlive 0
  • Help on a transition // Alpha.Remove?

    Help on a transition // Alpha.Remove?

    Hi I want to do something like this: I have a text like: Hello And i wan't 'e' to vanish and push the text to the left so that it says together like this: Hllo

    I don't know how to push the text to the left after i do Alpha.hide. __

    In other ways, Is there anything like a Alpha.Remove so that the next word I insert goes in the position that I removed.

    Can you help me? Thanks

    opened by DuarteBarbosaPT 0
Releases(0.9.1)
Owner
Eugene Levenetc
Eugene Levenetc
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
Digipad is a simple library for Android that only show a numeric keyboard onscreen

Digipad is a simple library for Android that only show a numeric keyboard onscreen Adding dependencies Add this to your build.gradle:

Yoga C. Pranata 7 Jun 24, 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
A simpler way to style your TextViews

BabushkaText BabushkaText is a custom TextView which lets you customize the styling of parts of your text via Spannables, but without the hassle of ha

Henrique Boregio 752 Dec 29, 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 simpler way to style your TextViews

BabushkaText BabushkaText is a custom TextView which lets you customize the styling of parts of your text via Spannables, but without the hassle of ha

Henrique Boregio 753 Jun 7, 2022
Dealing with Android Text by simple way to get high performance.

Gapo Android RichText RichText supports Hashtag, Mention, Url, Phone Number, Email, Markdown, Custom Span, SeeMore/SeeLess by limited line or length,

GapoWork 8 Oct 20, 2021
Dealing with Android Text by simple way to get high performance.

Gapo Android RichText RichText supports Hashtag, Mention, Url, Phone Number, Email, Markdown, Custom Span, SeeMore/SeeLess by limited line or length,

GapoWork 8 Oct 20, 2021
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

Maksim 430 Nov 20, 2022
Provides a set of views which allows to adjust the spacing between the characters of that view, AKA, Kerning effect.

KerningViews KerningViews provides a set of views (currently only TextView and Button) which lets you adjust the spacing between the characters in the

Aritra Roy 148 Aug 7, 2022
Include MatchTextView and MatchButton..Come..you will like it

Android MatchView This project is learned from (https://github.com/liaohuqiu/android-Ultra-Pull-To-Refresh) . Thanks for liaohuqiu.. I like the animat

Roger 858 Dec 7, 2022
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
Custom view to expand long text with view more,less action , you can customize min lines , action color

ExpandableTextView Custom expadable text view Examples : <mostafa.projects.expandabletextview.ExpandableTextView android:layout_wi

Mostafa Gad 8 Jan 25, 2022
A little animation framework which could help you to show message in a nice looking way

TextSurface A little animation framework which could help you to show message in a nice looking way. Usage Create TextSurface instance or add it in yo

Eugene Levenetc 2.3k Dec 30, 2022
AndroidBriefActions - Android library for sending and observing non persistent actions such as showing a message; nice readable way to call navigation actions from ViewModel or Activity/Fragment.

implementation "com.vladmarkovic.briefactions:briefactions:$briefActionsVersion" Benefits Why use brief-actions library pattern: Prevent short-term ac

null 2 Dec 22, 2022
This is a easy way to publish MQTT message and receive MQTT message

SMQ-CLIENT This is a easy way to publish MQTT message and receive MQTT message This is provider a spring stater for quick use Recive message form the

SUDA 1 Apr 25, 2022
Android-Study-Jams - An app which could help your fellow students or faculty or college

NOTIFY Problem Statement College or University App : An app which could help you

Shristi Sarma 1 Jan 10, 2022
A tiny Android app that can receive WhatsApp group message export files and parse message history stats.

A tiny Android app that can receive WhatsApp group message export files and parse message history stats.

Zac Sweers 2 May 3, 2022
LiteHttp is a simple, intelligent and flexible HTTP framework for Android. With LiteHttp you can make HTTP request with only one line of code! It could convert a java model to the parameter and rander the response JSON as a java model intelligently.

Android network framework: LiteHttp Tags : litehttp2.x-tutorials Website : http://litesuits.com QQgroup : 42960650 , 47357508 Android网络通信为啥子选 lite-htt

马天宇 829 Dec 29, 2022