Filter emoji where "visible_in_picker" is set to false. (#907)
Addresses #770
This commit is contained in:
parent
6960d725a3
commit
b483a0bf25
|
@ -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;
|
||||
|
|
|
@ -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<Emoji>, private val onEmojiSelectedListener: OnEmojiSelectedListener) : RecyclerView.Adapter<EmojiAdapter.EmojiHolder>() {
|
||||
class EmojiAdapter(emojiList: List<Emoji>, private val onEmojiSelectedListener: OnEmojiSelectedListener) : RecyclerView.Adapter<EmojiAdapter.EmojiHolder>() {
|
||||
private val emojiList : List<Emoji>
|
||||
|
||||
init {
|
||||
this.emojiList = emojiList.filter { emoji -> emoji.visibleInPicker == null || emoji.visibleInPicker }
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return emojiList.size
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue