File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
app/src/main/java/com/hoc/pagination_mvi/ui/main Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,10 @@ class MainAdapter(
70
70
private val retryHorizontalS = PublishSubject .create<Unit >()
71
71
val retryHorizontalObservable get() = retryHorizontalS.asObservable()
72
72
73
+ /* *
74
+ *
75
+ */
76
+
73
77
override fun onCreateViewHolder (parent : ViewGroup , @LayoutRes viewType : Int ): VH {
74
78
val itemView = LayoutInflater .from(parent.context).inflate(viewType, parent, false )
75
79
return when (viewType) {
@@ -98,6 +102,10 @@ class MainAdapter(
98
102
@LayoutRes
99
103
override fun getItemViewType (position : Int ) = getItem(position).viewType
100
104
105
+ /* *
106
+ *
107
+ */
108
+
101
109
abstract class VH (itemView : View ) : RecyclerView.ViewHolder(itemView) {
102
110
abstract fun bind (item : Item )
103
111
}
@@ -193,8 +201,12 @@ class MainAdapter(
193
201
parent : RecyclerView ,
194
202
state : RecyclerView .State
195
203
) {
196
- outRect.left =
197
- if (parent.getChildAdapterPosition(view) == parent.adapter!! .itemCount - 1 ) 0 else 8
204
+ outRect.run {
205
+ right = if (parent.getChildAdapterPosition(view) == parent.adapter!! .itemCount - 1 ) 0 else 8
206
+ left = 0
207
+ top = 0
208
+ bottom = 0
209
+ }
198
210
}
199
211
})
200
212
}
@@ -254,6 +266,10 @@ class MainAdapter(
254
266
}
255
267
}
256
268
269
+ /* *
270
+ *
271
+ */
272
+
257
273
override fun onViewRecycled (holder : VH ) {
258
274
super .onViewRecycled(holder)
259
275
if (holder is HorizontalListVH ) {
You can’t perform that action at this time.
0 commit comments