EmoticonGIFKeyboard is an easy to integrate, customizable and lightweight library to add support for emojis and GIFs.
EmoticonTextView
, EmoticonEditText
and EmoticonButton
) to render custom emoticon icons throughout application.app/build.gradle
file of your project.
dependencies {
compile 'com.kevalpatel2106:emoticongifkeyboard:1.1'
}
EmoticonConfig
to configure emoticons.EmoticonConfig#setEmoticonProvider()
. If you don't set any icon provider here, library will render system emoticons. You can pic custom emoticon icons from here.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.
}
});
GIFProvider
in constructor GIFConfig()
. Here is the list of supported GIF providers.
It is required to set GIF provider before adding fragment into container.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());
}
});
EmoticonGIFKeyboardFragment
.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.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();
EmoticonGIFKeyboardFragment#open()
and close it by calling EmoticonGIFKeyboardFragment#close()
.EmoticonGIFKeyboardFragment#handleBackPressed()
in your activity.@Override
public void onBackPressed() {
if (!mEmoticonGIFKeyboardFragment.handleBackPressed())
super.onBackPressed();
}
Emoticons | GIFs |
---|---|
Only Emoticons | Only GIFs |
---|---|
Search Emoticons | Search GIFs |
---|---|
Icon | Emoticon Pack | Gradle Dependency | Version |
---|---|---|---|
Apple | compile 'com.kevalpatel2106:emoticonpack-ios:<latest> |
||
Android 7.0 | compile 'com.kevalpatel2106:emoticonpack-android7:<latest> |
||
Android 8.0 | compile 'com.kevalpatel2106:emoticonpack-android8:<latest> |
||
Samsung | compile 'com.kevalpatel2106:emoticonpack-samsung:<latest> |
||
HTC | compile 'com.kevalpatel2106:emoticonpack-htc:<latest> |
||
LG | compile 'com.kevalpatel2106:emoticonpack-lg:<latest> |
||
Windows 8.1 | compile 'com.kevalpatel2106:emoticonpack-windows8:<latest> |
||
Windows 10 | compile 'com.kevalpatel2106:emoticonpack-windows10:<latest> |
||
compile 'com.kevalpatel2106:emoticonpack-twitter:<latest> |
|||
compile 'com.kevalpatel2106:emoticonpack-facebook:<latest> |
|||
Messenger | compile 'com.kevalpatel2106:emoticonpack-messenger:<latest> |
||
Emojidex | compile 'com.kevalpatel2106:emoticonpack-emojidex:<latest> |
||
EmojiOne | compile 'com.kevalpatel2106:emoticonpack-emojione:<latest> |
GIF Provider | Module | Dependency | Version |
---|---|---|---|
giphy.com | Giphy | compile 'com.kevalpatel2106:gifpack-giphy:<latest> |
|
tenor.com | Tenor | compile 'com.kevalpatel2106:gifpack-tenor:<latest> |
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.