Git Product home page Git Product logo

emoji's Introduction

Emoji

Build Status Android Arsenal License

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 & EmojiTextView.

Normal Keyboard

Emoji Keyboard

Setup

build.gradle

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

Modules are located on Maven Central.

Example

<com.vanniktech.emoji.EmojiEditText
    android:id="@+id/emojiEditText"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:imeOptions="actionSend"
    android:inputType="textCapSentences|textMultiLine"
    android:maxLines="3"
    app:emojiSize="26sp"/>
final EmojiPopup emojiPopup = EmojiPopup.Builder.fromRootView(rootView).build(emojiEditText);
emojiPopup.toggle(); // Toggles visibility of the Popup
emojiPopup.dismiss(); // Dismisses the Popup
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 that you declared in your layout xml file.

Listeners

On the builder for the EmojiPopup you are able to declare several listeners.

setOnSoftKeyboardCloseListener(final OnSoftKeyboardCloseListener listener);
setOnEmojiClickedListener(final OnEmojiClickedListener listener);
setOnSoftKeyboardOpenListener(final OnSoftKeyboardOpenListener listener);
setOnEmojiPopupShownListener(final OnEmojiPopupShownListener listener);
setOnEmojiPopupDismissListener(final OnEmojiPopupDismissListener listener);
setOnEmojiBackspaceClickListener(final OnEmojiBackspaceClickListener listener);

Displaying Emojis

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

Just use the EmojiTextView and call setText with the String you got from EmojiEditText and you're done.

Check out the sample project to get more information.

Proguard

No configuration needed.

License

Copyright (C) 2016 Vanniktech - Niklas Baudy

Licensed under the Apache License, Version 2.0

emoji's People

Contributors

vanniktech avatar

Watchers

James Cloos avatar guiping avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.