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
60f0c4d4
Commit
60f0c4d4
authored
Oct 20, 2018
by
Łukasz Rutkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show users summary when long-clicking reaction
parent
79bc2d7d
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
81 additions
and
2 deletions
+81
-2
BaseViewHolder.kt
...va/chat/rocket/android/chatroom/adapter/BaseViewHolder.kt
+4
-0
MessageReactionsAdapter.kt
...ocket/android/chatroom/adapter/MessageReactionsAdapter.kt
+8
-2
ChatRoomPresenter.kt
...rocket/android/chatroom/presentation/ChatRoomPresenter.kt
+4
-0
ChatRoomView.kt
...chat/rocket/android/chatroom/presentation/ChatRoomView.kt
+2
-0
ChatRoomFragment.kt
.../java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
+28
-0
strings.xml
app/src/main/res/values-de/strings.xml
+3
-0
strings.xml
app/src/main/res/values-es/strings.xml
+3
-0
strings.xml
app/src/main/res/values-fr/strings.xml
+3
-0
strings.xml
app/src/main/res/values-ja/strings.xml
+3
-0
strings.xml
app/src/main/res/values-pt-rBR/strings.xml
+3
-0
strings.xml
app/src/main/res/values-ru-rRU/strings.xml
+3
-0
strings.xml
app/src/main/res/values-tr/strings.xml
+3
-0
strings.xml
app/src/main/res/values-uk/strings.xml
+3
-0
strings.xml
app/src/main/res/values/strings.xml
+3
-0
EmojiReactionListener.kt
...n/java/chat/rocket/android/emoji/EmojiReactionListener.kt
+8
-0
No files found.
app/src/main/java/chat/rocket/android/chatroom/adapter/BaseViewHolder.kt
View file @
60f0c4d4
...
...
@@ -60,6 +60,10 @@ abstract class BaseViewHolder<T : BaseUiModel<*>>(
reactionListener
?.
onReactionAdded
(
messageId
,
emoji
)
}
}
override
fun
onReactionLongClicked
(
emojiShortname
:
String
,
usernames
:
List
<
String
>)
{
reactionListener
?.
onReactionLongClicked
(
emojiShortname
,
usernames
)
}
}
val
context
=
itemView
.
context
val
manager
=
FlexboxLayoutManager
(
context
,
FlexDirection
.
ROW
)
...
...
app/src/main/java/chat/rocket/android/chatroom/adapter/MessageReactionsAdapter.kt
View file @
60f0c4d4
...
...
@@ -4,7 +4,6 @@ import android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.ImageView
import
android.widget.TextView
import
androidx.core.content.ContextCompat
import
androidx.recyclerview.widget.RecyclerView
import
chat.rocket.android.R
...
...
@@ -76,7 +75,7 @@ class MessageReactionsAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder>()
class
SingleReactionViewHolder
(
view
:
View
,
private
val
listener
:
EmojiReactionListener
?
)
:
RecyclerView
.
ViewHolder
(
view
),
View
.
OnClickListener
{
)
:
RecyclerView
.
ViewHolder
(
view
),
View
.
OnClickListener
,
View
.
OnLongClickListener
{
@Inject
lateinit
var
localRepository
:
LocalRepository
...
...
@@ -119,6 +118,8 @@ class MessageReactionsAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder>()
view_flipper_reaction
.
setOnClickListener
(
this
@SingleReactionViewHolder
)
text_count
.
setOnClickListener
(
this
@SingleReactionViewHolder
)
view_flipper_reaction
.
setOnLongClickListener
(
this
@SingleReactionViewHolder
)
text_count
.
setOnLongClickListener
(
this
@SingleReactionViewHolder
)
}
}
...
...
@@ -130,6 +131,11 @@ class MessageReactionsAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder>()
}
}
}
override
fun
onLongClick
(
v
:
View
?):
Boolean
{
listener
?.
onReactionLongClicked
(
reaction
.
shortname
,
reaction
.
usernames
)
return
true
}
}
class
AddReactionViewHolder
(
...
...
app/src/main/java/chat/rocket/android/chatroom/presentation/ChatRoomPresenter.kt
View file @
60f0c4d4
...
...
@@ -989,6 +989,10 @@ class ChatRoomPresenter @Inject constructor(
view
.
showReactionsPopup
(
messageId
)
}
fun
showReactionsSummary
(
emojiShortname
:
String
,
usernames
:
List
<
String
>)
{
view
.
showReactionsSummary
(
emojiShortname
,
usernames
,
currentLoggedUsername
)
}
fun
loadCommands
()
{
launchUI
(
strategy
)
{
try
{
...
...
app/src/main/java/chat/rocket/android/chatroom/presentation/ChatRoomView.kt
View file @
60f0c4d4
...
...
@@ -140,6 +140,8 @@ interface ChatRoomView : LoadingView, MessageView {
fun
showReactionsPopup
(
messageId
:
String
)
fun
showReactionsSummary
(
emojiShortname
:
String
,
usernames
:
List
<
String
>,
currentLoggedUsername
:
String
?)
/**
* Show list of commands.
*
...
...
app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
View file @
60f0c4d4
...
...
@@ -22,6 +22,7 @@ import android.widget.EditText
import
android.widget.FrameLayout
import
android.widget.ImageView
import
android.widget.TextView
import
android.widget.Toast
import
androidx.annotation.DrawableRes
import
androidx.core.text.bold
import
androidx.core.view.isVisible
...
...
@@ -665,6 +666,33 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
presenter
.
react
(
messageId
,
emoji
.
shortname
)
}
override
fun
onReactionLongClicked
(
emojiShortname
:
String
,
usernames
:
List
<
String
>)
{
presenter
.
showReactionsSummary
(
emojiShortname
,
usernames
)
}
override
fun
showReactionsSummary
(
emojiShortname
:
String
,
usernames
:
List
<
String
>,
currentLoggedUsername
:
String
?)
{
var
usernamesString
=
usernames
.
asSequence
()
.
take
(
15
)
.
joinToString
{
username
->
if
(
username
==
currentLoggedUsername
)
{
getString
(
R
.
string
.
msg_you
).
toLowerCase
()
}
else
{
"@$username"
}
}
if
(
usernames
.
size
>
15
)
{
usernamesString
+=
" "
+
getString
(
R
.
string
.
And_more
,
usernames
.
size
-
15
).
toLowerCase
()
}
else
{
usernamesString
=
usernamesString
.
replace
(
""",([^,]+)$"""
.
toRegex
())
{
" ${getString(R.string.and)}${it.groupValues[1]}"
}
}
if
(
usernamesString
[
0
]
!=
'@'
)
{
usernamesString
=
usernamesString
.
capitalize
()
}
showToast
(
"$usernamesString ${getString(R.string.Reacted_with).toLowerCase()} $emojiShortname"
,
Toast
.
LENGTH_LONG
)
}
override
fun
showReactionsPopup
(
messageId
:
String
)
{
ui
{
val
emojiPickerPopup
=
EmojiPickerPopup
(
it
)
...
...
app/src/main/res/values-de/strings.xml
View file @
60f0c4d4
...
...
@@ -277,6 +277,9 @@
<!-- Emoji message-->
<string
name=
"msg_no_recent_emoji"
>
Keine letzten Emojis
</string>
<string
name=
"alert_title_default_skin_tone"
>
Standart Hautton
</string>
<string
name=
"And_more"
>
Und %1$d mehr
</string>
<string
name=
"and"
>
und
</string>
<string
name=
"Reacted_with"
>
Reagierte mit
</string>
<!-- Sorting and grouping-->
<string
name=
"menu_chatroom_sort"
>
Sortiere
</string>
...
...
app/src/main/res/values-es/strings.xml
View file @
60f0c4d4
...
...
@@ -275,6 +275,9 @@
<!-- Emoji message-->
<string
name=
"msg_no_recent_emoji"
>
Sin emojis recientes
</string>
<string
name=
"alert_title_default_skin_tone"
>
Tono de piel predeterminado
</string>
<string
name=
"And_more"
>
Y %1$d mas
</string>
<string
name=
"and"
>
y
</string>
<string
name=
"Reacted_with"
>
Reacciono con
</string>
<!-- Sorting and grouping-->
<string
name=
"menu_chatroom_sort"
>
Ordenar
</string>
...
...
app/src/main/res/values-fr/strings.xml
View file @
60f0c4d4
...
...
@@ -280,6 +280,9 @@
<!-- Emoji message-->
<string
name=
"msg_no_recent_emoji"
>
Aucun emoji récent
</string>
<string
name=
"alert_title_default_skin_tone"
>
Tonalité de peau par défaut
</string>
<string
name=
"And_more"
>
et encore %1$d
</string>
<string
name=
"and"
>
et
</string>
<string
name=
"Reacted_with"
>
a réagi avec
</string>
<!-- Sorting and grouping-->
<string
name=
"menu_chatroom_sort"
>
Trier
</string>
...
...
app/src/main/res/values-ja/strings.xml
View file @
60f0c4d4
...
...
@@ -282,6 +282,9 @@
<!-- Emoji message-->
<string
name=
"msg_no_recent_emoji"
>
最近の絵文字はありません
</string>
<string
name=
"alert_title_default_skin_tone"
>
デフォルトスキントークン
</string>
<string
name=
"And_more"
>
さらに %1$d
</string>
<string
name=
"and"
>
と
</string>
<string
name=
"Reacted_with"
>
がリアクションしています
</string>
<!-- Sorting and grouping-->
<string
name=
"menu_chatroom_sort"
>
ソート
</string>
...
...
app/src/main/res/values-pt-rBR/strings.xml
View file @
60f0c4d4
...
...
@@ -278,6 +278,9 @@
<!-- Emoji message-->
<string
name=
"msg_no_recent_emoji"
>
Nenhum emoji recente
</string>
<string
name=
"alert_title_default_skin_tone"
>
Tom de pele padrão
</string>
<string
name=
"And_more"
>
E mais %1$d
</string>
<string
name=
"and"
>
e
</string>
<string
name=
"Reacted_with"
>
Reagiu com
</string>
<!-- Sorting and grouping-->
<string
name=
"menu_chatroom_sort"
>
Ordenar
</string>
...
...
app/src/main/res/values-ru-rRU/strings.xml
View file @
60f0c4d4
...
...
@@ -275,6 +275,9 @@
<!-- Emoji message-->
<string
name=
"msg_no_recent_emoji"
>
Пусто
</string>
<string
name=
"alert_title_default_skin_tone"
>
Тон кожи по умолчанию
</string>
<string
name=
"And_more"
>
И еще %1$d
</string>
<string
name=
"and"
>
и
</string>
<string
name=
"Reacted_with"
>
Реагирует с
</string>
<!-- Sorting and grouping-->
<string
name=
"menu_chatroom_sort"
>
Сортировать
</string>
...
...
app/src/main/res/values-tr/strings.xml
View file @
60f0c4d4
...
...
@@ -279,6 +279,9 @@
<!-- Emoji message-->
<string
name=
"msg_no_recent_emoji"
>
Son kullanılan emoji bulunmamaktadır
</string>
<string
name=
"alert_title_default_skin_tone"
>
Varsayılan tasarım tonu
</string>
<string
name=
"And_more"
>
Ve %1$d kadar daha fazla
</string>
<string
name=
"and"
>
ve
</string>
<string
name=
"Reacted_with"
>
ile reaksiyona sokulur
</string>
<!-- Sorting and grouping-->
<string
name=
"menu_chatroom_sort"
>
Sırala
</string>
...
...
app/src/main/res/values-uk/strings.xml
View file @
60f0c4d4
...
...
@@ -276,6 +276,9 @@
<!-- Emoji message-->
<string
name=
"msg_no_recent_emoji"
>
Пусто
</string>
<string
name=
"alert_title_default_skin_tone"
>
Тон шкіри за замовчуванням
</string>
<string
name=
"And_more"
>
І ще %1$d
</string>
<string
name=
"and"
>
і
</string>
<string
name=
"Reacted_with"
>
реагує з
</string>
<!-- Sorting and grouping-->
<string
name=
"menu_chatroom_sort"
>
Сортувати
</string>
...
...
app/src/main/res/values/strings.xml
View file @
60f0c4d4
...
...
@@ -292,6 +292,9 @@ https://github.com/RocketChat/java-code-styles/blob/master/CODING_STYLE.md#strin
<!-- Emoji message-->
<string
name=
"msg_no_recent_emoji"
>
No recent emojis
</string>
<string
name=
"alert_title_default_skin_tone"
>
Default skin tone
</string>
<string
name=
"And_more"
>
And %1$d more
</string>
<string
name=
"and"
>
and
</string>
<string
name=
"Reacted_with"
>
Reacted with
</string>
<!-- Sorting and grouping-->
<string
name=
"menu_chatroom_sort"
>
Sort
</string>
...
...
emoji/src/main/java/chat/rocket/android/emoji/EmojiReactionListener.kt
View file @
60f0c4d4
...
...
@@ -16,4 +16,12 @@ interface EmojiReactionListener {
* @param emojiShortname The shortname of the emoji (:grin:, :smiley:, etc).
*/
fun
onReactionTouched
(
messageId
:
String
,
emojiShortname
:
String
)
/**
* Callback when an added reaction is long-clicked.
*
* @param emojiShortname The shortname of the emoji (:grin:, :smiley:, etc).
* @param usernames The list of usernames of users who added the reaction.
*/
fun
onReactionLongClicked
(
emojiShortname
:
String
,
usernames
:
List
<
String
>)
}
\ No newline at end of file
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