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
40004009
Commit
40004009
authored
Jul 30, 2018
by
Shailesh Baldaniya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Errors after cherrypick
parent
8266b7d2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
8 deletions
+28
-8
ChatRoomAdapter.kt
...a/chat/rocket/android/chatroom/adapter/ChatRoomAdapter.kt
+17
-6
ActionsAttachmentUiModel.kt
...cket/android/chatroom/uimodel/ActionsAttachmentUiModel.kt
+5
-1
UiModelMapper.kt
...ava/chat/rocket/android/chatroom/uimodel/UiModelMapper.kt
+5
-1
item_action_button.xml
app/src/main/res/layout/item_action_button.xml
+1
-0
No files found.
app/src/main/java/chat/rocket/android/chatroom/adapter/ChatRoomAdapter.kt
View file @
40004009
...
...
@@ -2,17 +2,19 @@ package chat.rocket.android.chatroom.adapter
import
android.app.AlertDialog
import
android.content.Context
import
android.net.Uri
import
androidx.recyclerview.widget.RecyclerView
import
android.view.MenuItem
import
android.view.ViewGroup
import
android.widget.Toast
import
androidx.browser.customtabs.CustomTabsIntent
import
androidx.core.content.res.ResourcesCompat
import
chat.rocket.android.R
import
chat.rocket.android.chatroom.presentation.ChatRoomPresenter
import
chat.rocket.android.chatroom.uimodel.*
import
chat.rocket.android.customtab.CustomTab
import
chat.rocket.android.customtab.WebViewFallback
import
chat.rocket.android.util.extensions.inflate
import
chat.rocket.android.emoji.EmojiReactionListener
import
chat.rocket.android.
helper.ToastHelper
import
chat.rocket.android.
util.extensions.openTabbedUrl
import
chat.rocket.core.model.attachment.actions.Action
import
chat.rocket.core.model.attachment.actions.ButtonAction
import
chat.rocket.core.model.Message
...
...
@@ -222,10 +224,19 @@ class ChatRoomAdapter(
if
(
temp
.
url
!=
null
&&
temp
.
isWebView
!=
null
)
{
if
(
temp
.
isWebView
!!
)
{
//Open in a configurable sizable webview
Toast
Helper
.
showCustomToast
(
this
@ChatRoomAdapter
.
context
,
"Open in a configurable sizable webview"
)
Toast
.
makeText
(
context
,
"Open in a configurable sizable webview"
,
Toast
.
LENGTH_SHORT
).
show
(
)
}
else
{
//Open in chrome custom tab
CustomTab
.
openCustomTab
(
this
@ChatRoomAdapter
.
context
!!
,
temp
.
url
!!
,
WebViewFallback
())
with
(
this
)
{
val
customTabsBuilder
=
CustomTabsIntent
.
Builder
()
customTabsBuilder
.
setToolbarColor
(
ResourcesCompat
.
getColor
(
context
!!
.
resources
,
R
.
color
.
colorPrimary
,
context
.
theme
))
val
customTabsIntent
=
customTabsBuilder
.
build
()
try
{
customTabsIntent
.
launchUrl
(
context
,
Uri
.
parse
(
temp
.
url
!!
))
}
catch
(
ex
:
Exception
)
{
Timber
.
d
(
ex
,
"Unable to launch URL"
)
}
}
}
}
else
if
(
temp
.
message
!=
null
&&
temp
.
isMessageInChatWindow
!=
null
)
{
if
(
temp
.
isMessageInChatWindow
!!
)
{
...
...
@@ -237,7 +248,7 @@ class ChatRoomAdapter(
}
}
else
{
//Send to bot but not in chat window
Toast
Helper
.
showCustomToast
(
this
@ChatRoomAdapter
.
context
,
"Send to bot but not in chat window"
)
Toast
.
makeText
(
context
,
"Send to bot but not in chat window"
,
Toast
.
LENGTH_SHORT
).
show
(
)
}
}
}
...
...
app/src/main/java/chat/rocket/android/chatroom/uimodel/ActionsAttachmentUiModel.kt
View file @
40004009
...
...
@@ -15,7 +15,11 @@ data class ActionsAttachmentUiModel(
override
var
reactions
:
List
<
ReactionUiModel
>,
override
var
nextDownStreamMessage
:
BaseUiModel
<*>?
=
null
,
override
var
preview
:
Message
?
=
null
,
override
var
isTemporary
:
Boolean
=
false
override
var
isTemporary
:
Boolean
=
false
,
override
var
unread
:
Boolean
?
=
null
,
override
var
menuItemsToHide
:
MutableList
<
Int
>
=
mutableListOf
(),
override
var
currentDayMarkerText
:
String
,
override
var
showDayMarker
:
Boolean
)
:
BaseAttachmentUiModel
<
ActionsAttachment
>
{
override
val
viewType
:
Int
get
()
=
BaseUiModel
.
ViewType
.
ACTIONS_ATTACHMENT
.
viewType
...
...
app/src/main/java/chat/rocket/android/chatroom/uimodel/UiModelMapper.kt
View file @
40004009
...
...
@@ -315,10 +315,14 @@ class UiModelMapper @Inject constructor(
return
with
(
attachment
)
{
val
content
=
stripMessageQuotes
(
message
)
val
localDateTime
=
DateTimeHelper
.
getLocalDateTime
(
message
.
timestamp
)
val
dayMarkerText
=
DateTimeHelper
.
getFormattedDateForMessages
(
localDateTime
,
context
)
ActionsAttachmentUiModel
(
attachmentUrl
=
url
,
title
=
title
,
actions
=
actions
,
message
=
message
,
rawData
=
attachment
,
messageId
=
message
.
id
,
reactions
=
getReactions
(
message
),
preview
=
message
.
copy
(
message
=
content
.
message
))
preview
=
message
.
copy
(
message
=
content
.
message
),
unread
=
message
.
unread
,
showDayMarker
=
false
,
currentDayMarkerText
=
dayMarkerText
)
}
}
...
...
app/src/main/res/layout/item_action_button.xml
View file @
40004009
...
...
@@ -9,6 +9,7 @@
style=
"@style/Widget.MaterialComponents.Button"
android:id=
"@+id/action_button"
android:textSize=
"12sp"
android:textAppearance=
"@style/TextAppearance.AppCompat.Body2"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
...
...
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