Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xabber-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
xabber-android
Commits
ec6fd8d3
Commit
ec6fd8d3
authored
May 13, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Chat scroll to bottom disabled if it was scrolled up manually.
parent
b9f4d741
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
ChatViewerFragment.java
...c/main/java/com/xabber/android/ui/ChatViewerFragment.java
+10
-2
No files found.
app/src/main/java/com/xabber/android/ui/ChatViewerFragment.java
View file @
ec6fd8d3
...
...
@@ -77,6 +77,7 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
private
RecyclerView
recyclerView
;
private
View
contactTitleView
;
private
AbstractContact
abstractContact
;
private
LinearLayoutManager
layoutManager
;
public
static
ChatViewerFragment
newInstance
(
String
account
,
String
user
)
{
ChatViewerFragment
fragment
=
new
ChatViewerFragment
();
...
...
@@ -157,7 +158,7 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
recyclerView
=
(
RecyclerView
)
view
.
findViewById
(
R
.
id
.
chat_messages_recycler_view
);
recyclerView
.
setAdapter
(
chatMessageAdapter
);
LinearLayoutManager
layoutManager
=
new
LinearLayoutManager
(
getActivity
());
layoutManager
=
new
LinearLayoutManager
(
getActivity
());
layoutManager
.
setStackFromEnd
(
true
);
recyclerView
.
setLayoutManager
(
layoutManager
);
...
...
@@ -408,12 +409,19 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
public
void
updateChat
()
{
ContactTitleInflater
.
updateTitle
(
contactTitleView
,
getActivity
(),
abstractContact
);
int
itemCountBeforeUpdate
=
recyclerView
.
getAdapter
().
getItemCount
();
chatMessageAdapter
.
onChange
();
recyclerView
.
scrollToPosition
(
chatMessageAdapter
.
getItemCount
()
-
1
);
scrollChat
(
itemCountBeforeUpdate
);
setUpOptionsMenu
(
toolbar
.
getMenu
());
updateSecurityButton
();
}
private
void
scrollChat
(
int
itemCountBeforeUpdate
)
{
if
(
layoutManager
.
findLastVisibleItemPosition
()
==
(
itemCountBeforeUpdate
-
1
))
{
recyclerView
.
scrollToPosition
(
chatMessageAdapter
.
getItemCount
()
-
1
);
}
}
private
void
updateSecurityButton
()
{
SecurityLevel
securityLevel
=
OTRManager
.
getInstance
().
getSecurityLevel
(
account
,
user
);
securityButton
.
setImageLevel
(
securityLevel
.
getImageLevel
());
...
...
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