Implement a simple and funny Android animation —— the emoji rain in WeChat app.

Related tags

UI/UX EmojiRain
Overview

中文版文档

Emoji Rain

Hey, it's raining emoji!

This is a really simple and funny animation for Android. You could find similar animations when sending "Happy birthday" or something else special in WeChat app.

Now you are able to add this funny thing to your own app as well. Give a surprise to your users on Christmas Day by dropping emojis! :D

Usage

Gradle dependency

dependencies {
    compile 'com.luolc:emoji-rain:0.1.1'
}

Config

  • per
    • How many emojis will dropping in each flow, default 6
  • duration
    • The total duration of the animation, default 8000ms
  • dropDuration
    • The average dropping duration for a specific emoji, default 2400ms
  • dropFrequency
    • The interval between two flows, default 500ms

Config in layout. EmojiRainLayout inherits from FrameLayout. You can just use it as a native FrameLayout view.

<com.luolc.emojirain.EmojiRainLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/group_emoji_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:per="10"
        app:duration="7200"
        app:dropDuration="2400"
        app:dropFrequency="500"
        tools:context="com.luolc.emojirain.sample.MainActivity">

    <TextView
            android:text="Hello world!"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
</com.luolc.emojirain.EmojiRainLayout>

Config in java code.

public class MainActivity extends AppCompatActivity {

    private EmojiRainLayout mContainer;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // bind view
        mContainer = (EmojiRainLayout) findViewById(R.id.group_emoji_container);

        // add emoji sources
        mContainer.addEmoji(R.drawable.emoji_1_3);
        mContainer.addEmoji(R.drawable.emoji_2_3);
        mContainer.addEmoji(R.drawable.emoji_3_3);
        mContainer.addEmoji(R.drawable.emoji_4_3);
        mContainer.addEmoji(R.drawable.emoji_5_3);

        // set emojis per flow, default 6
        mContainer.setPer(10);

        // set total duration in milliseconds, default 8000
        mContainer.setDuration(7200);

        // set average drop duration in milliseconds, default 2400
        mContainer.setDropDuration(2400);

        // set drop frequency in milliseconds, default 500
        mContainer.setDropFrequency(500);
    }
}

Start animation.

mContainer.startDropping();

Stop animation.

mContainer.stopDropping();

Compatibility

Android midSdkVersion 14.

License

Copyright 2016, Liangchen Luo.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
Simple and lightweight UI library for user new experience, combining floating bottom navigation and bottom sheet behaviour. Simple and beautiful.
Simple and lightweight UI library for user new experience, combining floating bottom navigation and bottom sheet behaviour. Simple and beautiful.

Simple and lightweight UI library for user new experience, combining floating bottom navigation and bottom sheet behaviour. Simple and beautiful.

Sentinel is a simple one screen UI which provides a standardised entry point for tools used in development and QA alongside device, application and permissions data.
Sentinel is a simple one screen UI which provides a standardised entry point for tools used in development and QA alongside device, application and permissions data.

Sentinel Sentinel is a simple one screen UI that provides standardised entry point for tools used in development and QA alongside device, application

Simple card app for Udacity's Android Basics: User Interface course

just-because-card Simple card app for Udacity's Android Basics: User Interface c

A simple screen that is shown when your app gets crashed instead of the normal crash dialog. It's very similar to the one in Flutter.
A simple screen that is shown when your app gets crashed instead of the normal crash dialog. It's very similar to the one in Flutter.

Red Screen Of Death What A simple screen that is shown when your app gets crashed instead of the normal crash dialog. It's very similar to the one in

Drawing App: A simple drawing application that allows the user to draw using a pencil or using shapes
Drawing App: A simple drawing application that allows the user to draw using a pencil or using shapes

Drawing-App Drawing app is a simple drawing application that allows the user to

Snake View is a simple and animated linear chart for Android.
Snake View is a simple and animated linear chart for Android.

Snake View Snake library is a simple and animation line chart for Android. Latest Version How to use Configuring your project dependencies Add the lib

This library provides a simple way to add a draggable sliding up panel (popularized by Google Music and Google Maps) to your Android application. Brought to you by Umano.
This library provides a simple way to add a draggable sliding up panel (popularized by Google Music and Google Maps) to your Android application. Brought to you by Umano.

Note: we are not actively responding to issues right now. If you find a bug, please submit a PR. Android Sliding Up Panel This library provides a simp

