Giter Club home page Giter Club logo

emoticongifkeyboard's Introduction

EmoticonGIFKeyboard

Download API Javadoc Androidweekly

๐Ÿ™Œ An advance Emoticons & GIF keyboard. ๐Ÿ™Œ

EmoticonGIFKeyboard is an easy to integrate, customizable and lightweight library to add support for emojis and GIFs.

Features:

  • Highly customizable.
  • Extremely lightweight ๐Ÿ‹. You only have to add the icon packs you want to use by adding extra dependency, so you don't have to add emoticon icons you don't want to use.
  • โค for Emoticons
    • More than 1400 emoticons. This library includes all the emoticons listed under Emoticons 6.0 standards.
    • 6 emoticons categories.
    • ๐Ÿ” Search emoticons by their name or meaning.
    • Add you favourite emoticons icon theme (e.g ios, google, samsung emoticons) by adding readily available emoticon icon packs.
  • โค for GIFs
    • Displays trending GIFs for batter suggestion.
    • ๐Ÿ” Search GIFs based on the content and meaning.
    • Select your favourite GIF provider (e.g. Giphy, Tenor) by adding available GIF packs.
  • Custom widgets (e.g. EmoticonTextView, EmoticonEditText and EmoticonButton) to render custom emoticon icons throughout application.
  • Easily disable emoticons or GIF functionality if you don't want.

How to import this library?

  • Gradle Dependency:

    • Add below lines to app/build.gradle file of your project.
    dependencies {
        compile 'com.kevalpatel2106:emoticongifkeyboard:1.0'
    }
  • To integrate using maven visit this page.

How to use this EmoticonGIFKeyboard?

  • Prepare emoticons configuration.

    • Create EmoticonConfig to configure emoticons.
    • Set the custom emoticon icon provider using EmoticonConfig#setEmoticonProvider(). If you don't set any icon provider here, library will render system emoticons. You can pic custom emoticon icons from here.
    • Set the EmoticonSelectListener using EmoticonConfig#setEmoticonSelectListener(). This will notify you when user selects any emoticon from list or user preses back button.
    EmoticonGIFKeyboardFragment.EmoticonConfig emoticonConfig = new EmoticonGIFKeyboardFragment.EmoticonConfig()
            .setEmoticonProvider(IosEmoticonProvider.create())
            /*
              NOTE: The process of removing last character when user preses back space will handle
              by library if your edit text is in focus.
             */
            .setEmoticonSelectListener(new EmoticonSelectListener() {
    
                @Override
                public void emoticonSelected(Emoticon emoticon) {
                    //Do something with new emoticon.
                }
    
                @Override
                public void onBackSpace() {
                    //Do something here to handle backspace event.
                    //The process of removing last character when user preses back space will handle
                    //by library if your edit text is in focus.
                }
            });
  • Prepare GIF configuration.

    • Set the desired GIF provider by passing desired GIFProvider in constructor GIFConfig(). Here is the list of supported GIF providers. It is required to set GIF provider before adding fragment into container.
    • Implement GIF select listener using GIFConfig#setGifSelectListener(). This will notify you when user selects new GIF.
    //Create GIF config
    EmoticonGIFKeyboardFragment.GIFConfig gifConfig = new EmoticonGIFKeyboardFragment
    
            /*
              Here we are using GIPHY to provide GIFs. Create Giphy GIF provider by passing your key.
              It is required to set GIF provider before adding fragment into container.
             */
            .GIFConfig(GiphyGifProvider.create(this, "564ce7370bf347f2b7c0e4746593c179"))
            .setGifSelectListener(new GifSelectListener() {
                @Override
                public void onGifSelected(@NonNull Gif gif) {
                    //Do something with the selected GIF.
                    Log.d(TAG, "onGifSelected: " + gif.getGifUrl());
                }
            });
  • Add EmoticonGIFKeyboardFragment.

    • Create new EmoticonGIFKeyboardFragment by passing EmoticonConfig and GIFConfig. If you pass null to EmoticonConfig, emoticon functionality will be disabled. Also, if you pass GIFConfig as null, GIF functionality will be disabled.
    • Add the generated fragment to the container.
    EmoticonGIFKeyboardFragment emoticonGIFKeyboardFragment = EmoticonGIFKeyboardFragment
            .getNewInstance(findViewById(R.id.keyboard_container), emoticonConfig, gifConfig);
    
    //Adding the keyboard fragment to keyboard_container.
    getSupportFragmentManager()
            .beginTransaction()
            .replace(R.id.keyboard_container, EmoticonGIFKeyboardFragment)
            .commit();
  • Open/Close the keyboard and handle back button press.

    • Open keyboard view by calling EmoticonGIFKeyboardFragment#open() and close it by calling EmoticonGIFKeyboardFragment#close().
    • Handle back button press events by using EmoticonGIFKeyboardFragment#handleBackPressed() in your activity.
      @Override
      public void onBackPressed() {
        if (!mEmoticonGIFKeyboardFragment.handleBackPressed())
            super.onBackPressed();
      }

Demo

Emoticons GIFs
Emoticon Demo GIF Demo
Only Emoticons Only GIFs
Only Emoticons Only GIFs
Search Emoticons Search GIFs
Only Emoticons Only GIFs

Emoticon icon packs

Icon Emoticon Pack Gradle Dependency Version
Grinning Emoji Apple compile 'com.kevalpatel2106:emoticonpack-ios:<latest> Download
Grinning Emoji Google compile 'com.kevalpatel2106:emoticonpack-google:<latest> Download
Grinning Emoji Facebook compile 'com.kevalpatel2106:emoticonpack-facebook:<latest> Download
Grinning Emoji Twitter compile 'com.kevalpatel2106:emoticonpack-twitter:<latest> Download
Grinning Emoji Samsung compile 'com.kevalpatel2106:emoticonpack-samsung:<latest> Download
Grinning Emoji Windows compile 'com.kevalpatel2106:emoticonpack-windows:<latest> Download
Grinning Emoji Messenger compile 'com.kevalpatel2106:emoticonpack-messenger:<latest> Download
Grinning Emoji Emojidex compile 'com.kevalpatel2106:emoticonpack-emojidex:<latest> Download
Grinning Emoji EmojiOne compile 'com.kevalpatel2106:emoticonpack-emojione:<latest> Download

GIF Packs

GIF Provider Module Dependency Version
giphy.com Giphy compile 'com.kevalpatel2106:gifpack-giphy:<latest> Download
tenor.com Tenor compile 'com.kevalpatel2106:gifpack-tenor:<latest> Download

Acknowledgements

How to contribute?

Questions?๐Ÿค”

Hit me on twitter Twitter

License

Copyright 2017 Keval Patel

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

emoticongifkeyboard's People

Contributors

kevalpatel2106 avatar ravidsrk avatar

Watchers

Michael jentsch 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.