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
8b83d03d
Commit
8b83d03d
authored
Sep 13, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update RoomFragment.java
parent
95336773
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
5 deletions
+32
-5
RoomFragment.java
...a/chat/rocket/android/fragment/chatroom/RoomFragment.java
+32
-5
No files found.
app/src/main/java/chat/rocket/android/fragment/chatroom/RoomFragment.java
View file @
8b83d03d
...
...
@@ -11,6 +11,8 @@ import android.support.design.widget.Snackbar;
import
android.support.v13.view.inputmethod.InputConnectionCompat
;
import
android.support.v13.view.inputmethod.InputContentInfoCompat
;
import
android.support.v4.app.DialogFragment
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.app.FragmentTransaction
;
import
android.support.v4.os.BuildCompat
;
import
android.support.v4.util.Pair
;
import
android.support.v4.widget.SlidingPaneLayout
;
...
...
@@ -29,6 +31,7 @@ import chat.rocket.android.R;
import
chat.rocket.android.api.MethodCallHelper
;
import
chat.rocket.android.fragment.chatroom.dialog.FileUploadProgressDialogFragment
;
import
chat.rocket.android.fragment.chatroom.dialog.MessageOptionsDialogFragment
;
import
chat.rocket.android.fragment.chatroom.dialog.RoomDialogFragment
;
import
chat.rocket.android.fragment.sidebar.SidebarMainFragment
;
import
chat.rocket.android.helper.AbsoluteUrlHelper
;
import
chat.rocket.android.helper.FileUploadHelper
;
...
...
@@ -96,7 +99,11 @@ public class RoomFragment extends AbstractChatRoomFragment implements
private
static
final
String
ROOM_ID
=
"roomId"
;
private
String
hostname
;
private
String
token
;
private
String
userId
;
private
String
roomId
;
private
String
roomName
;
private
String
roomType
;
private
LoadMoreScrollListener
scrollListener
;
private
MessageFormManager
messageFormManager
;
private
RecyclerView
messageRecyclerView
;
...
...
@@ -313,16 +320,16 @@ public class RoomFragment extends AbstractChatRoomFragment implements
toolbar
.
setOnMenuItemClickListener
(
menuItem
->
{
switch
(
menuItem
.
getItemId
())
{
case
R
.
id
.
action_pinned_messages
:
// TODO
showRoomDialogFragment
(
R
.
id
.
action_pinned_messages
);
break
;
case
R
.
id
.
action_favorite_messages
:
// TODO
showRoomDialogFragment
(
R
.
id
.
action_favorite_messages
);
break
;
case
R
.
id
.
action_file_list
:
// TODO
showRoomDialogFragment
(
R
.
id
.
action_file_list
);
break
;
case
R
.
id
.
action_member_list
:
// TODO
showRoomDialogFragment
(
R
.
id
.
action_member_list
);
break
;
default
:
return
super
.
onOptionsItemSelected
(
menuItem
);
...
...
@@ -547,12 +554,16 @@ public class RoomFragment extends AbstractChatRoomFragment implements
@Override
public
void
setupWith
(
RocketChatAbsoluteUrl
rocketChatAbsoluteUrl
)
{
token
=
rocketChatAbsoluteUrl
.
getToken
();
userId
=
rocketChatAbsoluteUrl
.
getUserId
();
messageListAdapter
.
setAbsoluteUrl
(
rocketChatAbsoluteUrl
);
}
@Override
public
void
render
(
Room
room
)
{
setToolbarTitle
(
room
.
getName
());
roomName
=
room
.
getName
();
roomType
=
room
.
getType
();
setToolbarTitle
(
roomName
);
boolean
unreadMessageExists
=
room
.
isAlert
();
if
(
newMessageIndicatorManager
!=
null
&&
previousUnreadMessageExists
&&
!
unreadMessageExists
)
{
...
...
@@ -637,4 +648,20 @@ public class RoomFragment extends AbstractChatRoomFragment implements
edittingMessage
=
message
;
messageFormManager
.
setEditMessage
(
message
.
getMessage
());
}
private
void
showRoomDialogFragment
(
int
actionId
)
{
FragmentTransaction
fragmentTransaction
=
getFragmentManager
().
beginTransaction
();
Fragment
prev
=
getFragmentManager
().
findFragmentByTag
(
"roomDialogFragment"
);
if
(
prev
!=
null
)
{
fragmentTransaction
.
remove
(
prev
);
}
fragmentTransaction
.
addToBackStack
(
null
);
DialogFragment
roomDialogFragment
=
RoomDialogFragment
.
Companion
.
newInstance
(
roomId
,
roomName
,
roomType
,
hostname
,
token
,
userId
,
actionId
);
roomDialogFragment
.
show
(
fragmentTransaction
,
"roomDialogFragment"
);
}
}
\ 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