Android Jetpack | ||||||||||
| ||||||||||
| ||||||||||
| ||||||||||
| ||||||||||
|
Emoji, Android Jetpack UI Components, Enable an up-to-date emoji font on older platforms
The EmojiCompat support library is used to make sure Android devices will have up to date emoji, and are available for your app.
The EmojiCompat support library, supported from Android 4.4 (API level 19) and higher. for lower version devices prior to API level 19, the EmojiCompat and its widgets are in a "no operation" state. and the emoji will be displayed exactly like a regular TextView.
Add it in dependencies section of build.gradle file of your app.
dependencies {
...
implementation "com.android.support:support-emoji:28.0.0"
}
Initialize EmojiCompat in app to load the metadata and the typeface. the initialization process runs on a background thread and can take some time.
FontRequest fontRequestObject = new FontRequest(
"com.ft.fontprovider",
"com.ft",
"emoji Font Query",
SSL_CERTIFICATES);
EmojiCompat.Config configObject = new FontRequestEmojiCompatConfig( this, fontRequestObject);
EmojiCompat.init( configObject);
Widget | Class |
---|---|
EmojiTextView | android.support.text.emoji.widget.EmojiTextView |
EmojiEditText | android.support.text.emoji.widget.EmojiEditText |
EmojiButton | android.support.text.emoji.widget.EmojiButton |
for using Emoji Widgets in AppCompat,- use EmojiCompat widgets that extend from AppCompat widgets.
Add the AppCompat support library to the dependencies section of build.gradle file of your app.
dependencies {
...
implementation "com.android.support:support-emoji-appcompat:$version"
}
Widget | Class |
---|---|
EmojiAppCompatTextView | android.support.text.emoji.widget.EmojiAppCompatTextView |
EmojiAppCompatEditText | android.support.text.emoji.widget.EmojiAppCompatEditText |
EmojiAppCompatButton | android.support.text.emoji.widget.EmojiAppCompatButton |
Animation & transitions, Android Jetpack UI Components, Move widgets and transition between screens
posted on 2019-10-25 08:04:17 - Android Jetpack Tutorials
Emoji, Android Jetpack UI Components, Enable an up-to-date emoji font on older platforms
posted on 2019-10-25 08:03:43 - Android Jetpack Tutorials
Fragment, Android Jetpack UI Components, A basic unit of composable UI
posted on 2019-10-25 08:03:24 - Android Jetpack Tutorials