Render emoji (using emojicon) in your Android application with just 1 line of code.
import io.github.rockerhieu.emojiconize.Emojiconize;
// Your activity must be a subclass of AppCompatActivity
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// Emojiconize the whole activity, must call before `super.onCreate()`
Emojiconize.activity(this).go();
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
Emojiconize.activity(activity).go()
: support emoji rendering for the givenactivity
, must call beforeactivity.super.onCreate()
Emojiconize.view(view).go()
: support emoji rendering for the given view and all of its children.
Via Gradle:
compile 'io.github.rockerhieu:emojiconize:<latest-version>'
Emojiconize uses emojicon for rendering emoji and is based on the idea of MdLayoutInflaterFactory
from android-md-core.
Please fork this repository and contribute back using pull requests.
Any contributions, large or small, major features, bug fixes, additional language translations, unit/integration tests are welcomed and appreciated but will be thoroughly reviewed and discussed.
Copyright (c) 2016 Hieu Rocker
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.