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

app installation in Sony smart glass
How to spot app freeze causes when app is returning from pause state?
ios like date/time picker for android platform
ListView not showing anything
Placing XML Code into layout, pager.xml
How to make an imageView change background randomly?
Android Calender Events
Weird NullPointerException for attempting to display a List of Strings [duplicate]
Mobizen Screen Recording, What type method they are using for their floating bubble
Zurb Foundation 6 off-canvas navigation not working on Android internet browser
OkHttp: SSLPeerUnverifiedException Failed to find a trusted cert that signed X.509 Certificate
Facebook push campaigns (Beta) not working
not showing camera Preview on android
android apk not zip aligned when uploading to Google Play
How to trigger Actionbar menu items in android app
Android: Are clock ticks reliable to use them in a time sensitive application?

Categories

HOME
service-worker
notepad++
ggplot2
mstest
socket.io
xbee
nsbundle
google-apps
pearson-correlation
opengl-3
lanczos
github-enterprise
text-mining
pybossa
azure-iot-hub
mathprog
asp.net-mvc-viewmodel
user-experience
poedit
cgbitmapcontext
react-toolbox
moses
maze
surveymonkey
slidetoggle
pylons
handler
gp
realm-mobile-platform
testcomplete
send
python-2.6
weather
hibernate-validator
wacom
clickjacking
android-sugarorm
keras-layer
joomla2.5
sharding
xdocreport
flatmap
typesafe-config
branching-and-merging
escpos
knime
file-sharing
opennms
corruption
java-bytecode-asm
skin
pybrain
cd-burning
jtree
vcloud-director-rest-api
synonym
embedding
kango-framework
lz77
findfirst
django-urls
coda
rpart
dulwich
vacuum
cosine-similarity
mruby
addressing-mode
structuremap3
spy++
paw
personalization
tinyxml
websphere-esb
drupal-nodes
accesscontrolexception
inappsettingskit
neos-server
android-icons
cardreader
wimax
jquery-tools
qglwidget
commerceserver2007
silent
pagemethods
lobo-cobra
sun
google-wave
fault-tolerance
java1.4
soappy
change-management
mathematical-typesetting
wspbuilder

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