android


Android: recycler view over tab bar


I need to create an effect similar to starbucks where a listview (or fragment) scrolls over a tab bar.
I have created a tab bar and below that I have a viewpager with recycler view in it. I am able to move the recyclerview along with tab bar but not able to create effect where my recycler view (which is hosted in viewpager) scrolls over the tab bar.
put a scrollListener on your list and in the scrolling put a little animation to the body you are trying to make it scroll over the bar
listView.setOnScrollListener(new AbsListView.OnScrollListener() {
#Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
}
#Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount,
int totalItemCount) { movingBody.setTranslationY(getScroll());}}
protected int getScroll() {// as list recycles views , getscrollY wont give us how much it has scrolled, hence we use this hack
View firstChildInList = listView.getChildAt(0);
if (firstChildInList == null) return 0;
return firstChildInList.getTop() + listView.getFirstVisiblePosition() * firstChildInList.getHeight();
}
Get scroll is used to determine how much you have scrolled to stop the translation animation
you can make your own condition for the animation to start and to stop instead of getScroll

Related Links

If I have a String of tweets (json), can I load into Twitter4j Tweet[]?
Android - How to parse RSS Feed from .net website?
Exception on finishing an activity
How do I use JSONObject in Android
How to stop Alarm Manager?
Cannot set JAVA_HOME
Best way to implement Day View / Schedule Android UI
Create a view something similar to pinterest
Fixing android listview size to a particular length
Making a custom progressdialog with an animation
Android LogCat sqlite syntax error meaning
Is it possible to programmatically detect if is real or a virtual Android device?
How to encrypt a string such that it can be used as a part of a file path and then decrypt it in Android?
Let onDraw method of custom View not execute repeat
Android image size for a client server app
internal link support in mupdf

Categories

HOME
oracle12c
twitter-bootstrap-3
github-for-windows
phpmyadmin
google-spreadsheet
pda
mjml
flex
nsbundle
scripting
cakephp-3.4
telegram-bot
code-coverage
banner
retrofit2
opengl-3
boto3
siddhi
mxgraph
naivebayes
code-generation
modbus-tcp
atlassian-stash
soci
database-connection
selinux
asciidoctor-pdf
backpack-for-laravel
jquery-callback
game-theory
pylons
jackson-modules
corenlp-server
jmockit
quickfixj
catch-unit-test
instantiation
hunspell
reverse
pdw-file-browser
navigator
nohup
node-mssql
ods
kill
ogc
photos
vaadin-charts
phpdbg
term
automapper-5
yii2-api
semantic-logging
modelsim
oracleclient
android-testing
excel-dna
quicktime
bbpress
d3-force-directed
universal-analytics
google-photos
choice
cvxpy
change-tracking
tinkerpop3
greatest-n-per-group
embedding
riot
gcloud-ruby
linklabel
tfs-workitem
google-books
canalyzer
dronekit-android
typeconverter
osc
dot.js
rapidsvn
filesplitting
machine-instruction
mintty
grails-plugin-rabbitmq
gnumeric
dsym
android-audiorecord
hibernate-entitymanager
light
solace-mq
breakout
code-duplication
script#
mongohq
cnf
poker
cardreader
wimax
nokia-s40
subproject
extconf.rb
role
jqote
django-paypal
dot-emacs
binomial-heap
application-verifier
nstokenfield
data-mapping
application-planning

Resources

Encrypt Message