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
e344e3c0
Commit
e344e3c0
authored
Apr 30, 2018
by
Lucio Maciel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve long tap area on messages
parent
c176e9fe
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
18 additions
and
15 deletions
+18
-15
AudioAttachmentViewHolder.kt
...ket/android/chatroom/adapter/AudioAttachmentViewHolder.kt
+1
-2
AuthorAttachmentViewHolder.kt
...et/android/chatroom/adapter/AuthorAttachmentViewHolder.kt
+0
-3
BaseViewHolder.kt
...va/chat/rocket/android/chatroom/adapter/BaseViewHolder.kt
+10
-1
ColorAttachmentViewHolder.kt
...ket/android/chatroom/adapter/ColorAttachmentViewHolder.kt
+0
-1
GenericFileAttachmentViewHolder.kt
...droid/chatroom/adapter/GenericFileAttachmentViewHolder.kt
+0
-2
ImageAttachmentViewHolder.kt
...ket/android/chatroom/adapter/ImageAttachmentViewHolder.kt
+0
-1
MessageAttachmentViewHolder.kt
...t/android/chatroom/adapter/MessageAttachmentViewHolder.kt
+2
-2
MessageViewHolder.kt
...chat/rocket/android/chatroom/adapter/MessageViewHolder.kt
+1
-1
VideoAttachmentViewHolder.kt
...ket/android/chatroom/adapter/VideoAttachmentViewHolder.kt
+1
-2
item_chat.xml
app/src/main/res/layout/item_chat.xml
+1
-0
item_message.xml
app/src/main/res/layout/item_message.xml
+1
-0
item_message_attachment.xml
app/src/main/res/layout/item_message_attachment.xml
+1
-0
No files found.
app/src/main/java/chat/rocket/android/chatroom/adapter/AudioAttachmentViewHolder.kt
View file @
e344e3c0
...
@@ -14,10 +14,9 @@ class AudioAttachmentViewHolder(itemView: View,
...
@@ -14,10 +14,9 @@ class AudioAttachmentViewHolder(itemView: View,
init
{
init
{
with
(
itemView
)
{
with
(
itemView
)
{
setupActionMenu
(
attachment_container
)
image_attachment
.
setVisible
(
false
)
image_attachment
.
setVisible
(
false
)
audio_video_attachment
.
setVisible
(
true
)
audio_video_attachment
.
setVisible
(
true
)
setupActionMenu
(
attachment_container
)
setupActionMenu
(
audio_video_attachment
)
}
}
}
}
...
...
app/src/main/java/chat/rocket/android/chatroom/adapter/AuthorAttachmentViewHolder.kt
View file @
e344e3c0
...
@@ -19,12 +19,9 @@ class AuthorAttachmentViewHolder(itemView: View,
...
@@ -19,12 +19,9 @@ class AuthorAttachmentViewHolder(itemView: View,
init
{
init
{
with
(
itemView
)
{
with
(
itemView
)
{
setupActionMenu
(
author_attachment_container
)
setupActionMenu
(
author_attachment_container
)
setupActionMenu
(
text_fields
)
setupActionMenu
(
text_author_name
)
}
}
}
}
override
fun
bindViews
(
data
:
AuthorAttachmentViewModel
)
{
override
fun
bindViews
(
data
:
AuthorAttachmentViewModel
)
{
with
(
itemView
)
{
with
(
itemView
)
{
data
.
icon
?.
let
{
icon
->
data
.
icon
?.
let
{
icon
->
...
...
app/src/main/java/chat/rocket/android/chatroom/adapter/BaseViewHolder.kt
View file @
e344e3c0
...
@@ -3,6 +3,8 @@ package chat.rocket.android.chatroom.adapter
...
@@ -3,6 +3,8 @@ package chat.rocket.android.chatroom.adapter
import
android.support.v7.widget.RecyclerView
import
android.support.v7.widget.RecyclerView
import
android.view.MenuItem
import
android.view.MenuItem
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
androidx.core.view.children
import
chat.rocket.android.R
import
chat.rocket.android.R
import
chat.rocket.android.chatroom.ui.bottomsheet.BottomSheetMenu
import
chat.rocket.android.chatroom.ui.bottomsheet.BottomSheetMenu
import
chat.rocket.android.chatroom.ui.bottomsheet.adapter.ActionListAdapter
import
chat.rocket.android.chatroom.ui.bottomsheet.adapter.ActionListAdapter
...
@@ -74,7 +76,7 @@ abstract class BaseViewHolder<T : BaseViewModel<*>>(
...
@@ -74,7 +76,7 @@ abstract class BaseViewHolder<T : BaseViewModel<*>>(
fun
onActionSelected
(
item
:
MenuItem
,
message
:
Message
)
fun
onActionSelected
(
item
:
MenuItem
,
message
:
Message
)
}
}
val
longClickListener
=
{
view
:
View
->
private
val
longClickListener
=
{
view
:
View
->
if
(
data
?.
message
?.
isSystemMessage
()
==
false
)
{
if
(
data
?.
message
?.
isSystemMessage
()
==
false
)
{
val
menuItems
=
view
.
context
.
inflate
(
R
.
menu
.
message_actions
).
toList
()
val
menuItems
=
view
.
context
.
inflate
(
R
.
menu
.
message_actions
).
toList
()
menuItems
.
find
{
it
.
itemId
==
R
.
id
.
action_menu_msg_pin_unpin
}
?.
apply
{
menuItems
.
find
{
it
.
itemId
==
R
.
id
.
action_menu_msg_pin_unpin
}
?.
apply
{
...
@@ -90,6 +92,13 @@ abstract class BaseViewHolder<T : BaseViewModel<*>>(
...
@@ -90,6 +92,13 @@ abstract class BaseViewHolder<T : BaseViewModel<*>>(
internal
fun
setupActionMenu
(
view
:
View
)
{
internal
fun
setupActionMenu
(
view
:
View
)
{
if
(
listener
.
isActionsEnabled
())
{
if
(
listener
.
isActionsEnabled
())
{
if
(
view
is
ViewGroup
)
{
for
(
child
in
view
.
children
)
{
if
(
child
!
is
RecyclerView
&&
child
.
id
!=
R
.
id
.
recycler_view_reactions
)
{
setupActionMenu
(
child
)
}
}
}
view
.
setOnLongClickListener
(
longClickListener
)
view
.
setOnLongClickListener
(
longClickListener
)
}
}
}
}
...
...
app/src/main/java/chat/rocket/android/chatroom/adapter/ColorAttachmentViewHolder.kt
View file @
e344e3c0
...
@@ -20,7 +20,6 @@ class ColorAttachmentViewHolder(itemView: View,
...
@@ -20,7 +20,6 @@ class ColorAttachmentViewHolder(itemView: View,
init
{
init
{
with
(
itemView
)
{
with
(
itemView
)
{
setupActionMenu
(
attachment_text
)
setupActionMenu
(
color_attachment_container
)
setupActionMenu
(
color_attachment_container
)
attachment_text
.
movementMethod
=
LinkMovementMethod
()
attachment_text
.
movementMethod
=
LinkMovementMethod
()
}
}
...
...
app/src/main/java/chat/rocket/android/chatroom/adapter/GenericFileAttachmentViewHolder.kt
View file @
e344e3c0
...
@@ -17,11 +17,9 @@ class GenericFileAttachmentViewHolder(itemView: View,
...
@@ -17,11 +17,9 @@ class GenericFileAttachmentViewHolder(itemView: View,
init
{
init
{
with
(
itemView
)
{
with
(
itemView
)
{
setupActionMenu
(
file_attachment_container
)
setupActionMenu
(
file_attachment_container
)
setupActionMenu
(
text_file_name
)
}
}
}
}
override
fun
bindViews
(
data
:
GenericFileAttachmentViewModel
)
{
override
fun
bindViews
(
data
:
GenericFileAttachmentViewModel
)
{
with
(
itemView
)
{
with
(
itemView
)
{
text_file_name
.
content
=
data
.
attachmentTitle
text_file_name
.
content
=
data
.
attachmentTitle
...
...
app/src/main/java/chat/rocket/android/chatroom/adapter/ImageAttachmentViewHolder.kt
View file @
e344e3c0
...
@@ -47,7 +47,6 @@ class ImageAttachmentViewHolder(itemView: View,
...
@@ -47,7 +47,6 @@ class ImageAttachmentViewHolder(itemView: View,
init
{
init
{
with
(
itemView
)
{
with
(
itemView
)
{
setupActionMenu
(
attachment_container
)
setupActionMenu
(
attachment_container
)
setupActionMenu
(
image_attachment
)
}
}
}
}
...
...
app/src/main/java/chat/rocket/android/chatroom/adapter/MessageAttachmentViewHolder.kt
View file @
e344e3c0
...
@@ -4,7 +4,7 @@ import android.text.method.LinkMovementMethod
...
@@ -4,7 +4,7 @@ import android.text.method.LinkMovementMethod
import
android.view.View
import
android.view.View
import
chat.rocket.android.chatroom.viewmodel.MessageAttachmentViewModel
import
chat.rocket.android.chatroom.viewmodel.MessageAttachmentViewModel
import
chat.rocket.android.widget.emoji.EmojiReactionListener
import
chat.rocket.android.widget.emoji.EmojiReactionListener
import
kotlinx.android.synthetic.main.item_message.view.*
import
kotlinx.android.synthetic.main.item_message
_attachment
.view.*
class
MessageAttachmentViewHolder
(
class
MessageAttachmentViewHolder
(
itemView
:
View
,
itemView
:
View
,
...
@@ -14,8 +14,8 @@ class MessageAttachmentViewHolder(
...
@@ -14,8 +14,8 @@ class MessageAttachmentViewHolder(
init
{
init
{
with
(
itemView
)
{
with
(
itemView
)
{
setupActionMenu
(
attachment_container
)
text_content
.
movementMethod
=
LinkMovementMethod
()
text_content
.
movementMethod
=
LinkMovementMethod
()
setupActionMenu
(
text_content
)
}
}
}
}
...
...
app/src/main/java/chat/rocket/android/chatroom/adapter/MessageViewHolder.kt
View file @
e344e3c0
...
@@ -16,8 +16,8 @@ class MessageViewHolder(
...
@@ -16,8 +16,8 @@ class MessageViewHolder(
init
{
init
{
with
(
itemView
)
{
with
(
itemView
)
{
setupActionMenu
(
message_container
)
text_content
.
movementMethod
=
LinkMovementMethod
()
text_content
.
movementMethod
=
LinkMovementMethod
()
setupActionMenu
(
text_content
)
}
}
}
}
...
...
app/src/main/java/chat/rocket/android/chatroom/adapter/VideoAttachmentViewHolder.kt
View file @
e344e3c0
...
@@ -14,10 +14,9 @@ class VideoAttachmentViewHolder(itemView: View,
...
@@ -14,10 +14,9 @@ class VideoAttachmentViewHolder(itemView: View,
init
{
init
{
with
(
itemView
)
{
with
(
itemView
)
{
setupActionMenu
(
attachment_container
)
image_attachment
.
setVisible
(
false
)
image_attachment
.
setVisible
(
false
)
audio_video_attachment
.
setVisible
(
true
)
audio_video_attachment
.
setVisible
(
true
)
setupActionMenu
(
attachment_container
)
setupActionMenu
(
audio_video_attachment
)
}
}
}
}
...
...
app/src/main/res/layout/item_chat.xml
View file @
e344e3c0
...
@@ -58,6 +58,7 @@
...
@@ -58,6 +58,7 @@
android:ellipsize=
"end"
android:ellipsize=
"end"
android:maxLines=
"2"
android:maxLines=
"2"
android:textDirection=
"locale"
android:textDirection=
"locale"
tools:visibility=
"visible"
app:layout_constraintEnd_toStartOf=
"@+id/layout_unread_messages_badge"
app:layout_constraintEnd_toStartOf=
"@+id/layout_unread_messages_badge"
app:layout_constraintStart_toStartOf=
"@+id/image_chat_icon"
app:layout_constraintStart_toStartOf=
"@+id/image_chat_icon"
app:layout_constraintTop_toBottomOf=
"@+id/text_chat_name"
app:layout_constraintTop_toBottomOf=
"@+id/text_chat_name"
...
...
app/src/main/res/layout/item_message.xml
View file @
e344e3c0
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
<android.support.constraint.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<android.support.constraint.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/message_container"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"?android:attr/selectableItemBackground"
android:background=
"?android:attr/selectableItemBackground"
...
...
app/src/main/res/layout/item_message_attachment.xml
View file @
e344e3c0
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
<android.support.constraint.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<android.support.constraint.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/attachment_container"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"?android:attr/selectableItemBackground"
android:background=
"?android:attr/selectableItemBackground"
...
...
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