Commit 42d65277 authored by Divyanshu Bhargava's avatar Divyanshu Bhargava

No recent emoji msg shown in emoji picker

parent 62af887c
......@@ -24,11 +24,18 @@ 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 emojis = if (category != EmojiCategory.RECENTS) {
EmojiRepository.getEmojisByCategory(category)
} else {
EmojiRepository.getRecents()
}
val recentEmojiSize = EmojiRepository.getRecents().size
if (category == EmojiCategory.RECENTS && recentEmojiSize == 0){
tv_recent_emoji.visibility = View.VISIBLE
}else{
tv_recent_emoji.visibility = View.GONE
}
adapter.addEmojis(emojis)
recycler.layoutManager = layoutManager
recycler.itemAnimator = DefaultItemAnimator()
......
......@@ -15,4 +15,14 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_recent_emoji"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/msg_no_recent_emoji"
android:layout_gravity="center"
android:elevation="10dp"
android:textSize="16sp"
android:visibility="gone"/>
</android.support.design.widget.CoordinatorLayout>
\ No newline at end of file
......@@ -116,4 +116,7 @@
<string name="status_disconnecting">disconnecting</string>
<string name="status_waiting">connecting in %d seconds</string>
<!-- Emoji message-->
<string name="msg_no_recent_emoji">No recent emoji</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