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
3c0c1303
Commit
3c0c1303
authored
Sep 13, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update RoomDialogFragment.kt
parent
5a668a4f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
12 deletions
+44
-12
RoomDialogFragment.kt
...et/android/fragment/chatroom/dialog/RoomDialogFragment.kt
+44
-12
No files found.
app/src/main/java/chat/rocket/android/fragment/chatroom/dialog/RoomDialogFragment.kt
View file @
3c0c1303
...
...
@@ -2,12 +2,16 @@ package chat.rocket.android.fragment.chatroom.dialog
import
android.os.Bundle
import
android.support.v4.app.DialogFragment
import
android.support.v7.widget.LinearLayoutManager
import
android.support.v7.widget.RecyclerView
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.ImageButton
import
android.widget.TextView
import
chat.rocket.android.R
import
chat.rocket.android.layouthelper.chatroom.dialog.RoomFileListAdapter
import
chat.rocket.android.layouthelper.chatroom.dialog.RoomMemberListAdapter
/**
* Displays a dialog containing pinned messages, favorite messages, file list or member list of a room.
...
...
@@ -20,13 +24,19 @@ class RoomDialogFragment : DialogFragment(), RoomDialogContract.View {
lateinit
var
token
:
String
lateinit
var
userId
:
String
private
var
actionId
:
Int
=
0
lateinit
var
closeButton
:
ImageButton
lateinit
var
fileListRecyclerView
:
RecyclerView
private
lateinit
var
closeButton
:
ImageButton
lateinit
var
messageText
:
TextView
lateinit
var
recyclerView
:
RecyclerView
lateinit
var
presenter
:
RoomDialogContract
.
Presenter
companion
object
{
fun
newInstance
(
roomId
:
String
,
roomName
:
String
,
roomType
:
String
,
hostname
:
String
,
token
:
String
,
userId
:
String
,
actionId
:
Int
):
RoomDialogFragment
{
fun
newInstance
(
roomId
:
String
,
roomName
:
String
,
roomType
:
String
,
hostname
:
String
,
token
:
String
,
userId
:
String
,
actionId
:
Int
):
RoomDialogFragment
{
val
args
=
Bundle
()
args
.
putString
(
"roomId"
,
roomId
)
args
.
putString
(
"roomName"
,
roomName
)
...
...
@@ -55,11 +65,12 @@ class RoomDialogFragment : DialogFragment(), RoomDialogContract.View {
}
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?):
View
?
{
val
view
=
inflater
.
inflate
(
R
.
layout
.
dialog_room
_file_list
,
container
,
false
)
val
view
=
inflater
.
inflate
(
R
.
layout
.
dialog_room
,
container
,
false
)
messageText
=
view
.
findViewById
(
R
.
id
.
text_message
)
closeButton
=
view
.
findViewById
(
R
.
id
.
button_close
)
closeButton
.
setOnClickListener
{
dismissDialogFragment
()
}
fileListRecyclerView
=
view
.
findViewById
(
R
.
id
.
recycler_view_file_list
)
recyclerView
=
view
.
findViewById
(
R
.
id
.
recycler_view
)
presenter
=
RoomDialogPresenter
(
context
,
this
)
...
...
@@ -72,19 +83,40 @@ class RoomDialogFragment : DialogFragment(), RoomDialogContract.View {
}
override
fun
showPinnedMessages
()
{
// fileListRecyclerView.adapter = RoomFileListAdapter(dataSet)
// fileListRecyclerView.layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, true)
// TODO("not implemented")
}
override
fun
showFavoriteMessages
()
{
TODO
(
"not implemented"
)
//To change body of created functions use File | Settings | File Templates.
// TODO("not implemented")
}
override
fun
showFileList
()
{
override
fun
showFileList
(
dataSet
:
ArrayList
<
String
>)
{
activity
.
runOnUiThread
({
if
(
dataSet
.
isEmpty
())
{
// TODO("move to strings.xml")
showMessage
(
"None file to show"
)
}
else
{
recyclerView
.
adapter
=
RoomFileListAdapter
(
dataSet
)
recyclerView
.
layoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
true
)
}
})
}
override
fun
showMemberList
(
dataSet
:
ArrayList
<
String
>)
{
activity
.
runOnUiThread
({
if
(
dataSet
.
isEmpty
())
{
// TODO("move to strings.xml")
showMessage
(
"None member to show"
)
}
else
{
recyclerView
.
adapter
=
RoomMemberListAdapter
(
dataSet
)
recyclerView
.
layoutManager
=
LinearLayoutManager
(
context
,
LinearLayoutManager
.
VERTICAL
,
true
)
}
})
}
override
fun
showMemberList
()
{
TODO
(
"not implemented"
)
//To change body of created functions use File | Settings | File Templates.
override
fun
showMessage
(
message
:
String
)
{
messageText
.
text
=
message
messageText
.
visibility
=
View
.
VISIBLE
}
private
fun
dismissDialogFragment
()
{
...
...
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