Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
38f22b12
Commit
38f22b12
authored
Mar 12, 2018
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement message action to react to message
parent
89842afc
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
31 additions
and
6 deletions
+31
-6
ChatRoomAdapter.kt
...a/chat/rocket/android/chatroom/adapter/ChatRoomAdapter.kt
+1
-0
MessageReactionsAdapter.kt
...ocket/android/chatroom/adapter/MessageReactionsAdapter.kt
+2
-2
ChatRoomPresenter.kt
...rocket/android/chatroom/presentation/ChatRoomPresenter.kt
+4
-0
ChatRoomView.kt
...chat/rocket/android/chatroom/presentation/ChatRoomView.kt
+1
-0
ChatRoomFragment.kt
.../java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
+12
-0
EmojiKeyboardPopup.kt
...va/chat/rocket/android/widget/emoji/EmojiKeyboardPopup.kt
+1
-1
EmojiListenerAdapter.kt
.../chat/rocket/android/widget/emoji/EmojiListenerAdapter.kt
+1
-1
EmojiPickerPopup.kt
...java/chat/rocket/android/widget/emoji/EmojiPickerPopup.kt
+1
-1
message_actions.xml
app/src/main/res/menu/message_actions.xml
+5
-0
strings.xml
app/src/main/res/values-pt-rBR/strings.xml
+2
-1
strings.xml
app/src/main/res/values/strings.xml
+1
-0
No files found.
app/src/main/java/chat/rocket/android/chatroom/adapter/ChatRoomAdapter.kt
View file @
38f22b12
...
@@ -155,6 +155,7 @@ class ChatRoomAdapter(
...
@@ -155,6 +155,7 @@ class ChatRoomAdapter(
}
}
}
}
}
}
R
.
id
.
action_menu_msg_react
->
presenter
?.
showReactions
(
id
)
else
->
TODO
(
"Not implemented"
)
else
->
TODO
(
"Not implemented"
)
}
}
}
}
...
...
app/src/main/java/chat/rocket/android/chatroom/adapter/MessageReactionsAdapter.kt
View file @
38f22b12
...
@@ -11,7 +11,7 @@ import chat.rocket.android.chatroom.viewmodel.ReactionViewModel
...
@@ -11,7 +11,7 @@ import chat.rocket.android.chatroom.viewmodel.ReactionViewModel
import
chat.rocket.android.dagger.DaggerLocalComponent
import
chat.rocket.android.dagger.DaggerLocalComponent
import
chat.rocket.android.infrastructure.LocalRepository
import
chat.rocket.android.infrastructure.LocalRepository
import
chat.rocket.android.widget.emoji.Emoji
import
chat.rocket.android.widget.emoji.Emoji
import
chat.rocket.android.widget.emoji.Emoji
Keyboard
ListenerAdapter
import
chat.rocket.android.widget.emoji.EmojiListenerAdapter
import
chat.rocket.android.widget.emoji.EmojiPickerPopup
import
chat.rocket.android.widget.emoji.EmojiPickerPopup
import
chat.rocket.android.widget.emoji.EmojiReactionListener
import
chat.rocket.android.widget.emoji.EmojiReactionListener
import
java.util.concurrent.CopyOnWriteArrayList
import
java.util.concurrent.CopyOnWriteArrayList
...
@@ -122,7 +122,7 @@ class MessageReactionsAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder>()
...
@@ -122,7 +122,7 @@ class MessageReactionsAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder>()
itemView
as
ImageView
itemView
as
ImageView
itemView
.
setOnClickListener
{
itemView
.
setOnClickListener
{
val
emojiPickerPopup
=
EmojiPickerPopup
(
itemView
.
context
)
val
emojiPickerPopup
=
EmojiPickerPopup
(
itemView
.
context
)
emojiPickerPopup
.
listener
=
object
:
Emoji
Keyboard
ListenerAdapter
()
{
emojiPickerPopup
.
listener
=
object
:
EmojiListenerAdapter
()
{
override
fun
onEmojiAdded
(
emoji
:
Emoji
)
{
override
fun
onEmojiAdded
(
emoji
:
Emoji
)
{
listener
?.
onReactionAdded
(
messageId
,
emoji
)
listener
?.
onReactionAdded
(
messageId
,
emoji
)
}
}
...
...
app/src/main/java/chat/rocket/android/chatroom/presentation/ChatRoomPresenter.kt
View file @
38f22b12
...
@@ -355,6 +355,10 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView,
...
@@ -355,6 +355,10 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView,
}
}
}
}
fun
showReactions
(
messageId
:
String
)
{
view
.
showReactionsPopup
(
messageId
)
}
private
fun
updateMessage
(
streamedMessage
:
Message
)
{
private
fun
updateMessage
(
streamedMessage
:
Message
)
{
launchUI
(
strategy
)
{
launchUI
(
strategy
)
{
val
viewModelStreamedMessage
=
mapper
.
map
(
streamedMessage
)
val
viewModelStreamedMessage
=
mapper
.
map
(
streamedMessage
)
...
...
app/src/main/java/chat/rocket/android/chatroom/presentation/ChatRoomView.kt
View file @
38f22b12
...
@@ -100,4 +100,5 @@ interface ChatRoomView : LoadingView, MessageView {
...
@@ -100,4 +100,5 @@ interface ChatRoomView : LoadingView, MessageView {
fun
showInvalidFileSize
(
fileSize
:
Int
,
maxFileSize
:
Int
)
fun
showInvalidFileSize
(
fileSize
:
Int
,
maxFileSize
:
Int
)
fun
showConnectionState
(
state
:
State
)
fun
showConnectionState
(
state
:
State
)
fun
showReactionsPopup
(
messageId
:
String
)
}
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
View file @
38f22b12
...
@@ -287,6 +287,18 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
...
@@ -287,6 +287,18 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
presenter
.
react
(
messageId
,
emoji
.
shortname
)
presenter
.
react
(
messageId
,
emoji
.
shortname
)
}
}
override
fun
showReactionsPopup
(
messageId
:
String
)
{
context
?.
let
{
val
emojiPickerPopup
=
EmojiPickerPopup
(
it
)
emojiPickerPopup
.
listener
=
object
:
EmojiListenerAdapter
()
{
override
fun
onEmojiAdded
(
emoji
:
Emoji
)
{
onReactionAdded
(
messageId
,
emoji
)
}
}
emojiPickerPopup
.
show
()
}
}
private
fun
setReactionButtonIcon
(
@DrawableRes
drawableId
:
Int
)
{
private
fun
setReactionButtonIcon
(
@DrawableRes
drawableId
:
Int
)
{
button_add_reaction
.
setImageResource
(
drawableId
)
button_add_reaction
.
setImageResource
(
drawableId
)
button_add_reaction
.
setTag
(
drawableId
)
button_add_reaction
.
setTag
(
drawableId
)
...
...
app/src/main/java/chat/rocket/android/widget/emoji/EmojiKeyboardPopup.kt
View file @
38f22b12
...
@@ -65,7 +65,7 @@ class EmojiKeyboardPopup(context: Context, view: View) : OverKeyboardPopupWindow
...
@@ -65,7 +65,7 @@ class EmojiKeyboardPopup(context: Context, view: View) : OverKeyboardPopupWindow
}
}
}
}
viewPager
.
adapter
=
CategoryPagerAdapter
(
object
:
Emoji
Keyboard
ListenerAdapter
()
{
viewPager
.
adapter
=
CategoryPagerAdapter
(
object
:
EmojiListenerAdapter
()
{
override
fun
onEmojiAdded
(
emoji
:
Emoji
)
{
override
fun
onEmojiAdded
(
emoji
:
Emoji
)
{
EmojiRepository
.
addToRecents
(
emoji
)
EmojiRepository
.
addToRecents
(
emoji
)
callback
.
onEmojiAdded
(
emoji
)
callback
.
onEmojiAdded
(
emoji
)
...
...
app/src/main/java/chat/rocket/android/widget/emoji/Emoji
Keyboard
ListenerAdapter.kt
→
app/src/main/java/chat/rocket/android/widget/emoji/EmojiListenerAdapter.kt
View file @
38f22b12
package
chat.rocket.android.widget.emoji
package
chat.rocket.android.widget.emoji
abstract
class
Emoji
Keyboard
ListenerAdapter
:
EmojiKeyboardListener
{
abstract
class
EmojiListenerAdapter
:
EmojiKeyboardListener
{
override
fun
onEmojiAdded
(
emoji
:
Emoji
)
{
override
fun
onEmojiAdded
(
emoji
:
Emoji
)
{
// this space is for rent
// this space is for rent
...
...
app/src/main/java/chat/rocket/android/widget/emoji/EmojiPickerPopup.kt
View file @
38f22b12
...
@@ -38,7 +38,7 @@ class EmojiPickerPopup(context: Context) : Dialog(context) {
...
@@ -38,7 +38,7 @@ class EmojiPickerPopup(context: Context) : Dialog(context) {
}
}
private
fun
setupViewPager
()
{
private
fun
setupViewPager
()
{
viewPager
.
adapter
=
CategoryPagerAdapter
(
object
:
Emoji
Keyboard
ListenerAdapter
()
{
viewPager
.
adapter
=
CategoryPagerAdapter
(
object
:
EmojiListenerAdapter
()
{
override
fun
onEmojiAdded
(
emoji
:
Emoji
)
{
override
fun
onEmojiAdded
(
emoji
:
Emoji
)
{
EmojiRepository
.
addToRecents
(
emoji
)
EmojiRepository
.
addToRecents
(
emoji
)
dismiss
()
dismiss
()
...
...
app/src/main/res/menu/message_actions.xml
View file @
38f22b12
...
@@ -22,6 +22,11 @@
...
@@ -22,6 +22,11 @@
android:icon=
"@drawable/ic_content_copy_black_24px"
android:icon=
"@drawable/ic_content_copy_black_24px"
android:title=
"@string/action_msg_copy"
/>
android:title=
"@string/action_msg_copy"
/>
<item
android:id=
"@+id/action_menu_msg_react"
android:icon=
"@drawable/ic_add_reaction"
android:title=
"@string/action_msg_add_reaction"
/>
<!--<item-->
<!--<item-->
<!--android:id="@+id/action_menu_msg_share"-->
<!--android:id="@+id/action_menu_msg_share"-->
<!--andrtextIconicon="@drawable/ic_share_black_24px"-->
<!--andrtextIconicon="@drawable/ic_share_black_24px"-->
...
...
app/src/main/res/values-pt-rBR/strings.xml
View file @
38f22b12
...
@@ -82,10 +82,11 @@
...
@@ -82,10 +82,11 @@
<string
name=
"action_msg_quote"
>
Citar
</string>
<string
name=
"action_msg_quote"
>
Citar
</string>
<string
name=
"action_msg_delete"
>
Remover
</string>
<string
name=
"action_msg_delete"
>
Remover
</string>
<string
name=
"action_msg_pin"
>
Fixar Mensagem
</string>
<string
name=
"action_msg_pin"
>
Fixar Mensagem
</string>
<string
name=
"action_msg_unpin"
>
Desafixar Me
s
sagem
</string>
<string
name=
"action_msg_unpin"
>
Desafixar Me
n
sagem
</string>
<string
name=
"action_msg_star"
>
Favoritar Mensagem
</string>
<string
name=
"action_msg_star"
>
Favoritar Mensagem
</string>
<string
name=
"action_msg_share"
>
Compartilhar
</string>
<string
name=
"action_msg_share"
>
Compartilhar
</string>
<string
name=
"action_title_editing"
>
Editando Mensagem
</string>
<string
name=
"action_title_editing"
>
Editando Mensagem
</string>
<string
name=
"action_msg_add_reaction"
>
Adicionar reação
</string>
<!-- Permission messages -->
<!-- Permission messages -->
<string
name=
"permission_editing_not_allowed"
>
Edição não permitida
</string>
<string
name=
"permission_editing_not_allowed"
>
Edição não permitida
</string>
...
...
app/src/main/res/values/strings.xml
View file @
38f22b12
...
@@ -88,6 +88,7 @@
...
@@ -88,6 +88,7 @@
<string
name=
"action_msg_star"
>
Star Message
</string>
<string
name=
"action_msg_star"
>
Star Message
</string>
<string
name=
"action_msg_share"
>
Share
</string>
<string
name=
"action_msg_share"
>
Share
</string>
<string
name=
"action_title_editing"
>
Editing Message
</string>
<string
name=
"action_title_editing"
>
Editing Message
</string>
<string
name=
"action_msg_add_reaction"
>
Add reaction
</string>
<!-- Permission messages -->
<!-- Permission messages -->
<string
name=
"permission_editing_not_allowed"
>
Editing is not allowed
</string>
<string
name=
"permission_editing_not_allowed"
>
Editing is not allowed
</string>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment