timusus / recyclerview-fastscroll Goto Github PK
View Code? Open in Web Editor NEWA simple FastScroller for Android's RecyclerView
License: Other
A simple FastScroller for Android's RecyclerView
License: Other
If I set a popup background color with alpha, like e.g. #997F7F7F, only RGB spectrum is used. Please check also another color attributes and fix
Hi,
I just added library to project however I'm getting rendering problem. Any idea what can cause this?
java.lang.IllegalArgumentException: java.lang.ClassCastException@73980bc4
at sun.reflect.GeneratedMethodAccessor1056.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at android.animation.PropertyValuesHolder_Delegate.callMethod(PropertyValuesHolder_Delegate.java:108)
at android.animation.PropertyValuesHolder_Delegate.nCallIntMethod(PropertyValuesHolder_Delegate.java:140)
at android.animation.PropertyValuesHolder.nCallIntMethod(PropertyValuesHolder.java)
at android.animation.PropertyValuesHolder.access$200(PropertyValuesHolder.java:38)
at android.animation.PropertyValuesHolder$IntPropertyValuesHolder.setAnimatedValue(PropertyValuesHolder.java:1221)
at android.animation.ObjectAnimator.animateValue(ObjectAnimator.java:989)
at android.animation.ValueAnimator.setCurrentFraction(ValueAnimator.java:612)
at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:578)
at android.animation.ValueAnimator.start(ValueAnimator.java:1001)
at android.animation.ValueAnimator.start(ValueAnimator.java:1010)
at android.animation.ObjectAnimator.start(ObjectAnimator.java:852)
at com.simplecityapps.recyclerview_fastscroll.views.FastScroller.show(FastScroller.java:306)
at com.simplecityapps.recyclerview_fastscroll.views.FastScroller$2.onScrolled(FastScroller.java:148)
at android.support.v7.widget.RecyclerView.dispatchOnScrolled(RecyclerView.java:4618)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep3(RecyclerView.java:3679)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3323)
at android.support.v7.widget.RecyclerView.onLayout_Original(RecyclerView.java:3844)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java)
at android.view.View.layout(View.java:17523)
at android.view.ViewGroup.layout(ViewGroup.java:5612)
at android.support.constraint.ConstraintLayout.onLayout_Original(ConstraintLayout.java:1197)
at android.support.constraint.ConstraintLayout.onLayout(ConstraintLayout.java)
at android.view.View.layout(View.java:17523)
at android.view.ViewGroup.layout(ViewGroup.java:5612)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:17523)
at android.view.ViewGroup.layout(ViewGroup.java:5612)
at android.support.v7.widget.ActionBarOverlayLayout.onLayout_Original(ActionBarOverlayLayout.java:437)
at android.support.v7.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java)
at android.view.View.layout(View.java:17523)
at android.view.ViewGroup.layout(ViewGroup.java:5612)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
at android.view.View.layout(View.java:17523)
at android.view.ViewGroup.layout(ViewGroup.java:5612)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:345)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:429)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:368)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:567)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:549)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:863)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:549)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$1(RenderTask.java:680)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
I am using 2 different viewtypes (a textview and a cardview) for the recyclerview. When the type is changing in the recyclerview while scrolling it is lagging (scroll bar is jumping up and down like crazy).
In getSectionedName I'm is always returning "A"
Any fixes?
Here's my java code:
recyclerView = ((FastScrollRecyclerView)v.findViewById(R.id.recyclerView)); recyclerView.setAdapter(new BaseAdapter()); recyclerView.hasFixedSize(); recyclerView.setLayoutManager(new GridLayoutManager(getActivity().getApplicationContext(),2));
XML:
<FrameLayout
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"
tools:context=".Activities.Main2Activity$PlaceholderFragment">
<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:fastScrollAutoHide="true"
app:fastScrollAutoHideDelay="1000"
app:fastScrollPopupBgColor="@color/colorAccent"
app:fastScrollPopupTextColor="@android:color/primary_text_dark"
app:fastScrollThumbColor="@color/colorAccent"
app:spanCount="2"/>
Is possible add scrollbar outside RecyclerView?
I capture multiple crashes on API lower then 15 from Crashlytics. A user reported that he cannot enter the Activity Screen totally.
Fatal Exception: java.lang.NullPointerException
at android.animation.PropertyValuesHolder.setupSetterAndGetter(PropertyValuesHolder.java:513)
at android.animation.ObjectAnimator.initAnimation(ObjectAnimator.java:385)
at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:537)
at android.animation.ValueAnimator.start(ValueAnimator.java:927)
at android.animation.ValueAnimator.start(ValueAnimator.java:950)
at android.animation.ObjectAnimator.start(ObjectAnimator.java:363)
at com.simplecityapps.recyclerview_fastscroll.views.FastScroller$1.run(FastScroller.java:124)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4512)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:982)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:749)
at dalvik.system.NativeStart.main(NativeStart.java)
When the parent RecyclerView is contained in a ViewGroup with another view whose scrolling behavior causes the RecyclerView to be pushed down, the FastScroll track and thumb moves off-screen with the RecyclerView.
There should be some sort of adjustment to allow the FastScroll track, thumb & scroll-range to remain fixed even when the parent RecyclerView is moved down.
Currently not supported. Any RecyclerView with item decorations will have weird FastScroll positions, due to the height of the decorations not being taken into account.
Hi there. Author of the MaterialScrollBar library here: https://github.com/krimin-killr21/MaterialScrollBar
I'd like to have your blessing to fork your library and start working on a library merge. Your lib is much more efficient codewise than mine hence why I'm suggesting using yours as a base. The two libs are so similar I think it would do us and the community good to work together. All I'd ask is for commit privileges if the pull request gets approved and then I'd depreciated my lib and redirect here. I'd work on integrating the following features:
Other than these changes we'd keep all of your code.
Regards
I need to change popup textSize. How can i do it?
It says in readme that it should be possible to change the text size of the text in the popup using setPopupTextSize(int size), but I don't find any methods supporting this in code. The others for setting background- and text color is there, but not size.
In the following layout the scroll bar does not appear:
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.AppCompatTextView
android:id="@+id/permission_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textStyle="bold"
tools:text="216 Permissions:"/>
<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
style="@style/FastScrollRecycleView"
android:id="@+id/permission_list"/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
where
<style name="FastScrollRecycleView">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
<item name="fastScrollAutoHide">true</item>
<item name="fastScrollAutoHideDelay">@integer/scroll_auto_hide_delay_millis</item>
<item name="fastScrollPopupBgColor">@color/scrolling_popup_background</item>
<item name="fastScrollPopupTextColor">@color/scrolling_popup_text_color</item>
<item name="fastScrollThumbColor">@color/scrolling_thumbnail_color</item>
<item name="fastScrollPopupTextSize">@dimen/scroll_popup_text_size</item>
<item name="fastScrollPopupBackgroundSize">@dimen/scroll_popup_background_size</item>
</style>
Code adjustments:
recycleView.setLayoutManager(new LinearLayoutManager(getContext()));
recycleView.setNestedScrollingEnabled(false);
Library version used: 1.0.11
On certain devices (Nexus 6P, Nexus 5X, Moto G3, etc.) the section popup doesn't disappear after the user has stopped scrolling.
java.lang.ArithmeticException: divide by zero
at com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView.scrollToPositionAtProgress(FastScrollRecyclerView.java:297)
at com.simplecityapps.recyclerview_fastscroll.views.FastScroller.handleTouchEvent(FastScroller.java:205)
at com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView.handleTouchEvent(FastScrollRecyclerView.java:138)
at com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView.onTouchEvent(FastScrollRecyclerView.java:118)
at android.support.v7.widget.RecyclerView.dispatchOnItemTouch(RecyclerView.java:2756)
at android.support.v7.widget.RecyclerView.onTouchEvent(RecyclerView.java:2899)
override fun getSectionName(position: Int): String =
sections[getSectionForAdapterPosition(position)].name
This error happen when scrolling.
Is there a any solution?
I have a simple RecyclerView extending FastScrollRecyclerView whose adapter is a RecyclerView.Adapter implementing FastScrollRecyclerView.SectionedAdapter. The FastScroll thumb shows and works just fine, but the popup does not show when scrolling.
This is my RecyclerView XML:
<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
android:id="@+id/track_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:fastScrollPopupBgColor="@color/colorAccent"
app:fastScrollPopupTextColor="@android:color/primary_text_dark"
app:fastScrollThumbColor="@color/colorAccent"
app:fastScrollPopupBackgroundSize="88dp"
app:fastScrollPopupTextSize="56sp"/>
And this is my getSectionName() method:
@NonNull
@Override
public String getSectionName(int position)
{
if (position > 0) position--; // the 0th position is not a track
return Character.toString(tracks.get(position).getTitle().charAt(0));
}
I am using an itemDecoration that separates the items by 2dp.
Hi,
There are some cases where the autohide feature is not working for me. In Android 4.x it's even crashing:
Fatal Exception: java.lang.NullPointerException
at android.animation.PropertyValuesHolder.setupSetterAndGetter(PropertyValuesHolder.java:513)
at android.animation.ObjectAnimator.initAnimation(ObjectAnimator.java:392)
at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:544)
at android.animation.ValueAnimator.start(ValueAnimator.java:934)
at android.animation.ValueAnimator.start(ValueAnimator.java:957)
at android.animation.ObjectAnimator.start(ObjectAnimator.java:370)
at com.simplecityapps.recyclerview_fastscroll.views.FastScroller$1.run(SourceFile:118)
at android.os.Handler.handleCallback(Handler.java:605)
This is my XML:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:fastScrollAutoHide="true"
app:fastScrollAutoHideDelay="1500"
app:fastScrollPopupBgColor="@color/accent"
app:fastScrollPopupTextColor="@android:color/white"
app:fastScrollThumbColor="@color/accent"
/>
<ProgressBar
android:id="@+id/list_progressbar"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true"
/>
<TextView
android:id="@+id/contact_list_all_empty_text"
android:layout_gravity="center"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/empty_title"
android:visibility="gone"
/>
</FrameLayout>
Any clue what might be happening?
Thanks!
Please allow us to make the grey scrollbar background fullscreen to remove the empty space at the start and end.
Hello
I use compile 'com.simplecityapps:recyclerview-fastscroll:1.0.15'
in my app.gradle but I can not use FastScrollRecyclerView.MeasurableAdapter interface like sample app for my adapter.
Please guid me, Thanks a lot
I am currently adding the following proguard config to fix it:
# ---- FastScrollRecycleView ----
-keep class com.simplecityapps.recyclerview_fastscroll.** { *; }
# ---- END FastScrollRecycleView ----
Please add a note or include progurd rules into your lib.
Hello
I have 3 types of view in my RecyclerView with different heights.
In my case RecyclerView-FastScroll dose not work correctly.
Is it possible to fix it?
Thanks
iam new to android and in this iam unable to change the width and height of the scroll bar.please help me to do thatand remaining all working properly
See the logcat below. While scrolling in the sample app within the range of 10 -99 the popup size (bgWidth) jumps between 328 - 332 px. This causes the popup to slightly flicker and lock restless.
08-21 23:05:02.738 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 330 (71)
08-21 23:05:02.754 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 330 (71)
08-21 23:05:02.771 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 330 (71)
08-21 23:05:02.787 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 330 (71)
08-21 23:05:02.803 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 330 (71)
08-21 23:05:02.821 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 328 (70)
08-21 23:05:02.837 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 328 (70)
08-21 23:05:02.852 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 328 (70)
08-21 23:05:02.869 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 332 (72)
08-21 23:05:02.885 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 332 (72)
08-21 23:05:02.902 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 330 (71)
08-21 23:05:02.918 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 330 (71)
08-21 23:05:02.934 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 330 (71)
08-21 23:05:02.951 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 330 (71)
08-21 23:05:02.967 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 332 (72)
08-21 23:05:02.985 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 332 (72)
08-21 23:05:03.000 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 332 (72)
08-21 23:05:03.018 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 332 (72)
08-21 23:05:03.034 11956-11956/com.simplecityapps.recyclerview_fastscroll.sample D/bgWidth (bgPadding): 328 (70)
I have some ideas how to address this. The easiest way would be to add some rounding, but is not 100% reliable. Other ways I try is to get the max width of the used typeface or to force monospace text drawing. Will add a PR as soon as I found a solid solution.
Hi , how to hide and show fastscroller
by a method like this ?
FSV.showFastScroller(false);
When dragging the FastScroll handle with many items in the RecyclerView (1000+), the scrolling becomes incredibly laggy.
The only thing I am changing is using a local build of the library, maybe an older version then switching to using the gradle link:
compile 'com.simplecityapps:recyclerview-fastscroll:1.0.5'
And then the SectionIndexer method 'getSectionForPosition' doesn't seem to get called. Any thoughts?
The FastScroll thumb only scrolls between 0 & itemCount/2.
Hey @timusus
There are situations when we need to dynamically show or hide the scroller so because there could be method to hide the scroller and show it when required.
It would be nice to have support for the auto-hide feature (like Google Messenger)
I want to disable autohide and always show the scrollbar/ fastscroll like Whatsapp Contacts. However, app:fastScrollAutoHide="false"
has no effect, it's always auto-hide!
I'm using Android Support library 23.4.0
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.RecyclerView.scrollToPosition(int)' on a null object reference
Would be nice to control the behaviour of the thumb to adapt the current way google showing the scrollbar.
instead of doing reflection on api level 14 and above , use Property .
happens when you return to the fragment having the recyclerview, there is a view element (like top shadow) overlapping on the recyclerview and it hasn't scrolled yet, i assume it tries to find the shadow within the recyclerview and fails
03-08 15:43:21.575 11532-11532/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.thecircle.debug, PID: 11532
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getTop()' on a null object reference
at android.support.v7.widget.RecyclerView$LayoutManager.getDecoratedTop(RecyclerView.java:7654)
at com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView.getCurScrollState(FastScrollRecyclerView.java:315)
at com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView.onUpdateScrollbar(FastScrollRecyclerView.java:286)
at com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView.draw(FastScrollRecyclerView.java:169)
at android.view.View.updateDisplayListIfDirty(View.java:15180)
at android.view.View.draw(View.java:15954)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.updateDisplayListIfDirty(View.java:15175)
at android.view.View.draw(View.java:15954)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.draw(View.java:16187)
at android.view.View.updateDisplayListIfDirty(View.java:15180)
at android.view.View.draw(View.java:15954)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.updateDisplayListIfDirty(View.java:15175)
at android.view.View.draw(View.java:15954)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.updateDisplayListIfDirty(View.java:15175)
at android.view.View.draw(View.java:15954)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.support.v4.widget.DrawerLayout.drawChild(DrawerLayout.java:1369)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.updateDisplayListIfDirty(View.java:15175)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
at android.view.View.updateDisplayListIfDirty(View.java:15140)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
at android.view.View.updateDisplayListIfDirty(View.java:15140)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
at android.view.View.updateDisplayListIfDirty(View.java:15140)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
at android.view.View.updateDisplayListIfDirty(View.java:15140)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
at android.view.View.updateDisplayListIfDirty(View.java:15140)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
at android.view.View.updateDisplayListIfDirty(View.java:15140)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:281)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:287)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:322)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2615)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2434)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2067)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:606)
at android.view.Choreographer$FrameDisplayEventReceiver.ru
I need of distinguishing between padding left and other paddings of fastscroll.
Now all paddings have the same value : fastscroll_scrollbar_padding.
Can you separate them with for example
fastscroll_scrollbar_padding_left
fastscroll_scrollbar_padding_top
ecc...?
Thanks
When you scroll down, the SwipeRefresh call is triggered. But the scroll goes up perfectly. A temporary solution is to set the SweepRefresh setEnabled(false) on start scrolling and setEnabled(true) on stop
It would be very useful to have an interface to determine when fast scrolling has begun and ended (and possibly any states/offsets in between).
In my case, I have a layout that includes a FastScrollRecyclerView and a FloatingActionButton in a FrameLayout. I want to be able to hide the FAB when a user is fast scrolling - as the fast scroll popup goes under the FAB - and show it again when the user stops.
This may also help to solve the issue of the RecyclerView.onScrollListener not being called for scrollToPosition (see: http://stackoverflow.com/questions/27819507/recyclerview-scrolltoposition-not-trigger-scrolllistener).
The cells in my example have all equal heights except one (one label wraps and has two lines). Whenever I fast scroll over the one higher cell the scroll and the indicator flickers and jumps up and down.
The width of the scroll thumb should be changeable. The FastScroll thumb is about twice the width of the original one.
it's working very well. but I want to show item first letter in bubbleText. how can I achieve this?
final GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 2);
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
return mFileModelCardAdapter.isHeader(position) ?
gridLayoutManager.getSpanCount() : 1;
}
});
mRecyclerView.setLayoutManager(gridLayoutManager);
if i use GridLayoutManager,how can i get correct height?
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
switch (mReAdapter.getItemViewType(position)) {
case R.layout.album_item_header:
return 3;
default:
return 1;
}
}
});
rv_fastScroll.setLayoutManager(gridLayoutManager);
rv_fastScroll.setAdapter(mReAdapter);
@Override
public int getViewTypeHeight(RecyclerView recyclerView, int viewType) {
//recyclerView.getResources().getDimensionPixelSize(R.dimen.list_item_height)
return viewType == R.layout.album_item_header ? DeviceConstant.HEIGHT * ImageSpecial.Spec.PX_90 / ImageSpecial.Spec.PX_HEIGHT : viewType == R.layout.album_item ? DeviceConstant.HEIGHT * ImageSpecial.Spec.PX_248 / 3 / ImageSpecial.Spec.PX_HEIGHT : 0;
}
If the adapter of the recycler view is not (yet) set, the recycler view crashes with a NullPointerException on the first frame to draw (calling getItemCount() on the null adapter).
This is counter intuitive and annoying especially when working with loaders or even cursor loaders. You have to write the adapter null safe and instantiate and set an empty adapter with a null cursor every time the loader is reset. This is an ugly workaround.
LinearLayoutManager
and GridLayoutManager
are OK, but StaggeredGridLayoutManager
is not.
The error occurs here:
com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
...
LinearLayoutManager layoutManager = ((LinearLayoutManager) getLayoutManager());
...
This is important to make it work with a collapsing toolbar for example. In this case the bottom padding changes when the toolbar collapses/expands. Because of that, currently a part of the fastscroller moves out of the screen when the toolbar is expanded.
Not really related to the CollapsingToolbarLayout, but a definite issue none the less. The FastScroll should respect the padding of its parent.
I followed your tutorial but the problem is that each item in my recyclerview has two elements (in other words two TextViews) and now I get an error on this part :
@NonNull @Override public String getSectionName(int position) { return String.valueOf(position); }
PS: I want to set the scrollbar on one element only not the two of them
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.