bubblescrollbar's People
bubblescrollbar's Issues
Not usable in real life
Library is suitable only for adapter which data does not change at all. When attaching to recyclerview with adapter which initially has emty data list, and then updating the adapter, scrollbar hides and never gets showed
Can this be used also for RecyclerView that using GridLayoutManager?
I see an example of your project using LinearLayoutManager
. I what to try this library because it looks useful, but my RecyclerView
is using GridLayoutManager
and the scrollbar not showing up. Is this because the layout manager or something else?
define layout manager:
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
val layoutManager = GridLayoutManager(context, 6)
layoutManager.spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() {
override fun getSpanSize(position: Int): Int {
return Math.min(6, if (listProdukAdapter == null) 2 else listProdukAdapter!!.getItemViewType(position))
}
}
recycler_view.setHasFixedSize(true)
recycler_view.layoutManager = layoutManager
recycler_view.addOnScrollListener(object : MyRecyclerViewScroll() {
override fun hide() = frg.hideBar()
override fun show() = frg.showBar()
})
...
}
setting adapter & bubble scrollbar:
listProdukBeli = listProduk.lisT_PRODUK.toMutableList()
listProdukAdapter = ListProdukAdapter(context!!, listProdukBeli!!, act, "beli")
recycler_view.adapter = listProdukAdapter
bubbleScrollBar.attachToRecyclerView(recycler_view)
bubbleScrollBar.bubbleTextProvider = BubbleTextProvider { listProdukBeli!![it].kategori }
For the bubbleTextProvider, I'm getting the category
value of my product list.
my layout:
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingTop="120dp"
android:paddingBottom="70dp"
android:scrollbars="vertical"
android:visibility="visible"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<com.trendyol.bubblescrollbarlib.BubbleScrollBar
android:id="@+id/bubbleScrollBar"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="end"
android:orientation="vertical"
android:paddingTop="120dp"
android:paddingBottom="70dp"
app:bubbleBackground="@drawable/fast_scroll_thumb"
app:bubbleElevation="6dp"
app:bubbleHeight="50dp"
app:bubbleMargin="4dp"
app:bubbleMinWidth="50dp"
app:bubblePadding="4dp"
app:bubbleTextColor="@color/default_bubble_text_color"
app:bubbleTextSize="8sp"
app:scrollbarBackground="@color/bubbleRed"
app:thumbBackground="@color/colorAccent" />
</FrameLayout>
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.