Skip to content

Commit 078adcb

Browse files
authored
Documentation for Version 1.0.7
update documentation for version 1.0.7
1 parent 46fb8a2 commit 078adcb

File tree

1 file changed

+41
-56
lines changed

1 file changed

+41
-56
lines changed

README.md

Lines changed: 41 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# ReactButton
2-
Android Library By Java to Create ReactButton with 6 Reaction Face
2+
Android Library By Java to Create ReactButton with 6 Reaction :sunglasses:
3+
4+
Default Reactions :smile:
5+
6+
<img src="https://i.imgur.com/Cnut0ex.png" width="200">
7+
8+
Custom Reactions :wink:
9+
10+
<img src="https://i.imgur.com/C4srnIt.png" width="200">
311

412
Description :
513

@@ -16,7 +24,7 @@ Add it in your root build.gradle at the end of repositories
1624

1725
Add the dependency
1826

19-
implementation 'com.github.AmrDeveloper.ReactButton:app:1.0.6'
27+
implementation 'com.github.AmrDeveloper.ReactButton:app:1.0.7'
2028
2129
Default Case :
2230

@@ -31,58 +39,41 @@ How To Initializing ReactButton :
3139
ReactButton reactButton = findViewById(R.id.buttonId);
3240
```
3341

34-
Set Emoji Type on Button :
42+
Set Six Reactions if you want to change Default Reactions:
43+
44+
```java
45+
reactButton.setReactions(Reaction... reaction);
46+
```
47+
48+
Set Current Reaction:
49+
50+
```java
51+
reactButton.setCurrentReaction(Reaction reaction);
52+
```
53+
54+
Get Current Reaction :
55+
56+
```java
57+
Reaction currentReaction = reactButton.getCurrentReaction();
58+
```
59+
60+
Set Default Reaction:
3561

3662
```java
37-
reactButton.setCurrentEmojiType(String reactionType);
38-
39-
Types :
40-
ReactButton.DEFAULT
41-
ReactButton.LIKE
42-
ReactButton.LOVE
43-
ReactButton.SMILE
44-
ReactButton.WOW
45-
ReactButton.SAD
46-
ReactButton.ANGRY
63+
reactButton.setDefaultReaction(Reaction reaction);
4764
```
4865

49-
To Get Current Reaction On Button :
66+
Get Default Reaction :
5067

5168
```java
52-
String currentReaction = reactButton.getCurrentReactType();
53-
54-
switch(currentReaction)
55-
{
56-
case ReactButton.LIKE:
57-
//Text Is Like , Emoji Is Blue Hand
58-
break;
59-
60-
case ReactButton.LOVE:
61-
//Text Is Like , Emoji Is Red Heart
62-
break;
63-
64-
case ReactButton.SMILE:
65-
//Text Is Smile , Emoji Is Smile Face
66-
break;
67-
68-
case ReactButton.WOW:
69-
//Text Is Wow , Emoji Is Wow Face
70-
break;
71-
72-
case ReactButton.SAD:
73-
//Text Is Sad , Emoji Is Dark Hand
74-
break;
75-
76-
case ReactButton.ANGRY:
77-
//Text Is Angry , Emoji Is Angry Face
78-
break;
79-
80-
default:
81-
//Text Is Like , Emoji Is Dark Hand
82-
break;
83-
}
69+
Reaction currentReaction = reactButton.getDefaultReaction();
8470
```
8571

72+
Change Reaction dialog default Style :
73+
```java
74+
reactButton.setReactDialogShape(int styleID);
75+
```
76+
8677
Set On Click Listener :
8778

8879
```java
@@ -105,14 +96,8 @@ Set on Long Click Listener :
10596
}
10697
});
10798
```
108-
109-
Change Reatction layout background color :
110-
```java
111-
reactButton.setDialogBackgroundColor(int color);
112-
```
113-
114-
Change Reaction dialog shape :
99+
100+
Check if current Reaction is Default Reaction:
115101
```java
116-
reactButton.setReactDialogShape(int shapeID);
117-
```
118-
102+
boolean isDefault = reactButton.isDefaultReaction();
103+
```

0 commit comments

Comments
 (0)