Coder Social home page Coder Social logo

othmanemar / fadeintextview-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chtgupta/fadeintextview-android

0.0 0.0 0.0 24.14 MB

A custom TextView library which makes every character appear with a smooth alpha animation

License: MIT License

Java 100.00%

fadeintextview-android's Introduction

Fade-In TextView

Release

Say hi to Fade-In TextView! A custom TextView library which makes every character appear with a smooth alpha animation.

The Fade-In TextView library inherits its properties directly from the native TextView class, which means that all the native TextView methods are supported. There are practically no limitations including multiline support. The library also has some of its own methods and attributes which offer full control over the View.

Installation

Gradle

Step 1. Add the JitPack repository to your build file

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

Step 2. Add the dependency

	dependencies {
	        implementation ('com.github.chtgupta:FadeInTextView-Android:2.1.0') {
          	     exclude module: 'app'
    		}
	}

Maven

Step 1. Add the JitPack repository to your build file

	  <repositories>
          	<repository>
          		<id>jitpack.io</id>
	  		<url>https://jitpack.io</url>
	  	</repository>
	  </repositories>

Step 2. Add the dependency

	<dependency>
	    <groupId>com.github.chtgupta</groupId>
	    <artifactId>FadeInTextView-Android</artifactId>
	    <version>2.1.0</version>
	</dependency>

Usage

In the XML layout

	<believe.cht.fadeintextview.TextView
            android:id="@+id/textView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="30sp"
            android:textColor="@android:color/black"
		
            app:letterDuration="250"/>

In the Java class

  believe.cht.fadeintextview.TextView textView = findViewById(R.id.textView);
  
  // setting a listener for tracking events (optional)
  textView.setListener(new TextViewListener() {
            @Override
            public void onTextStart() {
                Toast.makeText(getBaseContext(), "onTextStart() fired!", Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onTextFinish() {
                Toast.makeText(getBaseContext(), "onTextFinish() fired!", Toast.LENGTH_SHORT).show();
            }
        });
  
  textView.setLetterDuration(250); // sets letter duration programmatically
  textView.setText(); // sets the text with animation (Read "KNOWN BUGS" if it doesn't give desired results)
  textView.isAnimating(); // returns current boolean animation state (optional)
  

Release History

  • 2.1.0
    • Added TextViewListener
    • Created methods to implement TextViewListener in TextView
    • Implemented new additions in the demo app
    • Added new logo by @mansya to the demo app
  • 1.1
    • Added preview text in demo app
  • 1.0
    • Initial release

Known Bugs

  • The default android:text attribute to set the initial text doesn't seem to work, will be fixed in coming versions.
  • If setText() doesn't give desired results, consider calling it from a method and not directly from onCreate().
  • Facing issues cloning/running the project? See this. (Not really a bug, I guess)

Meta

Chahat Gupta – @chtgupta[email protected]

Distributed under the MIT license. See LICENSE for more information.

https://github.com/chtgupta/FadeInTextView-Android/

Contributing

  1. Fork it
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull request so that I can review changes

Support

  • Liked my work? Star it to show support!
  • Used it in your app? Let me know and I'll include your app name, logo and link in this repository.
  • Want to take this to another level? Read CONTRIBUTING again!

License

MIT License

Copyright (c) 2018 Chahat Gupta

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

fadeintextview-android's People

Contributors

chtgupta avatar mansya avatar

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.