android


Endless recyclerview stackFromEnd type like Whatsapp


I need to implement a simple chat client on Android and in this application there is a stackFromEnd in my RecyclerView which I need to populate its data from database (or my server). So I added OnScrollListener to my list as below.
messageList.addOnScrollListener(new RecyclerView.OnScrollListener() {
#Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
}
#Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
if (messageLoading == false && layoutManager.findFirstCompletelyVisibleItemPosition() == 0) {
messageLoading = true;
ActionManager.getInstance().getChatAction().getThreadMessages(thread);
}
super.onScrolled(recyclerView, dx, dy);
}
});
The problem is when its called, the RecyclerView jumps to the first item of the list.
P.S:
ActionManager.getInstance().getChatAction().getThreadMessages(thread)
Just adds new items to adapter and calls notifyDataSetChanged
P.S.S:
Is there any library for message list (e.g. whatsapp, messenger etc.?!)

Related Links

get IP address but in xxx.xxx.xxx.xxx format in Android
Cancel swipe navigaton
how to get text from EditText within a Fragment and not activity
Issue with encoding in Android app pulling data from MySQL
Android, HTTP SEARCH Request is not working
Exoplayer unable to stream certain AAC encoded audio with .m3u8
Top level element is not completed and Valid XML must have a root tag : Android Studio
ListView getChildCount not returning correct value when it has children with small height
Which control/element to use in android application for conversation thread
Android ActionBar styling with ActionBar style generator
I get the error “SQLiteLog﹕ (1) near ”order“: syntax error” when I attempt to create a new database?
Android linking lmediandk: multiple definition of PROPERTY_VENDOR
How to set the camera light on torch in Tokbox?
SopCast to external video player
Exception when using SSLEngine
No results found in query

Categories

HOME
android
cygwin
apache-flink
jmeter
wakanda
github-for-windows
swt
jwplayer
vscode-extensions
appcelerator
carousel
aws-cli
scripting
hugo
babeljs
mvc5
trac
performancepoint
sendgrid-api-v3
minecraft-forge
enthought
xcodebuild
ipmitool
scrolltop
esoteric-languages
package.json
video-editing
jersey-1.0
microsoft-ocr
ksh
spring-async
displaytag
livelink
cognos-bi
jbutton
android-maps-extensions
installshield-le
fossil
z-notation
sim-card
kill
tasm
ssrs-2014
smoothstate.js
show-hide
stylecop
mesosphere
linter
globalize
git-flow
check-mk
d3-force-directed
pybrain
gameplay-kit
taocp
grails-plugin
latin
model-associations
mapinfo
jtwig
qiime
project-organization
kiosk
phpgrid
toran-proxy
java-money
themoviedb-api
phpldapadmin
gamekit
ejb-2.x
theos
wcm
parallel-testing
square-bracket
synapse
multiautocompletetextview
git-repo
gd-graph
http-patch
scrypt
device-width
idn
dopostback
sentestingkit
subproject
google-maps-mobile
cdonts
twitterizer
timertask
skype4java
visualj#
todos

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App