Commit e09068ec authored by Leonardo Aramaki's avatar Leonardo Aramaki

Add message actions popup menu

parent 2c9576af
......@@ -5,6 +5,7 @@ import android.text.method.LinkMovementMethod
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.PopupMenu
import android.widget.TextView
import chat.rocket.android.R
import chat.rocket.android.chatroom.viewmodel.AttachmentType
......@@ -13,7 +14,6 @@ import chat.rocket.android.player.PlayerActivity
import chat.rocket.android.util.content
import chat.rocket.android.util.inflate
import chat.rocket.android.util.setVisible
import chat.rocket.android.util.textContent
import chat.rocket.common.util.ifNull
import com.facebook.drawee.view.SimpleDraweeView
import com.stfalcon.frescoimageviewer.ImageViewer
......@@ -73,6 +73,12 @@ class ChatRoomAdapter(private val serverUrl: String) : RecyclerView.Adapter<Chat
bindAttachment(message, message_attachment, image_attachment, audio_video_attachment,
file_name)
itemView.setOnClickListener {
val popup = PopupMenu(it.context, it)
popup.menuInflater.inflate(R.menu.message_actions, popup.menu)
popup.show()
}
}
private fun bindAttachment(message: MessageViewModel,
......
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<!--<item-->
<!--android:id="@+id/action_menu_msg_reply"-->
<!--android:title="@string/action_msg_reply" />-->
<!--<item-->
<!--android:id="@+id/action_menu_msg_edit"-->
<!--android:title="@string/action_msg_edit" />-->
<!--<item-->
<!--android:id="@+id/action_menu_msg_copy"-->
<!--android:title="@string/action_msg_copy" />-->
<!--<item-->
<!--android:id="@+id/action_menu_msg_quote"-->
<!--android:title="@string/action_msg_quote" />-->
<item
android:id="@+id/action_menu_msg_delete"
android:title="@string/action_msg_delete" />
</menu>
\ No newline at end of file
......@@ -50,4 +50,11 @@
<string name="message_welcome">Bem-vindo, %s</string>
<string name="message_removed">Mensagem removida</string>
<!-- Message actions -->
<string name="action_msg_reply">Responder</string>
<string name="action_msg_edit">Editar</string>
<string name="action_msg_copy">Copiar</string>
<string name="action_msg_quote">Citar</string>
<string name="action_msg_delete">Remover</string>
</resources>
\ No newline at end of file
......@@ -52,4 +52,11 @@
<string name="message_welcome">Welcome %s</string>
<string name="message_removed">Message removed</string>
<!-- Message actions -->
<string name="action_msg_reply">Reply</string>
<string name="action_msg_edit">Edit</string>
<string name="action_msg_copy">Copy</string>
<string name="action_msg_quote">Quote</string>
<string name="action_msg_delete">Delete</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