Skip to content

Commit e7ea200

Browse files
committed
Update documentation
1 parent b27489d commit e7ea200

1 file changed

Lines changed: 24 additions & 23 deletions

File tree

README.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Custom Reactions :wink:
1616

1717
Description :
1818

19-
Add ReactButton To Your Current Project :
19+
Add ReactButton To Your Current Project:
2020

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

@@ -27,28 +27,20 @@ allprojects {
2727
}
2828
}
2929
```
30-
3130
3231
Add the dependency
3332

3433
```gradle
3534
implementation 'com.github.AmrDeveloper.ReactButton:reactbutton:1.0.7'
3635
```
37-
38-
Default Case :
3936

40-
Text = Like
41-
Emoji is black Hand
42-
If User Click on Button it Text Will still like but reaction will be blue hand
43-
and if user click long on button it will show dialog to choose one reaction from 6 reactions
44-
45-
How To Initializing ReactButton :
37+
How To Initializing ReactButton:
4638

4739
```java
4840
ReactButton reactButton = findViewById(R.id.buttonId);
4941
```
5042

51-
Set Six Reactions if you want to change Default Reactions:
43+
Set your Reactions:
5244

5345
```java
5446
reactButton.setReactions(Reaction... reaction);
@@ -60,7 +52,7 @@ Set Current Reaction:
6052
reactButton.setCurrentReaction(Reaction reaction);
6153
```
6254

63-
Get Current Reaction :
55+
Get Current Reaction:
6456

6557
```java
6658
Reaction currentReaction = reactButton.getCurrentReaction();
@@ -72,36 +64,45 @@ Set Default Reaction:
7264
reactButton.setDefaultReaction(Reaction reaction);
7365
```
7466

75-
Get Default Reaction :
67+
Get Default Reaction:
7668

7769
```java
7870
Reaction currentReaction = reactButton.getDefaultReaction();
7971
```
8072

81-
Change Reaction dialog default Style :
73+
Change Reaction dialog default Style:
8274
```java
8375
reactButton.setReactDialogShape(int styleID);
8476
```
8577

86-
Set On Click Listener :
78+
Change the number of reactions in the Columns, the default value is all reactions size
79+
```java
80+
reactButton.setDialogColumnsNumber(n);
81+
```
82+
83+
Set setOnReactionChangeListener:
8784

8885
```java
89-
reactButton.setReactClickListener(new View.OnClickListener() {
86+
reactButton.setOnReactionChangeListener(new ReactButton.OnReactionChangeListener() {
9087
@Override
91-
public void onClick(View view) {
92-
//Your Code
88+
public void onReactionChange(Reaction reaction) {
89+
// Code that will execute when the reaction changed
9390
}
9491
});
9592
```
9693

97-
Set on Long Click Listener :
94+
Set OnReactionDialogStateListener:
9895

9996
```java
100-
reactButton.setReactDismissListener(new View.OnLongClickListener() {
97+
reactButton.setOnReactionDialogStateListener(new ReactButton.OnReactionDialogStateListener() {
98+
@Override
99+
public void onDialogOpened() {
100+
// Code that will execute when the reaction dialog is opened
101+
}
102+
101103
@Override
102-
public boolean onLongClick(View view) {
103-
//Your Code
104-
return false;
104+
public void onDialogDismiss() {
105+
// Code that will execute after the reaction dialog is dismissed
105106
}
106107
});
107108
```

0 commit comments

Comments
 (0)