Skip to content
Snippets Groups Projects
Commit c6ee944c authored by Taras's avatar Taras
Browse files

Prefil message for edit

parent a597acb5
No related branches found
No related tags found
No related merge requests found
...@@ -137,6 +137,10 @@ class DMTimelineDialogFragment : ...@@ -137,6 +137,10 @@ class DMTimelineDialogFragment :
withConfirmation(RemovePost()) { viewModel.removeMessage(args.roomId, eventId) } withConfirmation(RemovePost()) { viewModel.removeMessage(args.roomId, eventId) }
} }
override fun onEditActionClicked(eventId: String, message: String) {
binding.vSendMessage.setTextForEdit(eventId, message)
}
override fun onSaveToDevice(content: PostContent) { override fun onSaveToDevice(content: PostContent) {
viewModel.saveToDevice(content) viewModel.saveToDevice(content)
} }
......
...@@ -13,6 +13,6 @@ interface DmOptionsListener { ...@@ -13,6 +13,6 @@ interface DmOptionsListener {
fun onEmojiChipClicked(eventId: String, emoji: String, isUnSend: Boolean) fun onEmojiChipClicked(eventId: String, emoji: String, isUnSend: Boolean)
fun onSaveToDevice(content: PostContent) fun onSaveToDevice(content: PostContent)
fun onRemove(eventId: String) fun onRemove(eventId: String)
fun onEdit(eventId: String) fun onEditActionClicked(eventId: String, message: String)
} }
\ No newline at end of file
...@@ -7,7 +7,6 @@ import android.view.LayoutInflater ...@@ -7,7 +7,6 @@ import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.core.widget.doAfterTextChanged import androidx.core.widget.doAfterTextChanged
import org.futo.circles.R
import org.futo.circles.core.extensions.getText import org.futo.circles.core.extensions.getText
import org.futo.circles.core.extensions.setIsVisible import org.futo.circles.core.extensions.setIsVisible
import org.futo.circles.databinding.ViewSendMessageBinding import org.futo.circles.databinding.ViewSendMessageBinding
...@@ -54,4 +53,8 @@ class SendMessageView( ...@@ -54,4 +53,8 @@ class SendMessageView(
binding.etMessage.setSelection(selection + unicode.length) binding.etMessage.setSelection(selection + unicode.length)
} }
fun setTextForEdit(eventId: String, message: String) {
binding.etMessage.setText(message)
}
} }
\ No newline at end of file
...@@ -6,6 +6,8 @@ sealed class PostContent(open val type: PostContentType) { ...@@ -6,6 +6,8 @@ sealed class PostContent(open val type: PostContentType) {
type == PostContentType.IMAGE_CONTENT || type == PostContentType.VIDEO_CONTENT type == PostContentType.IMAGE_CONTENT || type == PostContentType.VIDEO_CONTENT
fun isPoll(): Boolean = type == PostContentType.POLL_CONTENT fun isPoll(): Boolean = type == PostContentType.POLL_CONTENT
fun isText(): Boolean = type == PostContentType.TEXT_CONTENT
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment