diff --git a/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java b/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java index c582d22d..ddee3f37 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java @@ -125,7 +125,6 @@ import java.io.InputStream; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.Comparator; import java.util.Date; import java.util.Iterator; import java.util.List; diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/EmojiAdapter.kt b/app/src/main/java/com/keylesspalace/tusky/adapter/EmojiAdapter.kt index 61e131b4..8d31ae6f 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/EmojiAdapter.kt +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/EmojiAdapter.kt @@ -23,7 +23,12 @@ import com.keylesspalace.tusky.R import com.keylesspalace.tusky.entity.Emoji import com.squareup.picasso.Picasso -class EmojiAdapter(private val emojiList: List, private val onEmojiSelectedListener: OnEmojiSelectedListener) : RecyclerView.Adapter() { +class EmojiAdapter(emojiList: List, private val onEmojiSelectedListener: OnEmojiSelectedListener) : RecyclerView.Adapter() { + private val emojiList : List + + init { + this.emojiList = emojiList.filter { emoji -> emoji.visibleInPicker == null || emoji.visibleInPicker } + } override fun getItemCount(): Int { return emojiList.size diff --git a/app/src/main/java/com/keylesspalace/tusky/entity/Emoji.kt b/app/src/main/java/com/keylesspalace/tusky/entity/Emoji.kt index 1c0cb4dc..baee54bc 100644 --- a/app/src/main/java/com/keylesspalace/tusky/entity/Emoji.kt +++ b/app/src/main/java/com/keylesspalace/tusky/entity/Emoji.kt @@ -16,10 +16,12 @@ package com.keylesspalace.tusky.entity import android.os.Parcelable +import com.google.gson.annotations.SerializedName import kotlinx.android.parcel.Parcelize @Parcelize data class Emoji( val shortcode: String, - val url: String + val url: String, + @SerializedName("visible_in_picker") val visibleInPicker: Boolean? ) : Parcelable \ No newline at end of file