Skip to content

Latest commit

 

History

History
108 lines (82 loc) · 3.57 KB

File metadata and controls

108 lines (82 loc) · 3.57 KB

FBReactionDialog Library Android

An easy to use FBReactionDialog library for Android apps.

CodeFactor Codacy Badge Stars Forks

Checkout TODO

Demo

Usage

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

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

Step 2. Add the dependency

dependencies {
	        implementation 'com.github.Abhay-cloud:FBReactionDialog-Library-Android:1.2'
	}

Initialization

// FBReactionDialog fbReactionDialog = new FBReactionDialog(Context context, View view);
FBReactionDialog fbReactionDialog = new FBReactionDialog(this, binding.likeButton);

Here View can be button, textview, any type of view or your custom view.

Showing FBReactionDialog

fbReactionDialog.show();

You can call .show() method under onClickListener or onLongClickListener

set setOnReactionChangedListener

 fbReactionDialog.setOnReactionChangedListener(new OnReactionChangedListener() {
            @Override
            public void onReactionChange(int reaction) {
                // do something when user clicks on reaction
            }
        });

Refer Reaction Codes

set sound enabled/disabled

// fbReactionDialog.setSoundEnabled(boolean isSoundEnabled);
fbReactionDialog.setSoundEnabled(false);

By default reaction sound is enabled

getCurrentReaction

int reaction = fbReactionDialog.getCurrentReaction();

returns the current reaction. Refer Reaction Codes

dismissing FBReactionDialog

fbReactionDialog.dismiss();

Reaction codes

REACTION_LIKE = 0

REACTION_LOVE = 1

REACTION_HAHA = 2

REACTION_WOW = 3

REACTION_ANGRY = 4

TODO

Custom emojis in next version

Custom reaction sounds

LICENSE

Project is published under the Apache 2.0 license. Feel free to clone and modify repository as you want, but don't forget to add reference to authors.

Connect with me

If you have any difficulty then just message me on Instagram or LinkedIn.

Made with ❤️ by Abhay