mirror of
https://github.com/googlefonts/noto-emoji.git
synced 2025-07-08 13:36:40 +00:00
Hotfix for FileEmojiCompatConfig
This commit is contained in:
parent
da60d4fcdc
commit
3667d9b43e
2 changed files with 7 additions and 6 deletions
|
@ -18,7 +18,7 @@ ext {
|
|||
libraryDescription = 'An EmojiCompat implementation using files from a local file or a file inside your assets directory'
|
||||
siteUrl = 'https://github.com/c1710/blobmoji'
|
||||
gitUrl = 'https://github.com/c1710/blobmoji.git'
|
||||
libraryVersion = '1.0.3'
|
||||
libraryVersion = '1.0.5'
|
||||
developerId = 'c1710'
|
||||
developerName = 'Constantin A.'
|
||||
developerEmail = 'c1710.apps@outlook.com'
|
||||
|
@ -33,8 +33,8 @@ android {
|
|||
defaultConfig {
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 27
|
||||
versionCode 4
|
||||
versionName "1.0.3"
|
||||
versionCode 5
|
||||
versionName "1.0.5"
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ import android.content.res.AssetManager;
|
|||
import android.graphics.Typeface;
|
||||
import android.os.Build;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.annotation.RequiresApi;
|
||||
import android.support.text.emoji.EmojiCompat;
|
||||
import android.support.text.emoji.MetadataRepo;
|
||||
|
@ -68,9 +69,9 @@ public class FileEmojiCompatConfig extends EmojiCompat.Config {
|
|||
*/
|
||||
public FileEmojiCompatConfig(@NonNull Context context,
|
||||
// NEW
|
||||
@NonNull File fontFile) {
|
||||
@Nullable File fontFile) {
|
||||
super(new FileMetadataLoader(context, fontFile));
|
||||
if(fontFile.exists() && fontFile.canRead()) {
|
||||
if(fontFile != null && fontFile.exists() && fontFile.canRead()) {
|
||||
try {
|
||||
// Is it a font?
|
||||
Typeface typeface = Typeface.createFromFile(fontFile);
|
||||
|
@ -136,7 +137,7 @@ public class FileEmojiCompatConfig extends EmojiCompat.Config {
|
|||
|
||||
private FileMetadataLoader(@NonNull Context context,
|
||||
// NEW
|
||||
File fontFile) {
|
||||
@Nullable File fontFile) {
|
||||
this.mContext = context.getApplicationContext();
|
||||
// NEW
|
||||
this.fontFile = fontFile;
|
||||
|
|
Loading…
Add table
Reference in a new issue