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
894b61ec
Commit
894b61ec
authored
Aug 24, 2018
by
Shailesh Baldaniya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Indentation and nullability
parent
ee657f5b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
37 deletions
+30
-37
ChatRoomAdapter.kt
...a/chat/rocket/android/chatroom/adapter/ChatRoomAdapter.kt
+6
-9
ChatRoomFragment.kt
.../java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
+5
-9
ActionsAttachmentUiModel.kt
...cket/android/chatroom/uimodel/ActionsAttachmentUiModel.kt
+19
-19
No files found.
app/src/main/java/chat/rocket/android/chatroom/adapter/ChatRoomAdapter.kt
View file @
894b61ec
package
chat.rocket.android.chatroom.adapter
package
chat.rocket.android.chatroom.adapter
import
android.app.AlertDialog
import
android.content.Context
import
android.net.Uri
import
androidx.recyclerview.widget.RecyclerView
import
androidx.recyclerview.widget.RecyclerView
import
android.view.MenuItem
import
android.view.MenuItem
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
chat.rocket.android.R
import
chat.rocket.android.R
import
chat.rocket.android.chatroom.presentation.ChatRoomPresenter
import
chat.rocket.android.chatroom.uimodel.*
import
chat.rocket.android.chatroom.uimodel.*
import
chat.rocket.android.util.extensions.inflate
import
chat.rocket.android.util.extensions.inflate
import
chat.rocket.android.emoji.EmojiReactionListener
import
chat.rocket.android.emoji.EmojiReactionListener
...
@@ -219,19 +215,19 @@ class ChatRoomAdapter(
...
@@ -219,19 +215,19 @@ class ChatRoomAdapter(
override
fun
onActionClicked
(
view
:
View
,
action
:
Action
)
{
override
fun
onActionClicked
(
view
:
View
,
action
:
Action
)
{
val
temp
=
action
as
ButtonAction
val
temp
=
action
as
ButtonAction
if
(
temp
.
url
!=
null
&&
temp
.
isWebView
!=
null
)
{
if
(
temp
.
url
!=
null
&&
temp
.
isWebView
!=
null
)
{
if
(
temp
.
isWebView
!!
)
{
if
(
temp
.
isWebView
==
true
)
{
//TODO: Open in a configurable sizable webview
//TODO: Open in a configurable sizable webview
Timber
.
d
(
"Open in a configurable sizable webview"
)
Timber
.
d
(
"Open in a configurable sizable webview"
)
}
else
{
}
else
{
//Open in chrome custom tab
//Open in chrome custom tab
view
.
openTabbedUrl
(
Uri
.
parse
(
temp
.
url
))
temp
.
url
?.
let
{
view
.
openTabbedUrl
(
it
)
}
}
}
}
else
if
(
temp
.
message
!=
null
&&
temp
.
isMessageInChatWindow
!=
null
)
{
}
else
if
(
temp
.
message
!=
null
&&
temp
.
isMessageInChatWindow
!=
null
)
{
if
(
temp
.
isMessageInChatWindow
!!
)
{
if
(
temp
.
isMessageInChatWindow
==
true
)
{
//Send to chat window
//Send to chat window
temp
.
message
.
run
{
temp
.
message
?.
let
{
if
(
roomId
!=
null
)
{
if
(
roomId
!=
null
)
{
presenter
?.
sendMessage
(
roomId
,
temp
.
message
!!
,
null
)
actionSelectListener
?.
sendMessage
(
roomId
,
it
)
}
}
}
}
}
else
{
}
else
{
...
@@ -298,5 +294,6 @@ class ChatRoomAdapter(
...
@@ -298,5 +294,6 @@ class ChatRoomAdapter(
fun
deleteMessage
(
roomId
:
String
,
id
:
String
)
fun
deleteMessage
(
roomId
:
String
,
id
:
String
)
fun
showReactions
(
id
:
String
)
fun
showReactions
(
id
:
String
)
fun
openDirectMessage
(
roomName
:
String
,
message
:
String
)
fun
openDirectMessage
(
roomName
:
String
,
message
:
String
)
fun
sendMessage
(
chatRoomId
:
String
,
text
:
String
)
}
}
}
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
View file @
894b61ec
...
@@ -202,7 +202,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
...
@@ -202,7 +202,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
requireNotNull
(
bundle
)
{
"no arguments supplied when the fragment was instantiated"
}
requireNotNull
(
bundle
)
{
"no arguments supplied when the fragment was instantiated"
}
}
}
adapter
=
ChatRoomAdapter
(
chatRoomType
,
chatRoomName
,
this
,
adapter
=
ChatRoomAdapter
(
chatRoom
Id
,
chatRoom
Type
,
chatRoomName
,
this
,
reactionListener
=
this
)
reactionListener
=
this
)
}
}
...
@@ -339,14 +339,6 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
...
@@ -339,14 +339,6 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
}
}
if
(
recycler_view
.
adapter
==
null
)
{
if
(
recycler_view
.
adapter
==
null
)
{
adapter
=
ChatRoomAdapter
(
chatRoomId
,
chatRoomType
,
chatRoomName
,
presenter
,
reactionListener
=
this
@ChatRoomFragment
,
context
=
context
)
recycler_view
.
adapter
=
adapter
recycler_view
.
adapter
=
adapter
if
(
dataSet
.
size
>=
30
)
{
if
(
dataSet
.
size
>=
30
)
{
recycler_view
.
addOnScrollListener
(
endlessRecyclerViewScrollListener
)
recycler_view
.
addOnScrollListener
(
endlessRecyclerViewScrollListener
)
...
@@ -1023,4 +1015,8 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
...
@@ -1023,4 +1015,8 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
override
fun
openDirectMessage
(
roomName
:
String
,
message
:
String
)
{
override
fun
openDirectMessage
(
roomName
:
String
,
message
:
String
)
{
presenter
.
openDirectMessage
(
roomName
,
message
)
presenter
.
openDirectMessage
(
roomName
,
message
)
}
}
override
fun
sendMessage
(
chatRoomId
:
String
,
text
:
String
)
{
presenter
.
sendMessage
(
chatRoomId
,
text
,
null
)
}
}
}
app/src/main/java/chat/rocket/android/chatroom/uimodel/ActionsAttachmentUiModel.kt
View file @
894b61ec
...
@@ -6,24 +6,24 @@ import chat.rocket.core.model.attachment.actions.Action
...
@@ -6,24 +6,24 @@ import chat.rocket.core.model.attachment.actions.Action
import
chat.rocket.core.model.attachment.actions.ActionsAttachment
import
chat.rocket.core.model.attachment.actions.ActionsAttachment
data class
ActionsAttachmentUiModel
(
data class
ActionsAttachmentUiModel
(
override
val
attachmentUrl
:
String
,
override
val
attachmentUrl
:
String
,
val
title
:
String
?,
val
title
:
String
?,
val
actions
:
List
<
Action
>,
val
actions
:
List
<
Action
>,
val
buttonAlignment
:
String
,
val
buttonAlignment
:
String
,
override
val
message
:
Message
,
override
val
message
:
Message
,
override
val
rawData
:
ActionsAttachment
,
override
val
rawData
:
ActionsAttachment
,
override
val
messageId
:
String
,
override
val
messageId
:
String
,
override
var
reactions
:
List
<
ReactionUiModel
>,
override
var
reactions
:
List
<
ReactionUiModel
>,
override
var
nextDownStreamMessage
:
BaseUiModel
<*>?
=
null
,
override
var
nextDownStreamMessage
:
BaseUiModel
<*>?
=
null
,
override
var
preview
:
Message
?
=
null
,
override
var
preview
:
Message
?
=
null
,
override
var
isTemporary
:
Boolean
=
false
,
override
var
isTemporary
:
Boolean
=
false
,
override
var
unread
:
Boolean
?
=
null
,
override
var
unread
:
Boolean
?
=
null
,
override
var
menuItemsToHide
:
MutableList
<
Int
>
=
mutableListOf
(),
override
var
menuItemsToHide
:
MutableList
<
Int
>
=
mutableListOf
(),
override
var
currentDayMarkerText
:
String
,
override
var
currentDayMarkerText
:
String
,
override
var
showDayMarker
:
Boolean
override
var
showDayMarker
:
Boolean
)
:
BaseAttachmentUiModel
<
ActionsAttachment
>
{
)
:
BaseAttachmentUiModel
<
ActionsAttachment
>
{
override
val
viewType
:
Int
override
val
viewType
:
Int
get
()
=
BaseUiModel
.
ViewType
.
ACTIONS_ATTACHMENT
.
viewType
get
()
=
BaseUiModel
.
ViewType
.
ACTIONS_ATTACHMENT
.
viewType
override
val
layoutId
:
Int
override
val
layoutId
:
Int
get
()
=
R
.
layout
.
item_actions_attachment
get
()
=
R
.
layout
.
item_actions_attachment
}
}
\ 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