Skip to content

Commit

Permalink
Prepare version 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vanniktech committed Mar 29, 2016
1 parent 2dd8a71 commit f41c048
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 14 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Change Log

Version 0.2.0 *(In development)*
Version 0.2.0 *(2016-03-29)*
--------------------------------

- Add Recent Emojis Tab [\#13](https://github.com/vanniktech/Emoji/pull/13) ([vanniktech](https://github.com/vanniktech))
- Adding new emojis [\#9](https://github.com/vanniktech/Emoji/pull/9) ([vanniktech](https://github.com/vanniktech))
- Add Library resource config file. Fixes \#6 [\#7](https://github.com/vanniktech/Emoji/pull/7) ([vanniktech](https://github.com/vanniktech))

Version 0.1.0 *(2016-03-12)*
----------------------------

Expand Down
40 changes: 28 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,27 @@
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Emoji-green.svg?style=true)](https://android-arsenal.com/details/1/3287)
[![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)

A simple library to add Emoji support to your Android Application. In a PopupWindow Emojis can be chosen. In order to edit and display text with Emojis this library provides public APIs: [`EmojiEditText`](library/src/main/java/com/vanniktech/emoji/EmojiEditText.java) & [`EmojiTextView`](library/src/main/java/com/vanniktech/emoji/EmojiTextView.java).
A simple library to add Emoji support to your Android app. In a PopupWindow Emojis can be chosen. In order to edit and display text with Emojis this library provides public APIs: [`EmojiEditText`](library/src/main/java/com/vanniktech/emoji/EmojiEditText.java) & [`EmojiTextView`](library/src/main/java/com/vanniktech/emoji/EmojiTextView.java).

<img src="preview_1.png" alt="Normal Keyboard" width="320">
<img src="preview_2.png" alt="Emoji Keyboard" width="320">
<img src="preview_1.png" alt="Normal Keyboard" width="280">
<img src="preview_2.png" alt="Emoji Keyboard" width="280">
<img src="preview_3.png" alt="Recent Emojis" width="280">

# Setup

**build.gradle**

```groovy
compile 'com.vanniktech:emoji:0.1.0'
compile 'com.vanniktech:emoji:0.2.0'
compile 'com.vanniktech:emoji:0.2.0-SNAPSHOT'
```

Modules are located on [Maven Central](https://oss.sonatype.org/#nexus-search;gav~com.vanniktech~emoji~~~).

# Example

Declare your [`EmojiEditText`](library/src/main/java/com/vanniktech/emoji/EmojiEditText.java) in your layout xml file.

```xml
<com.vanniktech.emoji.EmojiEditText
android:id="@+id/emojiEditText"
Expand All @@ -34,6 +37,8 @@ Modules are located on [Maven Central](https://oss.sonatype.org/#nexus-search;ga
app:emojiSize="26sp"/>
```

To open the [`EmojiPopup`](library/src/main/java/com/vanniktech/emoji/EmojiPopup.java) execute the code above:

```java
final EmojiPopup emojiPopup = EmojiPopup.Builder.fromRootView(rootView).build(emojiEditText);
emojiPopup.toggle(); // Toggles visibility of the Popup
Expand All @@ -44,9 +49,20 @@ emojiPopup.isShowing(); // Returns true when Popup is showing
The `rootView` is the rootView of your layout xml file which will be used for calculating the height of the keyboard.
`emojiEditText` is the [`EmojiEditText`](library/src/main/java/com/vanniktech/emoji/EmojiEditText.java) that you declared in your layout xml file.

## Displaying Emojis

```xml
<com.vanniktech.emoji.EmojiTextView
android:id="@+id/emojiTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
```

Just use the [`EmojiTextView`](library/src/main/java/com/vanniktech/emoji/EmojiTextView.java) and call `setText` with the String you got from [`EmojiEditText`](library/src/main/java/com/vanniktech/emoji/EmojiEditText.java) and you're done.

## Listeners

On the builder for the `EmojiPopup` you are able to declare several listeners.
On the builder for the [`EmojiPopup`](library/src/main/java/com/vanniktech/emoji/EmojiPopup.java) you are able to declare several listeners.

```java
setOnSoftKeyboardCloseListener(final OnSoftKeyboardCloseListener listener);
Expand All @@ -57,16 +73,16 @@ setOnEmojiPopupDismissListener(final OnEmojiPopupDismissListener listener);
setOnEmojiBackspaceClickListener(final OnEmojiBackspaceClickListener listener);
```

## Displaying Emojis

```xml
<com.vanniktech.emoji.EmojiTextView
android:id="@+id/emojiTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
### Custom recent Emoji implementation

You can pass your own implementation of the recent Emojis. Just let one of your classes implement the [`RecentEmoji`](library/src/main/java/com/vanniktech/emoji/RecentEmoji.java) interface and pass it when you're building the [`EmojiPopup`](library/src/main/java/com/vanniktech/emoji/EmojiPopup.java):

```java
setRecentEmoji(yourClassThatImplementsRecentEmoji)
```

Just use the [`EmojiTextView`](library/src/main/java/com/vanniktech/emoji/EmojiTextView.java) and call `setText` with the String you got from [`EmojiEditText`](library/src/main/java/com/vanniktech/emoji/EmojiEditText.java) and you're done.
If no instance or a null instance is set the default implementation will be used.

Check out the sample project to get more information.

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GROUP=com.vanniktech
VERSION_NAME=0.2.0-SNAPSHOT
VERSION_NAME=0.2.0
VERSION_CODE=2

POM_DESCRIPTION=A simple library to add Emoji support to your Android Application
Expand Down
Binary file modified preview_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified preview_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added preview_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f41c048

Please sign in to comment.