Instagram's emoji reaction for android!

Overview

EmojiReactionView


An Android library to make Emoji Reactions on imageviews in a manner Instagram does this!.


Table of contents

Features

  • Design : The library tries to be reasonably close to the original Instagram's design.
  • Customization : Users can customize the look to a great extent easily and reliably.
  • Support for RecyclerView : It can easily be used with Recycler views.
  • Optimum performance : Efforts have been made to keep memory usage as small as possible.
  • Unharmed image : The library doesn't change/modify the image, so every modification of image as imageview is possible

Example

Below is the two sample for usage of the library:


Usage

Just add the following dependency in your app's build.gradle

repositories {
    maven {
        url 'https://dl.bintray.com/dev-ritik/EmojiReactionView/'
    }
}

dependencies {
    implementation 'com.ritik:emojireactionlibrary:1.0.2'
}

Add the following code in your xml file

<com.ritik.emojireactionlibrary.EmojiReactionView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:src="@drawable/image"
        app:emojis="@array/emoji" />

where emoji is an array resource which is the address to all emojis to be in the panel like:

    <array name="emoji">
        <item>@drawable/em1</item>
        <item>@drawable/em2</item>
        <item>@drawable/em2</item>
    </array>

and for the home emoji, rename that to home, so that its resource id becomes R.drawable.home to override default home emoji originally set.

To get notified of when the emojis are clicked, you can use:

myImage.setOnEmojiClickListener(new ClickInterface() {
    @Override
    public void onEmojiClicked(int emojiIndex, int x, int y) {
        // emojiIndex is the index of the emoji being clicked (0 based)
        // x,y are the coordinates of the clicked position relative to the image 
        // (if x && y == -1 => changed by program(SetClickedEmojiNumber)
    }

    @Override
    public void onEmojiUnclicked(int emojiIndex, int x, int y) {
        // emojiIndex is the index of the emoji being clicked (0 based)
        // x,y are the coordinates of the clicked position relative to the image 
        // (if x && y == -1 => changed by program(SetClickedEmojiNumber)
    }
});

If you are struck somewhere, you can always check its usage in the sample app for Simple and RecyclerView usage.

With this all done and working, you have made to the default design!

Further customization

The library provides these attributes to modify default design to a custom one:

Attribute Description Type(Range) Default Value
emojis Set the emojis to be displayed in the panel animation reference
set_emoji Set the current selected emoji integer(>-1)(< noe*) (0 based) -1
home_Center_X Set the x coordinate of homeEmoji's center dimensions 30 * density
home_Center_Y Set the y coordinate of homeEmoji's center dimensions Height - 30 * density
home_side Set the side length of homeEmoji dimensions 50 * density
panel_center_X Set the x coordinate of the center of panel animation dimension or fraction [0%,100%] (w.r.t width)# width / 2
panel_center_Y Set the y coordinate of the center of panel animation dimension or fraction [0%,100%] (w.r.t height) Height - emojiSide / 2
panel_radius Set the radius of panel animation dimension min(Height,Width) / 2 - 20 * density
panel_emoji_side Set the side of emojis on the panel dimension 50 * density
emojis_rising_height Set the height of the rising emojis(to start disappearing) fraction [0%,100%] (w.r.t height)# Height / 2
emojis_rising_speed Set the speed per frame of the rising emojis dimension 10 * density
emojis_rising_number Set the number of emojis rising in rising emojis animation integer 24

*noe = number of emojis.
# measurement from bottom

Public methods

Method Description Data Type
getCentre Get the center of panel animation int(Pixels)
getRadius Get the radius of panel animation int(Pixels)
get/SetClickedEmojiNumber Get/Set the current selected emoji int (-1 for none)(0 based)
getNumberOfEmojis Get the number Of emojis in the panel int
getEmojisRisingSpeed Get the speed per frame of the rising emojis int(Pixels)
getHomeRect Get the Rect of the home emoji Rect
getPanelEmojiSide Get the side of emojis on the panel int(Pixels)
get/SetHomeBitmap Get/Set the bitmap of the home emoji Bitmap
isHomeEmojiVisible Is home emoji visible boolean
isPanelAnimWorking Is panel visible boolean
isClickingAnimWorking Is the clicking animation working boolean
isEmojiRising Is emoji rising animation visible boolean
setHomeEmojiVisible Switch to home bitmap visible mode boolean
setPanelAnimWorking Start the panel animation boolean

