1
1
# 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 " >
3
11
4
12
Description :
5
13
@@ -16,7 +24,7 @@ Add it in your root build.gradle at the end of repositories
16
24
17
25
Add the dependency
18
26
19
- implementation 'com.github.AmrDeveloper.ReactButton:app:1.0.6 '
27
+ implementation 'com.github.AmrDeveloper.ReactButton:app:1.0.7 '
20
28
21
29
Default Case :
22
30
@@ -31,58 +39,41 @@ How To Initializing ReactButton :
31
39
ReactButton reactButton = findViewById(R . id. buttonId);
32
40
```
33
41
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:
35
61
36
62
``` 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);
47
64
```
48
65
49
- To Get Current Reaction On Button :
66
+ Get Default Reaction :
50
67
51
68
``` 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();
84
70
```
85
71
72
+ Change Reaction dialog default Style :
73
+ ``` java
74
+ reactButton. setReactDialogShape(int styleID);
75
+ ```
76
+
86
77
Set On Click Listener :
87
78
88
79
``` java
@@ -105,14 +96,8 @@ Set on Long Click Listener :
105
96
}
106
97
});
107
98
```
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:
115
101
``` java
116
- reactButton. setReactDialogShape(int shapeID);
117
- ```
118
-
102
+ boolean isDefault = reactButton. isDefaultReaction();
103
+ ```
0 commit comments