noties / scrollable Goto Github PK
View Code? Open in Web Editor NEWAndroid scrollable tabs
License: Apache License 2.0
Android scrollable tabs
License: Apache License 2.0
I wanted to add tabs dynamically and pass items as the arraylist which is not possible
Warning:ru.noties.scrollable.ScrollableScroller: can't find referenced method 'float sqrt(float)' in library class android.util.FloatMath
Warning:there were 1 unresolved references to library class members.
You probably need to update the library versions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
Exception while processing task
java.io.IOException: Please correct the above warnings first.Error:Execution failed for task
...
...
':app:packageRelease'.
Unable to compute hash of /Users/captain_miao/am/androidCode/trunk/treadmill/app/build/intermediates/classes-proguard/release/classes.jar
Hi,
Is it possible to implement CloseUpAlgorithm such that the header doesn't expand and hide automatically? What I mean is, when the header is fully expanded, if I move my finger upwards till the header is half of its original height and release my finger, the header doesn't collapse but remains as it is.
I'm very new to development with regards to touch events so I'd be grateful if you could point me in the right direction.
Thanks!
If UP event received when getScrollY()
== mMaxScrollY, click event is propagated to the scrolling view
Sorry for the noob question, i have activity with tabs, in have 3 tabs(3 fragments), i the first two i have recycler view, i need to set this {canscroll vertical}, i follow your sample, but this not work...
In fragments that i have recycler view, i implements CanScrollVerticallyDelegate, OnFlingOverListener methods:
override fun canScrollVertically(direction: Int): Boolean {
return recycler_view_relation.canScrollVertically(direction)
}
override fun onFlingOver(y: Int, duration: Long) {
recycler_view_relation.smoothScrollBy(0, y)
}
On activity i have: (nts top is my tabs)
scrollable_layout.setDraggableView(nts_top)
is correct?
And how to collpse on click
Include ScrollableDialog into library
Hi!
I have a viewpager with only one fragment and inside this fragment a recyclerview. When i scroll down there is no problem, but when i want to scroll up until the top, the recyclerview is blocked and instead the ScrollableLayout scroll. I wish that the ScrollableLayout would scroll only after the recyclerview reached the top.
I have
When I scroll up to Taps layout, height of ViewPager still keep old height, ViewPager not fill to bottom of screen, so I can see other screen under.
Hi. I noticed that the sample app does not preserve the header view height after screen rotation.
P.S. Thanks for the superb library, this is what I am just looking for! I am willing to contribute this library :)
Nice work,but i want to know how to disable the sticky function?I just want to add a header for RecyclerView.
like example
Hi,
After scrolling down to the bottom of a list of about 50 items, when you fling up it doesn't show the header, one will still slide up to finally see the header. I've set the friction to 1f but this scenario still persists.
Is there anyway to resolve this?
I use ScrollableLayout in a TabLayout+ViewPager,and ScrollableLayout has a LinearLayout(with Tablayout+ViewPager), if the ScrollableLayout in first page of tab,the height is ok,or else can see ScrollableLayout
strings.xml is missing min_friction_text
dimension.xml is missing max_friction_steps
So right now it isn't compiling until you add those :)
the textview's height is changged ,how can i use it?
I am using your library to implement a sliding up panel layout which has a scrollable layout at its root and a view pager as a child which will show two fragments
the setCanScrollVerticallyDelegate method on debugging gave me the result that the direction variable doesnt have a value
Can you help me out please
if the scrollable_maxScroll larger than the screen height,it's scroll will have some problem.
my email :[email protected]
------------------------------- I'm so sorry , My Eglish is Not good.
Hi Dimitry,
if the header's height was longer than the screen height, it works not well
Error:FAILURE: Build failed with an exception.
Where:
Script 'https://raw.githubusercontent.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle' line: 48
What went wrong:
A problem occurred configuring project ':app'.
A problem occurred configuring project ':library'.
No such property: GROUP for class: org.gradle.api.publication.maven.internal.deployer.DefaultGroovyMavenDeployer
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Hello,
I have a screen like this. I want to hide the header (including Tabs and "Kitapçık A B", excluding ActionBar) while scrolling to bottom.
I have implemented it like this.
<?xml version="1.0" encoding="utf-8"?>
<org.buraktamturk.loadingview.LoadingView
android:layout_width="match_parent"
android:layout_height="match_parent"
tf:lv_loading="false"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tf="http://schemas.android.com/apk/res-auto">
<ru.noties.scrollable.ScrollableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/scrollable_layout"
tf:scrollable_maxScroll="96dp">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="96dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:id="@+id/kitapcikLayout"
android:background="?attr/colorPrimary"
android:paddingLeft="11dp"
android:paddingTop="5dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textSize="16sp"
android:textColor="@android:color/white"
android:text="@string/kitapcik" />
<com.fem.tekno.utils.KitapciklarView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_gravity="center_vertical"
android:id="@+id/kitapciklar"
/>
</LinearLayout>
<com.astuetz.PagerSlidingTabStrip
android:id="@+id/tabs"
android:layout_width="match_parent"
android:textColorPrimary="@android:color/white"
android:layout_height="56dp"
android:background="?attr/colorPrimary" />
</LinearLayout>
<android.support.v4.view.ViewPager
android:id="@+id/viewPager"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_marginTop="96dp"
/>
</ru.noties.scrollable.ScrollableLayout>
</org.buraktamturk.loadingview.LoadingView>
The final look when it scrolled down is this.
As presented above. There is 96dp (header's height) space between bottom of the device and end of the ViewPager.
Could you help me with removing the space?
Thanks,
Burak
Hello,
thanks for this great lib.
Sometimes i would like to show header before scroll list.
I use this code :
mScrollableLayout.setCanScrollVerticallyDelegate(new CanScrollVerticallyDelegate() {
@Override
public boolean canScrollVertically(int direction) {
if(direction<0){
if(mScrollableLayout.getScrollY()==0){ //header is visible
return mListPlayers.canScrollVertically(direction);
}else{
return false;
}
}
return mListPlayers.canScrollVertically( direction);
}
});
Boolean return value seems to be ok, but i'm not able to scroll the list after scrollbarLayout scrolls to top without touch up and touch down.
What can I change to do that ?
Thanks.
Hi, it is a awesome project, I just met a problem, I wanna replace the textview control of the header with a viewpager, but it seems being failed, and the listview move to the header, how to fix it?
Hi Dimitry,
Whenever I scroll up the scrollablelayout, there is a certain blank space left behind which I suppose belongs to the activity holding the view pager, can you please tell me what is wrong with my code.
My Activity Layout :
<include
android:id="@+id/action_bar_points"
layout="@layout/custom_action_bar_toolbar" />
<ru.noties.scrollable.ScrollableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/scrollable_layout"
app:scrollable_autoMaxScroll="true"
app:scrollable_autoMaxScrollViewId="@+id/header"
app:scrollable_considerIdleMillis="125"
app:scrollable_friction="0.050"
app:scrollable_closeUpAnimationMillis="250"
app:scrollable_defaultCloseUp="true"
app:scrollable_scrollerFlywheel="false"
app:scrollable_closeUpAnimatorInterpolator="@android:anim/accelerate_decelerate_interpolator">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/points_parent"
android:orientation="vertical"
android:background="@color/app_bg">
<LinearLayout
android:layout_width="fill_parent"
android:orientation="vertical"
android:id="@+id/header"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="140dp"
android:layout_height="140dp"
android:background="@drawable/circle_my_points_bg"
android:layout_marginTop="@dimen/margin15dp"
android:layout_marginBottom="@dimen/margin15dp"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:id="@+id/circular_relative_view">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/star_icon"
android:text=""
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/margin10dp"
android:padding="@dimen/margin5dp"
android:textSize="16sp"
android:textColor="@color/orange_text"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/level_text_points"
android:layout_below="@id/star_icon"
android:layout_centerHorizontal="true"
android:text=""
android:layout_marginTop="@dimen/margin5dp"
fontPath="fonts/Gotham-XLight.otf"
android:textSize="16sp"
android:textColor="@color/orange_text"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/level_points"
android:layout_below="@id/level_text_points"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/margin10dp"
android:text="9400"
fontPath="fonts/Gotham-XLight.otf"
android:textSize="20sp"
android:textColor="@color/black"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/reward_points_text"
android:layout_below="@id/level_points"
android:layout_centerHorizontal="true"
android:text=""
android:padding="4dp"
fontPath="fonts/Gotham-XLight.otf"
android:textSize="12sp"
android:textColor="@color/black"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:id="@+id/points_indicator"
android:layout_below="@id/circular_relative_view"
android:layout_marginTop="@dimen/margin20dp"
android:padding="@dimen/margin5dp"
android:visibility="gone">
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/light_gray"
android:layout_marginTop="@dimen/margin15dp"
android:layout_marginLeft="@dimen/margin10dp"
android:layout_marginRight="@dimen/margin10dp"
android:layout_below="@id/points_indicator"/>
</LinearLayout>
<android.support.design.widget.TabLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/points_tablayout"
app:tabMode="fixed"
app:tabGravity="fill"
app:tabIndicatorColor="@color/app_bg"
app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"
app:tabSelectedTextColor="@color/orange_text"
app:tabTextColor="@color/black"/>
<android.support.v4.view.ViewPager
android:id="@+id/points_viewpager"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="@color/app_bg"
android:layout_below="@id/points_tablayout"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
/>
</LinearLayout>
</ru.noties.scrollable.ScrollableLayout>
Viewpager fragment 1:
?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/redeem_recyclerview"
android:background="@color/app_bg"
android:clipToPadding="false"
android:numColumns="auto_fit"
android:padding="@dimen/item_offset"/>
Does this work with the support library's SwipeRefreshLayout? :)
dependencies does not prompt for errors, it is also synchronized, but you can't find the class dependencies {
compile 'ru.noties:scrollable:1.3.0' } Restart, still not in effect
how can I solve it?
In multi-window mode, screen height maybe shorter than scroll header height.
The header will expand before the item of recycler or listview to the top.
when you are scrolling beveled, the header and the content will not scroll together
I like this scrollable but it can more like this ??
https://github.com/Frank-Zhu/PullZoomView
how I add it??
how to disable all logs
D/InputEventConsistencyVerifier: TouchEvent: ACTION_MOVE contained 1 pointers but there are currently 0 pointers down.
in ru.noties.scrollable.ScrollableLayout@b552f9f0
0: sent at 8776594648936, MotionEvent { action=ACTION_MOVE, id[0]=0, x[0]=128.0, y[0]=97.18901, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=1, eventTime=8776594, downTime=8776490, deviceId=0, source=0x1002 }
-- recent events --
1: sent at 8776594648936, (unhandled) MotionEvent { action=ACTION_CANCEL, id[0]=0, x[0]=128.0, y[0]=97.18901, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=1, eventTime=8776594, downTime=8776490, deviceId=0, source=0x1002 }
2: sent at 8776577982270, MotionEvent { action=ACTION_CANCEL, id[0]=0, x[0]=128.0, y[0]=90.14987, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=1, eventTime=8776577, downTime=8776490, deviceId=0, source=0x1002 }
3: sent at 8776561315604, MotionEvent { action=ACTION_MOVE, id[0]=0, x[0]=128.0, y[0]=84.162964, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=1, eventTime=8776561, downTime=8776490, deviceId=0, source=0x1002 }
4: sent at 8776490710000, MotionEvent { action=ACTION_MOVE, id[0]=0, x[0]=128.0, y[0]=82.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=8776490, downTime=8776490, deviceId=0, source=0x1002 }
5: sent at 8776490065000, MotionEvent { action=ACTION_DOWN, id[0]=0, x[0]=127.0, y[0]=79.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=8776490, downTime=8776490, deviceId=0, source=0x1002 }
use toolbar will stay two toolbar height ,one is toolbar ,another is white background whitout noting.like this
because the ScrollLayout method onLayout , child onLayout with childTop use the given top.
if use given top = 0 , the issue will be solved. should you fix it ? thx
code :
@OverRide
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
int childTop = top;
// should use
//childTop = 0;
for (int i = 0; i < getChildCount(); i++) {
final View view = getChildAt(i);
view.layout(left, childTop, right, childTop + view.getMeasuredHeight());
childTop += view.getMeasuredHeight();
}
}
How I can use Scrollable contorl inside fragment ?
when i use this in fragment layout, it is just not working. dont know why.
In FragmentPager,when Scrolling the page,the headerview can scroll also,and the page restored to its original position.I dont want the headerview to scroll or the page restored to its original position,how to solve it,Thanks
Hi Dimitry,
sorry to disturb you again.
in my layout,i got a complex header view longer than the screen height,which has ImageView,ViewPager etc.all of the cell views in header are clickable.
it seems a little lag during scroll,unless the TabsLayout is sticky.
you can add a couple of TextViews in a vertical linearlayout header,and every TextView has a click listener.
When nested match_parent FrameLayout and recyclerview match_parent slide down the normal drop-down, recyclerview cannot scroll, and recyclerview is no longer recyclerview
Used design support library in my project , while using scrollable layout getting error as
Error:
java.lang.NoClassDefFoundError: ru.noties.scrollable.ScrollableLayout$2
at ru.noties.scrollable.ScrollableLayout.(ScrollableLayout.java:521)
Is there any solution for it?
I have used design support library with version 23.1.1
Thanks
I can't download by dependencies
Some requirements are like this, viewpgaer has a head viewpgaer, and the recyclerview inside can be pulled up to load more drop up refresh
@noties : Header view is going inside the toolbar , i need to make header view below the toolbar with size variation as on scroll up size should get reduce and on scroll down size should get increase.
Thanks for this API.
I implemented a logic whereby I hide the header when a particular ViewPager tab is selected. I do this inside the onPageSelected, but it doesn't seems to work but it works inside the currently showing ViewPager Tab Fragment onResume.
Please how do I resolve this so that it works in the viewpager onPageSelected function.
First thanks alot for that wonderful efforts
.My issue is when I fast scrolling vertically its scrolling not smooth as compared to scroll slowly vertically.
Please suggest something.
Whenever I scroll down, the header scrolls and becomes visible; but I have to release and scroll down again for the scrolling to continue.
How do I change this behavior such that with one scroll down/drag down the header will show while the list will still continue to scroll down.
When I want top a page, I use scrollTo(0, 0), it back to top without animator. Could you help me it smoothly? Thank you
How can i get 'ru.noties.scrollable.sample.SampleHeaderView' ? I have added compile 'ru.noties:scrollable:1.3.0' but not able to get SampleHeaderView .
if my app use theme
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
how to make sticky toolbar in xml ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.