Contributions

All contributions are welcome and appreciated. Please make a Pull Request or open an issue, if necessary. This may also include any form of feature enhancement. Every constructive criticism is welcome. See Contributing.md

License

This library is licensed under MIT license. View license.

You might also like...
Ride-Sharing Uber Lyft Android App - Learn to build a ride-sharing Android Taxi Clone App like Uber, Lyft - Open-Source Project By MindOrks
Ride-Sharing Uber Lyft Android App - Learn to build a ride-sharing Android Taxi Clone App like Uber, Lyft - Open-Source Project By MindOrks

Ride-Sharing Uber Lyft Android App - Learn to build a ride-sharing Android Taxi Clone App like Uber, Lyft - Open-Source Project By MindOrks

A simple Android app to demonstrate the use of Hover SDK for M-PESA Send Money while offline. This SDK does not require an internet connection, it automates USSD sessions in the background of an android application.

HoverSDKDemo Hover SDK is an Android SDK that lets mobile developers to add money features to the applications. This SDK does not require an internet

Source code of JekyllEx Android App which can manage your Jekyll blog directly from your Android device!
Source code of JekyllEx Android App which can manage your Jekyll blog directly from your Android device!

JekyllEx Android App Built with ❤︎ by Gourav Khunger 🚀 Introduction JekyllEx is an Android App that allows you to manage a Jekyll Blog directly from

A Simple and Minimal Quotes Android Application to demonstrate the Modern Android Development tools
A Simple and Minimal Quotes Android Application to demonstrate the Modern Android Development tools

Quotee Android 📑 A Simple and Minimal Quotes Android Application to demonstrate the Modern Android Development tools. Developed with ❤️ by Aminullah

🎥 A Simple and Minimal Movies Android Application to demonstrate the Modern Android Development and Jetpack Compose.
🎥 A Simple and Minimal Movies Android Application to demonstrate the Modern Android Development and Jetpack Compose.

ComposeMovie Android 🎥 A Simple and Minimal Movies Android Application to demonstrate the Modern Android Development and Jetpack Compose. Built with

Android Studio project wrapper around the Elixir TodoApp Desktop app to run on Android including the Erlang runtime
Android Studio project wrapper around the Elixir TodoApp Desktop app to run on Android including the Erlang runtime

TodoApp Android: An Android Sample App This Android Studio project wraps the Desktop Sample App to run on an Android phone. How to build & run Install

GmailCompose is an Android application 📱 for showcasing Jetpack Compose for building declarative UI in Android.
GmailCompose is an Android application 📱 for showcasing Jetpack Compose for building declarative UI in Android.

GmailCompose GmailCompose Demo GmailCompose is an Android application 📱 for showcasing Jetpack Compose for building declarative UI in Android. About

Parsing and re-packing Android boot.img/vbmeta.img, supporting Android 12(preview)
Parsing and re-packing Android boot.img/vbmeta.img, supporting Android 12(preview)

Android_boot_image_editor A tool for reverse engineering Android ROM images. Getting Started install required packages Mac: brew install lz4 xz dtc Li

android-trinity is tiny proactive framework with much of the scaffolding code  required to start a new Android Application.
android-trinity is tiny proactive framework with much of the scaffolding code required to start a new Android Application.

android-trinity This is tiny framework with much of the scaffolding code (with some nice utilities and prepared source code) required to start a new A

