An easy to use FBReactionDialog library for Android apps.
Checkout TODO
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.Abhay-cloud:FBReactionDialog-Library-Android:1.2'
}
// 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.
fbReactionDialog.show();
You can call .show()
method under onClickListener or onLongClickListener
fbReactionDialog.setOnReactionChangedListener(new OnReactionChangedListener() {
@Override
public void onReactionChange(int reaction) {
// do something when user clicks on reaction
}
});
Refer Reaction Codes
// fbReactionDialog.setSoundEnabled(boolean isSoundEnabled);
fbReactionDialog.setSoundEnabled(false);
By default reaction sound is enabled
int reaction = fbReactionDialog.getCurrentReaction();
returns the current reaction. Refer Reaction Codes
fbReactionDialog.dismiss();
REACTION_LIKE = 0
REACTION_LOVE = 1
REACTION_HAHA = 2
REACTION_WOW = 3
REACTION_ANGRY = 4
Custom emojis in next version
Custom reaction sounds
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.
If you have any difficulty then just message me on Instagram or LinkedIn.