Filter emoji where "visible_in_picker" is set to false. (#907)

Addresses #770
main
Levi Bard 6 years ago committed by Konrad Pozniak
parent e03482d759
commit 506189ceed
  1. 1
      app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java
  2. 7
      app/src/main/java/com/keylesspalace/tusky/adapter/EmojiAdapter.kt
  3. 4
      app/src/main/java/com/keylesspalace/tusky/entity/Emoji.kt

@ -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…
Cancel
Save