Skip to content

Commit

Permalink
Documentation for Version 1.0.7
Browse files Browse the repository at this point in the history
update documentation for version 1.0.7
  • Loading branch information
AmrDeveloper committed Aug 30, 2018
1 parent 46fb8a2 commit 078adcb
Showing 1 changed file with 41 additions and 56 deletions.
97 changes: 41 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# ReactButton
Android Library By Java to Create ReactButton with 6 Reaction Face
Android Library By Java to Create ReactButton with 6 Reaction :sunglasses:

Default Reactions :smile:

<img src="https://i.imgur.com/Cnut0ex.png" width="200">

Custom Reactions :wink:

<img src="https://i.imgur.com/C4srnIt.png" width="200">

Description :

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

Add the dependency

implementation 'com.github.AmrDeveloper.ReactButton:app:1.0.6'
implementation 'com.github.AmrDeveloper.ReactButton:app:1.0.7'
Default Case :

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

Set Emoji Type on Button :
Set Six Reactions if you want to change Default Reactions:

```java
reactButton.setReactions(Reaction... reaction);
```

Set Current Reaction:

```java
reactButton.setCurrentReaction(Reaction reaction);
```

Get Current Reaction :

```java
Reaction currentReaction = reactButton.getCurrentReaction();
```

Set Default Reaction:

```java
reactButton.setCurrentEmojiType(String reactionType);

Types :
ReactButton.DEFAULT
ReactButton.LIKE
ReactButton.LOVE
ReactButton.SMILE
ReactButton.WOW
ReactButton.SAD
ReactButton.ANGRY
reactButton.setDefaultReaction(Reaction reaction);
```

To Get Current Reaction On Button :
Get Default Reaction :

```java
String currentReaction = reactButton.getCurrentReactType();

switch(currentReaction)
{
case ReactButton.LIKE:
//Text Is Like , Emoji Is Blue Hand
break;

case ReactButton.LOVE:
//Text Is Like , Emoji Is Red Heart
break;

case ReactButton.SMILE:
//Text Is Smile , Emoji Is Smile Face
break;

case ReactButton.WOW:
//Text Is Wow , Emoji Is Wow Face
break;

case ReactButton.SAD:
//Text Is Sad , Emoji Is Dark Hand
break;

case ReactButton.ANGRY:
//Text Is Angry , Emoji Is Angry Face
break;

default:
//Text Is Like , Emoji Is Dark Hand
break;
}
Reaction currentReaction = reactButton.getDefaultReaction();
```

Change Reaction dialog default Style :
```java
reactButton.setReactDialogShape(int styleID);
```

Set On Click Listener :

```java
Expand All @@ -105,14 +96,8 @@ Set on Long Click Listener :
}
});
```

Change Reatction layout background color :
```java
reactButton.setDialogBackgroundColor(int color);
```

Change Reaction dialog shape :

Check if current Reaction is Default Reaction:
```java
reactButton.setReactDialogShape(int shapeID);
```

boolean isDefault = reactButton.isDefaultReaction();
```

0 comments on commit 078adcb

Please sign in to comment.