Comments
  • EmojiUnclicked Triggers without clicking the emoji

    EmojiUnclicked Triggers without clicking the emoji

    When the emoji reactionview is used in a recycle view emojiunclicked is triggered when the adapter is being loaded, i tried it in the sample its behaves the same way

    opened by marvesimate 2
  • Artifact can not reachable atm. (JCenter shutdown)

    Artifact can not reachable atm. (JCenter shutdown)

    Gradle can not find this artifact at any repository given; `

    • What went wrong: Execution failed for task ':app:checkDebugAarMetadata'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not resolve com.ritik:emojireactionlibrary:1.0.2. Required by: project :app > Could not resolve com.ritik:emojireactionlibrary:1.0.2. > Could not get resource 'https://dl.bintray.com/dev-ritik/EmojiReactionView/com/ritik/emojireactionlibrary/1.0.2/emojireactionlibrary-1.0.2.pom'. > Could not GET 'https://dl.bintray.com/dev-ritik/EmojiReactionView/com/ritik/emojireactionlibrary/1.0.2/emojireactionlibrary-1.0.2.pom'. Received status code 403 from server: Forbidden `

    opened by codigg3r 0
Releases(1.0.1)
Owner
Ritik kumar
Software Engineer @microsoft | GSoC'19 @named-data | Computer Science graduate @IITR | Developer @mdg-iitr
Ritik kumar
FoldingNavigationDrawer-Android This is a sample project present how to use Folding-Android to add Folding Efect to Navigation Drawer.

FoldingNavigationDrawer-Android Sample (Play Store Demo) This is a sample project present how to use Folding-Android to add Folding Efect to Navigatio

null 242 Nov 25, 2022
Twidere-Android Twidere is a powerful twitter client for Android 1.6+ 1 , which gives you a full Holo experience and nearly full Twitter's feature.

Twidere for Android Material Design ready and feature rich Twitter/Mastodon/Fanfou app for Android 4.1+. Enjoy Fediverse now! Twidere-Android is maint

Twidere Project 2.7k Jan 2, 2023
:movie_camera: Movie discovery app showcasing Android best practices with Google's recommended architecture: MVVM + Repository + Offline support + Android Architecture Components + Paging library & Retrofit2.

Popular Movies Stage 1 + Stage 2 Discover the most popular and top rated movies playing. Movies data fetched using themoviedb.org API. ✨ Screenshots M

Yassin AJDI 189 Nov 26, 2022
Extensible Android mobile voice framework: wakeword, ASR, NLU, and TTS. Easily add voice to any Android app!

Spokestack is an all-in-one solution for mobile voice interfaces on Android. It provides every piece of the speech processing puzzle, including voice

Spokestack 57 Nov 20, 2022
Aggregated Android news, articles, podcasts and conferences about Android Development

DroidFeed Curated news feed for Android Developers! Stay up to date with the latest Android Development news. Built for the Android developer communit

Dogan Gulcan 183 Dec 2, 2022
Shreyas Patil 2.1k Dec 30, 2022
A simple app to showcase Androids Material Design and some of the cool new cool stuff in Android Lollipop. RecyclerView, CardView, ActionBarDrawerToggle, DrawerLayout, Animations, Android Compat Design, Toolbar

#Android-LollipopShowcase This is a simple showcase to show off Android's all new Material Design and some other cool new stuff which is (new) in Andr

Mike Penz 1.8k Nov 10, 2022
The Android startup used to schedule tasks, jobs while launching Android App.

Android Startup, schedule your startup jobs Introduction AndroidStartup is an open source project used to refine your Andriod App startup. Compared wi

ShouHeng 46 Aug 24, 2022
Android playground project with modularization by feature (android libraries), unit tests, MVVM & MVI.

Movies Movies is a simple project to study and play with some android components, architecture and tools for Android development. Tech Stack This proj

Christopher Elias 333 Dec 30, 2022
🌄 Photo editor using native modules for iOS and Android. Inherit from 2 available libraries, Brightroom (iOS) and PhotoEditor (Android)

React Native Photo Editor (RNPE) ?? Image editor using native modules for iOS and Android. Inherit from 2 available libraries, Brightroom (iOS) and Ph

Baron Ha. 242 Dec 28, 2022