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
59a8a6e5
Commit
59a8a6e5
authored
Feb 09, 2018
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove serverUrl param from PinnedMessagesAdapter
parent
5a4563c1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
9 deletions
+6
-9
PinnedMessagesView.kt
...ocket/android/chatroom/presentation/PinnedMessagesView.kt
+1
-2
PinnedMessagesAdapter.kt
.../chat/rocket/android/chatroom/ui/PinnedMessagesAdapter.kt
+3
-4
PinnedMessagesFragment.kt
...chat/rocket/android/chatroom/ui/PinnedMessagesFragment.kt
+2
-3
No files found.
app/src/main/java/chat/rocket/android/chatroom/presentation/PinnedMessagesView.kt
View file @
59a8a6e5
...
...
@@ -10,7 +10,6 @@ interface PinnedMessagesView : MessageView, LoadingView {
* Show list of pinned messages for the current room.
*
* @param pinnedMessages The list of pinned messages.
* @param serverUrl The url of the current server.
*/
fun
showPinnedMessages
(
pinnedMessages
:
List
<
MessageViewModel
>
,
serverUrl
:
String
)
fun
showPinnedMessages
(
pinnedMessages
:
List
<
MessageViewModel
>)
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/chatroom/ui/PinnedMessagesAdapter.kt
View file @
59a8a6e5
...
...
@@ -20,7 +20,7 @@ import kotlinx.android.synthetic.main.avatar.view.*
import
kotlinx.android.synthetic.main.item_message.view.*
import
kotlinx.android.synthetic.main.message_attachment.view.*
class
PinnedMessagesAdapter
(
private
val
serverUrl
:
String
)
:
RecyclerView
.
Adapter
<
PinnedMessagesAdapter
.
ViewHolder
>()
{
class
PinnedMessagesAdapter
:
RecyclerView
.
Adapter
<
PinnedMessagesAdapter
.
ViewHolder
>()
{
init
{
setHasStableIds
(
true
)
...
...
@@ -29,7 +29,7 @@ class PinnedMessagesAdapter(private val serverUrl: String) : RecyclerView.Adapte
val
dataSet
=
ArrayList
<
MessageViewModel
>()
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
ViewHolder
=
ViewHolder
(
parent
.
inflate
(
R
.
layout
.
item_message
)
,
serverUrl
)
ViewHolder
(
parent
.
inflate
(
R
.
layout
.
item_message
))
override
fun
onBindViewHolder
(
holder
:
ViewHolder
,
position
:
Int
)
=
holder
.
bind
(
dataSet
[
position
])
...
...
@@ -72,8 +72,7 @@ class PinnedMessagesAdapter(private val serverUrl: String) : RecyclerView.Adapte
return
dataSet
[
position
].
id
.
hashCode
().
toLong
()
}
class
ViewHolder
(
itemView
:
View
,
val
serverUrl
:
String
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
class
ViewHolder
(
itemView
:
View
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
private
lateinit
var
messageViewModel
:
MessageViewModel
...
...
app/src/main/java/chat/rocket/android/chatroom/ui/PinnedMessagesFragment.kt
View file @
59a8a6e5
...
...
@@ -8,7 +8,6 @@ import android.support.v7.widget.RecyclerView
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.Toast
import
chat.rocket.android.R
import
chat.rocket.android.chatroom.presentation.PinnedMessagesPresenter
import
chat.rocket.android.chatroom.presentation.PinnedMessagesView
...
...
@@ -72,10 +71,10 @@ class PinnedMessagesFragment : Fragment(), PinnedMessagesView {
override
fun
showGenericErrorMessage
()
=
showMessage
(
getString
(
R
.
string
.
msg_generic_error
))
override
fun
showPinnedMessages
(
pinnedMessages
:
List
<
MessageViewModel
>
,
serverUrl
:
String
)
{
override
fun
showPinnedMessages
(
pinnedMessages
:
List
<
MessageViewModel
>)
{
activity
?.
apply
{
if
(
recycler_view_pinned
.
adapter
==
null
)
{
adapter
=
PinnedMessagesAdapter
(
serverUrl
)
adapter
=
PinnedMessagesAdapter
()
recycler_view_pinned
.
adapter
=
adapter
val
linearLayoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
false
)
recycler_view_pinned
.
layoutManager
=
linearLayoutManager
...
...
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