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
39fbcb80
Commit
39fbcb80
authored
Nov 28, 2016
by
Yusuke Iwaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix coding styles.
parent
c43c00f8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
LoadMoreScrollListener.java
...va/chat/rocket/android/helper/LoadMoreScrollListener.java
+7
-3
ExtRealmModelListAdapter.java
...rocket/android/layouthelper/ExtRealmModelListAdapter.java
+1
-0
No files found.
app/src/main/java/chat/rocket/android/helper/LoadMoreScrollListener.java
View file @
39fbcb80
...
...
@@ -3,20 +3,24 @@ package chat.rocket.android.helper;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.support.v7.widget.RecyclerView
;
@SuppressWarnings
(
"PMD.AbstractNaming"
)
public
abstract
class
LoadMoreScrollListener
extends
RecyclerView
.
OnScrollListener
{
private
final
LinearLayoutManager
layoutManager
;
private
final
int
loadThreshold
;
private
boolean
isLoading
;
/**
* constructor. loadThreshold is better to set to 0.4 * total.
*/
public
LoadMoreScrollListener
(
LinearLayoutManager
layoutManager
,
int
loadThreshold
)
{
this
.
layoutManager
=
layoutManager
;
this
.
loadThreshold
=
loadThreshold
;
setLoadingDone
();
}
@Override
public
void
onScrolled
(
RecyclerView
recyclerView
,
int
d
x
,
int
dy
)
{
super
.
onScrolled
(
recyclerView
,
d
x
,
dy
);
@Override
public
void
onScrolled
(
RecyclerView
recyclerView
,
int
d
eltaX
,
int
deltaY
)
{
super
.
onScrolled
(
recyclerView
,
d
eltaX
,
deltaY
);
final
int
visibleItemCount
=
recyclerView
.
getChildCount
();
final
int
totalItemCount
=
layoutManager
.
getItemCount
();
...
...
@@ -25,7 +29,7 @@ public abstract class LoadMoreScrollListener extends RecyclerView.OnScrollListen
if
(!
isLoading
&&
firstVisibleItem
+
visibleItemCount
>=
totalItemCount
-
loadThreshold
&&
visibleItemCount
<
totalItemCount
&&
d
y
<
0
)
{
&&
d
eltaY
<
0
)
{
isLoading
=
true
;
requestMoreItem
();
}
...
...
app/src/main/java/chat/rocket/android/layouthelper/ExtRealmModelListAdapter.java
View file @
39fbcb80
...
...
@@ -6,6 +6,7 @@ import chat.rocket.android.realm_helper.RealmModelListAdapter;
import
chat.rocket.android.realm_helper.RealmModelViewHolder
;
import
io.realm.RealmObject
;
@SuppressWarnings
({
"PMD.AbstractNaming"
,
"PMD.GenericsNaming"
})
/**
* RealmModelListAdapter with header and footer.
*/
...
...
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