Giter Site home page Giter Site logo

androidsourcetools / reactbutton Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amrdeveloper/reactbutton

0.0 1.0 0.0 822 KB

Android Library To Create Button With Multi Reactions like Facebook or Linkedin

License: MIT License

Java 100.00%

reactbutton's Introduction

ReactButton

Android Library written in Java to Create ReactButton with Multi Reactions like Facebook or Linkedin ๐Ÿ˜Ž

Min API Stars Forks License

Default Reactions ๐Ÿ˜„

Custom Reactions ๐Ÿ˜‰

Description :

Add ReactButton To Your Current Project :

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

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

Add the dependency

implementation 'com.github.AmrDeveloper.ReactButton:reactbutton:1.0.7'

Default Case :

Text = Like 
Emoji is black Hand
If User Click on Button it Text Will still like but reaction will be blue hand
and if user click long on button it will show dialog to choose one reaction from 6 reactions

How To Initializing ReactButton :

ReactButton reactButton = findViewById(R.id.buttonId);

Set Six Reactions if you want to change Default Reactions:

reactButton.setReactions(Reaction... reaction);

Set Current Reaction:

reactButton.setCurrentReaction(Reaction reaction);

Get Current Reaction :

Reaction currentReaction = reactButton.getCurrentReaction();

Set Default Reaction:

reactButton.setDefaultReaction(Reaction reaction);

Get Default Reaction :

Reaction currentReaction = reactButton.getDefaultReaction();

Change Reaction dialog default Style :

reactButton.setReactDialogShape(int styleID);

Set On Click Listener :

reactButton.setReactClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        //Your Code
    }
});

Set on Long Click Listener :

reactButton.setReactDismissListener(new View.OnLongClickListener() {
    @Override
    public boolean onLongClick(View view) {
        //Your Code
        return false;
    }
});

Check if current Reaction is Default Reaction:

boolean isDefault = reactButton.isDefaultReaction();

reactbutton's People

Contributors

amrdeveloper avatar andreassuvorov avatar

Watchers

 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.