Giter VIP home page Giter VIP logo

secrettextview's Introduction

SecretTextView

Android Arsenal

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 like a normal TextView for the most part.

    <com.mattkula.secrettextview.SecretTextView
            android:id="@+id/textview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:text="This is a demo of Matt Kula's Secret TextView"
            android:textSize="30sp"
            android:textColor="@android:color/black"
            />

To fade in or fade out the text:

secretTextView.show();    // fade in
secretTextView.hide();    // fade out
secretTextView.toggle();  // fade in or out depending on current state

To change the duration of the fading (default is 2.5 seconds):

secretTextView.setDuration(3000);     // set fade duration to 3 seconds

To set visibility without fading in or out:

secretTextView.setIsVisible(true);
secretTextView.setIsVisible(false);

secrettextview's People

Contributors

ghlin-daniel avatar matthewrkula avatar otaviommendes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

secrettextview's Issues

farsi font in android 4.2.2

hi matthewrkula thanks for this very cool lib.
but i have problem in android 4.2.2 whit persian or farsi fonts .
in android 4.2.2 farsi words showing sepratly
i test in other apis and your libs works fine but in 4.2.2 have a problem with farsi font
sample farsi font
هرکه قدر خویش را بشناسد نابود نخواهد شد
device-2016-01-07-071921

Licence information

Hello Matt!

I like your SecretTextView and I'm going to use it in my project. Could you please provide licence information? It is very important for me.

Backport to support Android 2.x

I see in your Manifest, minSDK=11.
Could you please make SecretTextView compatible with Android 2.x?
(Is NineOldAndroid library helpful to backport animation of SecretTextView?)

setText() does not work after calling show() or hide().

Once show() or hide() is called, mIsReset becomes always true and setText() does not work.
I fix it as below. Is it ok?

private void resetSpannableString(double percent){
mIsReset = true;
...
mIsReset = false;
}

remove mIsReset = false; from resetIfNeeded()

Performance issue: Frequently GC

Tks for your nice code first, but...
while running your demo, I found the memory usage like this (tested on Genymotion 2.4 with intel acceleration, x64, android 5.1.0 on nexus 4):
image

Obviously, it's cause by:
image


I have fix that problem, pls see you pull request.
The work I did is:
1, Use a MutableForegroundColorSpan to maintain the foreground color, instead new a ForeGroundColorSpan every time.
2, Change the MutableForegroundColorSpan object's color when needed.

Here is memory usage after my fix(tested on Genymotion 2.4 with intel acceleration, x64, android 5.1.0 on nexus 4):
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.