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 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
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
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
☁️🌤🌧☀ Weather Android application that gives you the weather information of your saved location or any region you are looking for☁️🌤🌧☀

☁️????☀ Weather Android application that gives you the weather information of your saved location or any region you are looking for☁️????☀

Nisa Efendioğlu 4 Apr 6, 2022
An adapter which could be used to achieve a parallax effect on RecyclerView.

android-parallax-recycleview Integration Step 1. Add the JitPack repository to your build file repositories { maven { url "https://jitpack

Pedro Oliveira 1.6k Nov 17, 2022
Customtoast is a android library for show your toast message in a custom UI.

CUSTOM TOAST customtoast is a android library for show your toast message in a custom UI. To get a Git project into your build: Step 1. Add the JitPac

ebinumer 1 Apr 22, 2022
A very simple Android app which shows you random memes with the help of meme-api which you can share with your friends!

Meme Share A very simple Android app which shows you random memes with the help of meme-api which you can share with your friends! Tech stack 100% wri

Stɑrry Shivɑm 8 Aug 10, 2022
An easy, flexible way to have the toast message displayed.

IToaster Library An easy, flexible way to have the toast message displayed. Download Gradle Add below codes to your root build.gradle file (not your m

Evans Kiptarus Kibet 1 Mar 19, 2022
With MaterialTimelineView you can easily create a material looking timeline.

MaterialTimelineView With MaterialTimelineView you can easily create a material looking timeline. Setup The library is pushed to jCenter() as an AAR,

Przemek 454 Dec 19, 2022
Kotlin way of building RecyclerView Adapter 🧩. You do not have to write RecyclerView Adapters again and again and suffer from handling of different view types. Kiel will help you.

Kiel Kiel is a RecyclerView.Adapter with a minimalistic and convenient Kotlin DSL which provides utility on top of Android's normal RecyclerView.Adapt

ibrahim yilmaz 370 Jan 2, 2023
Flexible switch is a responsive switch with some nice features which developers can use for making awesome switches on android platform.

flexible-switch It is a responsive switch in android, it can resize itself according to its size. It's recommended to use it with ConstraintLayout to

Coders Route 5 Dec 20, 2022
Gameforma is a simple game list application where user could explore more than 350.000 games

Gameforma is a simple game list application where user could explore more than 350.000 games data provided from RAWG Video Games Database API. Built with MVVM repositoy pattern, clean architecture in order to finish Dicoding Menjadi Android Developer Expert's (MADE) class submission.

Naufal Aldy Pradana 3 Sep 22, 2022