Comments (5)
Hey @aamirmsw
As I see the scroll distance is more or less equals to the Toolbar height, so I assume that you have autoMaxScroll
parameter set to true
and Toolbar is the first view inside ScrollableLayout
in your XML layout. Can you confirm?
from scrollable.
See all ,Here is the both the file main activity and fragment file i have uploaded ,
i am using framelayout inside main activity and adding fragment in this framelayout which contains "ru.noties.scrollable.ScrollableLayout" as a parent layout in fragment. The 'scrollable_maxScroll' size is 100dp ,more Toolbar is not firstview inside the ScrollableLayout.
Here is a xml fragment file
fragment_rewards.txt
Here is main activity xml file
from scrollable.
Well, I see that you have specified scrollable_maxScroll="100dp"
it means that ScrollableLayout will scroll exactly 100dp. If you want to completely hide header, you must provide it's exact size via maxScroll
attribute. If you not know the size of your header beforehand, you can use scrollable_autoMaxScroll="true"
attribute that will automatically set scroll distance as the height of the first view
from scrollable.
I don't want to hide complete header ,just i want to scroll half of the header and the size of view inside the header will increase and decrease accordingly scroll up/scroll down ,but here what happens , when i set scrollable_maxScroll="100dp" it scrolls half of header but header goes inside of the toolbar.
from scrollable.
Well, the header is not going inside the toolbar, it just scrolls. If you need custom handling of a scroll state, then you have to implement your logic in Java code, for example:
scrollableLayout.addOnScrollChangedListener(new OnScrollChangedListener() {
@Override
public void onScrollChanged(int y, int oldY, int maxY) {
// `ratio` of current scroll state (from 0.0 to 1.0)
// 0.0 - means fully expanded
// 1.0 - means fully collapsed
final float ratio = (float) y / maxY;
// this will scale down the header when `collapsed` (but no less than half of original height)
headerContent.setScaleX(Math.max(.5F, ratio));
headerContent.setScaleY(Math.max(.5F, ratio));
}
});
Basically you can do anything with your header there
from scrollable.
Related Issues (20)
- View Pager not taking the complete height even on using "match parent" HOT 1
- Not able to get all library views HOT 1
- when Scrolling the page,the headerview can scroll also HOT 1
- What should I do if there are ups and drop refresh ui in viewpager? HOT 1
- dependencies problem HOT 1
- nested two page bug HOT 1
- How to use FragmentStatePager Adapter HOT 1
- ScrollHeader is not smoothly HOT 2
- dude HOT 2
- Change viewpager item size dynamically with listview scroll HOT 5
- Header reappears on top when returning to fragment that has been scrolled down. HOT 8
- Long press slide up RecycleView item before headview scoll up HOT 2
- Scrollable tab scrolls under title bar HOT 1
- add RecyclerView on the head, slide very slowly, there is inertia slow sliding HOT 1
- bottom part of the fragment in the viewpager is clipped or cut of how to fix this HOT 6
- when topView height is changed , tabLayout below will be covered HOT 5
- not use SwipeBackLayoutTouTiao HOT 4
- Cannot collapsed header view programmatically HOT 2
- scrollable scrollview in fragment not scrolled
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scrollable.