Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-android
Commits
fb9f243c
Commit
fb9f243c
authored
1 year ago
by
Pierre Nicolas
Committed by
Adrien Béraud
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
conversation: hide "scroll to end" when unnecessary
GitLab:
#1251
Change-Id: I2a4d01560218daefb742af79565eb9b0da6c19a1
parent
0dbb6687
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
jami-android/app/src/main/java/cx/ring/fragments/ConversationFragment.kt
+14
-9
14 additions, 9 deletions
...p/src/main/java/cx/ring/fragments/ConversationFragment.kt
with
14 additions
and
9 deletions
jami-android/app/src/main/java/cx/ring/fragments/ConversationFragment.kt
+
14
−
9
View file @
fb9f243c
...
...
@@ -347,24 +347,29 @@ class ConversationFragment : BaseSupportFragment<ConversationPresenter, Conversa
val
visibleLatestThreshold
=
8
override
fun
onScrollStateChanged
(
recyclerView
:
RecyclerView
,
newState
:
Int
)
{}
override
fun
onScrolled
(
recyclerView
:
RecyclerView
,
dx
:
Int
,
dy
:
Int
)
{
val
layoutManager
=
recyclerView
.
layoutManager
as
LinearLayoutManager
?
if
(!
loading
&&
layoutManager
!!
.
findFirstVisibleItemPosition
()
<
visibleLoadThreshold
)
{
val
layoutManager
=
recyclerView
.
layoutManager
as
LinearLayoutManager
?
?:
return
if
(!
loading
&&
layoutManager
.
findFirstVisibleItemPosition
()
<
visibleLoadThreshold
)
{
loading
=
true
presenter
.
loadMore
()
}
if
(
layoutManager
!!
.
itemCount
-
layoutManager
.
findLastVisibleItemPosition
()
>
visibleLatestThreshold
)
{
// Recyclerview is composed of items which are sometimes invisible (to preserve
// the model and interaction relationship).
// Because of bug #1251, we use findLastCompletelyVisibleItemPosition because
// findLastVisibleItemPosition ignores invisible items (don't understand why).
val
lastVisibleItemPosition
=
layoutManager
.
findLastCompletelyVisibleItemPosition
()
if
(
layoutManager
.
itemCount
-
lastVisibleItemPosition
>
visibleLatestThreshold
)
binding
.
fabLatest
.
show
()
}
else
{
binding
.
fabLatest
.
hide
()
}
else
binding
.
fabLatest
.
hide
()
}
})
val
animator
=
binding
.
histList
.
itemAnimator
as
DefaultItemAnimator
?
animator
?.
supportsChangeAnimations
=
false
binding
.
histList
.
adapter
=
mAdapter
// val toolbarLayout: AppBarLayout? = activity?.findViewById(R.id.toolbar_layout)
// toolbarLayout?.isLifted = true
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment