@@ -18,9 +18,12 @@ and attach it. Everything else is handled for you.
18
18
19
19
Implementations of ` CarouselAdapter ` have a default / standard ` ViewHolder ` baked
20
20
in for use if desired - called ` DefaultCarouselViewHolder ` . It has a simple
21
- indeterminate loading circle . If you are not interested in this pre-packaged ViewHolder,
22
- ` onCreateViewHolder ` and ` onBindViewHolder ` should return and work with your own
23
- implementation of a ` CarouselAdapter.CarouselViewHolder ` .
21
+ indeterminate loading circle . You can get an instance of this ViewHolder by calling
22
+ ` CarouselAdapter.getDefaultCarouselViewHolder(parentView) `
23
+
24
+ If you are not interested in this pre-packaged ViewHolder, ` onCreateViewHolder `
25
+ and ` onBindViewHolder ` should return and work with your own implementation of
26
+ a ` CarouselAdapter.CarouselViewHolder ` .
24
27
25
28
Currently active item indicators are also automatically created and kept in sync
26
29
with the carousel's ViewPager.
@@ -39,7 +42,7 @@ the AndroidX RecyclerView package or the ViewPager2 package.
39
42
=> See [ ViewPager2 Releases] ( https://developer.android.com/jetpack/androidx/releases/viewpager2 ) for the latest ViewPager2 version(s)
40
43
41
44
```
42
- implementation 'com.meetarp:carousel:1.0.4 '
45
+ implementation 'com.meetarp:carousel:1.0.5 '
43
46
44
47
// and one of...
45
48
implementation 'androidx.viewpager2:viewpager2:$viewPager2_version'
@@ -147,7 +150,7 @@ override fun onBindViewHolder(holder: CarouselViewHolder, position: Int) {
147
150
}
148
151
```
149
152
150
- ## Working with data
153
+ ## Working with changing data
151
154
152
155
If you find that you need to update your carousel items after its initial population,
153
156
you will have to call ` adapter.setItems(newList) ` with the new data.
@@ -165,9 +168,8 @@ Please see `CarouselAdapter.setItems()` if this is unclear.
165
168
166
169
## DefaultCarouselViewHolder
167
170
168
- The default implementations of ` onCreateViewHolder ` and ` onBindViewHolder ` for the
169
- ` CarouselAdapter ` abstract class provide an instance of ` DefaultCarouselViewHolder `
170
- with publicly exposed members:
171
+ ` CarouselAdapter.getDefaultCarouselViewHolder(parentView) ` provides an instance
172
+ of ` DefaultCarouselViewHolder ` with publicly exposed members:
171
173
172
174
* container (ViewGroup - RelativeLayout)
173
175
* progressBar (ProgressBar)
0 commit comments