Skip to content

Commit

Permalink
Refactor Emoji Initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
wax911 committed Oct 5, 2019
1 parent ff57984 commit b62f3ef
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions emojify/src/main/java/io/wax911/emojify/EmojiManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,10 @@ object EmojiManager {
@Throws(Exception::class)
fun initEmojiData(context: Context) {
if (ALL_EMOJIS.isEmpty()) {
val gson = GsonBuilder()
.enableComplexMapKeySerialization()
.setLenient().create()
InputStreamReader(context.assets.open(PATH)).use { streamReader ->
BufferedReader(streamReader).use {
ALL_EMOJIS.apply {
val gson = GsonBuilder().setLenient().create()
addAll(gson.fromJson(it, object : TypeToken<ArrayList<Emoji>>() {}.type))
forEach { emoji -> emoji.initProperties() }
}
Expand Down

0 comments on commit b62f3ef

Please sign in to comment.