Commit 49e68750 authored by Divyanshu Bhargava's avatar Divyanshu Bhargava

requested changes done

parent 42d65277
......@@ -9,6 +9,7 @@ import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import chat.rocket.android.R
import chat.rocket.android.util.extensions.setVisible
import java.util.*
class CategoryPagerAdapter(val listener: EmojiKeyboardListener) : PagerAdapter() {
......@@ -24,7 +25,7 @@ class CategoryPagerAdapter(val listener: EmojiKeyboardListener) : PagerAdapter()
val recycler = view.findViewById(R.id.emojiRecyclerView) as RecyclerView
val adapter = EmojiAdapter(layoutManager.spanCount, listener)
val category = EmojiCategory.values().get(position)
val tv_recent_emoji : TextView = view.findViewById(R.id.tv_recent_emoji)
val text_no_recent_emoji : TextView = view.findViewById(R.id.text_no_recent_emoji)
val emojis = if (category != EmojiCategory.RECENTS) {
EmojiRepository.getEmojisByCategory(category)
} else {
......@@ -32,9 +33,9 @@ class CategoryPagerAdapter(val listener: EmojiKeyboardListener) : PagerAdapter()
}
val recentEmojiSize = EmojiRepository.getRecents().size
if (category == EmojiCategory.RECENTS && recentEmojiSize == 0){
tv_recent_emoji.visibility = View.VISIBLE
text_no_recent_emoji.setVisible(true)
}else{
tv_recent_emoji.visibility = View.GONE
text_no_recent_emoji.setVisible(false)
}
adapter.addEmojis(emojis)
recycler.layoutManager = layoutManager
......
......@@ -16,7 +16,7 @@
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_recent_emoji"
android:id="@+id/text_no_recent_emoji"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/msg_no_recent_emoji"
......
......@@ -114,4 +114,7 @@
<string name="status_authenticating">autenticando</string>
<string name="status_disconnecting">desconectando</string>
<string name="status_waiting">conectando em %d segundos</string>
<!-- Emoji message-->
<string name="msg_no_recent_emoji">Nenhum emoji recente</string>
</resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment