Giter Site home page Giter Site logo

animatedgradienttextview's Introduction

alt tag

AnimatedGradientTextView : Color gradients for TextView

This library will allow you to create TextView which uses color gradients and custom fonts.

Changelog

  • v0.0.6

    • Fix crash
  • v0.0.5

    • app:font become app:customFont
    • Add app:maxFPS (define how many times the gradient should refresh each second)

Latest release

The most recent release is v0.0.6, released August 29, 2017

To add a dependency using Gradle, add in your top-level build.gradle:

allprojects {
	repositories {
		...
		maven { url "https://jitpack.io" }
	}
}

And then add in your app build.gradle :

dependencies {
	compile 'com.github.Mursaat:AnimatedGradientTextView:v0.0.6'
}

Getting started

Firstly, don't forget to add this in your container layout :

xmlns:app="http://schemas.android.com/apk/res-auto"

Here is an exemple using an AnimatedGradientTextView. I just put in my xml layout :

<com.mursaat.extendedtextview.AnimatedGradientTextView
	...
	app:colors="@array/funny_colors"
	app:simultaneousColors="4"
	app:angle="45"
	app:speed="1000"
	app:maxFPS="30"
	app:customFont="BebasNeue.otf" 
	/>

All these parameters are optionals. Some explanations :

  • colors : It must reference an array of colors in res/values/attr.xml, for example :
<?xml version="1.0" encoding="utf-8"?>
<resources>
	...
    <array name="funny_colors">
        <item>@color/materialRed</item>
        <item>@color/materialLime</item>
        <item>@color/materialOrange</item>
        <item>@color/materialPurple</item>
    </array>
</resources>
  • simultaneousColors : The number of colors (of the array) possibly displayed in a same time
  • angle : The angle of the color gradient
  • speed : A number in milliseconds. Increase this number will decrease the gradient move speed
  • customFont : Must be a name of a font located in assets/fonts folder
  • maxFPS : Define how many times the gradient should refresh each second. (Default : 24 FPS)

animatedgradienttextview's People

Contributors

aureldussauge 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

Watchers

 avatar  avatar  avatar  avatar

animatedgradienttextview's Issues

Customize MAX FPS

Allow the user to customize the MAX FPS of the gradient text including reducing the FPS. Currently, the FPS is set to 60 which demands massive CPU usage. Reducing the FPS to 30 or 24 could cut the CPU usage by half.

Any similar library for iOS?

Hi @Mursaat,

First of all I would like to appreciate for creating such a nice, cool library.

Have you come across any similar library for iOS platform? I have search a lot but could not get any similar library for the same.

Thanks
Pranav

Stop Gradient When Screen is Off

The gradient should stop animating when the screen is off to save battery. Currently, the gradient animation continues with the screen off and drains battery.

Colors inaccurate

The colors are really inaccurate, I'm guessing that because of some blending. Is there a way to make it stop?

v0.0.5 Crashes

Thanks for making the gradient animation pause when not visible! Unfortunately, the changes cause my app to crash. I believe commit b15663f is the culprit.

Whenever I open an activity with AnimatedGradientTextView, the following error immediately occurs:

java.lang.IllegalArgumentException
                                                                       at java.util.concurrent.ScheduledThreadPoolExecutor.scheduleAtFixedRate(ScheduledThreadPoolExecutor.java:566)
                                                                       at java.util.concurrent.Executors$DelegatedScheduledExecutorService.scheduleAtFixedRate(Executors.java:658)
                                                                       at com.mursaat.extendedtextview.GradientManager.startGradient(GradientManager.java:173)
                                                                       at com.mursaat.extendedtextview.AnimatedGradientTextView.onSizeChanged(AnimatedGradientTextView.java:36)

What might be causing the problem?

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.