A simple, customizable and easy to use swipeable view stack for Android.
A simple, customizable and easy to use swipeable view stack for Android.

SwipeStack A simple, customizable and easy to use swipeable view stack for Android. QuickStart Include the Gradle dependency dependencies { compil

An Android library containing a simple TableView and an advanced SortableTableView providing a lot of customisation possibilities to fit all needs.
An Android library containing a simple TableView and an advanced SortableTableView providing a lot of customisation possibilities to fit all needs.

SortableTableView for Android An Android library providing a TableView and a SortableTableView. Minimum SDK-Version: 11 | Compile SDK-Version: 25 | La

Comments
  • App Crashes in release build

    App Crashes in release build

    Hii there I am using this wonderful library in several projects. But there is a problem that App crashes in the release build. please help in applying proguard rules of this library

    opened by shahzeb8285 3
  • 库使用了plugins以后产生的问题

    库使用了plugins以后产生的问题

    貌似和PermissionsDispatcher产生冲突了啊 。。。也看了前面的那个issue,项目里正好要用到这种库,但是却发现不仅要引入rxjava,而且还要搞: apply plugin: 'me.tatarka.retrolambda' apply plugin: 'com.neenbedankt.android-apt' 这个东东。。。。 然后刚引进这个东西PermissionsDispatcher也报错了。。。 手动大哭。T_T !

    opened by yaochangliang159 1
  • Set the annimation to the back ?

    Set the annimation to the back ?

    Hello, i loved the project i have a question, is there a way to set the falling animation not go over the button/text while its falling ? like bring to front the text and the button i don't know if you got the idea ?

    opened by ziadkiwan 5
  • Issue #2: remove the dependency of RxJava

    Issue #2: remove the dependency of RxJava

    I add method startDrop() and stopDrop() . It used Handler to start animation has frequency. I don't get ImageView in a new Thread, it's not normative. but it works normally. To be better, I think we can start a new Thread to get ImageView, then use Handler or post() start animation in mainThread. I'm not very good at View.

    opened by whyalwaysmea 0
Owner
LoLo
A fool living in the amazing world.
LoLo
Android Library to implement simple touch/tap/swipe gestures

SimpleFingerGestures An android library to implement simple 1 or 2 finger gestures easily Example Library The library is inside the libSFG folder Samp

Arnav Gupta 315 Dec 21, 2022
Regret is an Android library for apps that wants to implement an undo/redo feature

Regret I've been developing on an editor for my Android App recently, using Jetpack Compose, but Google doesn't implement a built-in undo / redo for d

Moriafly 5 Jun 29, 2022
A CirclerTimer with Animation and Timer

CircleTimer-Android A CirclerTimer with Animation and Timer Setup To use this library your minSdkVersion must be >= 21. In your build.gradle : allproj

jaeryo2357 17 Nov 7, 2022
This is a library to help creating expanding views with animation in Android

About the Library inspiration This library is strongly inspired in this concept from Hila Peleg in dribble. See it below Working example For more deta

Diego Bezerra 944 Dec 27, 2022
Android library for fluid tablayout animation as seen on Snapchat.

SnapTabLayout Show some ❤️ and star the repo to support the project This library is the implementation of TabLayout as seen on popular messaging app S

Niranjan Kurambhatti 714 Dec 25, 2022
Cube grid animation about the android.

CubeGrid Cube grid animation about the android. The android implementation about the 9-cube-grid Demo Usage Add dependency allprojects { repositories

alighters 218 Nov 23, 2022
Animation View to Highlight particular Views 🎯 for Android

TargetView Animation View to Highlight particular Views ?? for Android, it can be Used with Views that you see important (Like CountDownTimer), And al

Anas Altair 53 Aug 7, 2021
FloatingView can make the target view floating above the anchor view with cool animation

FloatingView FloatingView can make the target view floating above the anchor view with cool animation Links 中文版 README Blog about FloatingView demo.ap

UFreedom 1.8k Dec 27, 2022
Pop animation with circular dust effect for any view updation

Popview-Android Pop animation with circular dust effect for any view updation Getting Started In your build.gradle dependencies { compile 'rb.popv

R B Krishna 489 Dec 28, 2022
A download progressbar with cool animation

FreshDownloadView ##About FreshDownloadView is a java library for Android,It's a good way to show download progress with a cool animtion.some inspirat

null 747 Nov 23, 2022