Skip to content

Commit

Permalink
Fixed: fixed the children item won't fit the width and height.
Browse files Browse the repository at this point in the history
  • Loading branch information
pokk committed Jul 13, 2018
1 parent 6f656f2 commit 1fa833a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.devrapid.adaptiverecyclerview

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
Expand Down Expand Up @@ -46,7 +47,8 @@ abstract class AdaptiveAdapter<VT : ViewTypeFactory, M : IVisitable<VT>, VH : Re
(holder as AdaptiveViewHolder<VT, M>).initView(this.dataList[position], position, this)

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): VH {
val itemView: View = View.inflate(parent.context, this.typeFactory.getLayoutResource(viewType), null)
val itemView: View =
LayoutInflater.from(parent.context).inflate(this.typeFactory.getLayoutResource(viewType), parent, false)

return this.typeFactory.createViewHolder(viewType, itemView) as VH
}
Expand All @@ -68,4 +70,6 @@ abstract class AdaptiveAdapter<VT : ViewTypeFactory, M : IVisitable<VT>, VH : Re
repeat(endIndex - startIndex + 1) { dataList.removeAt(startIndex) }
notifyDataSetChanged()
}

fun clearList() = dropList(0, dataList.size - 1)
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ proj_name=adaptiverecyclerview
proj_libname=AdaptiveRecyclerview
proj_group=com.devrapid.jieyi
proj_artifactid=adaptiverecyclerview
proj_version=1.0.1
proj_version=1.0.2
proj_description=Create an adaptive recycler view for each of type view.
proj_websiteurl=https://github.com/pokk/AdaptiveRecyclerView
proj_issuetrackerurl=https://github.com/pokk/AdaptiveRecyclerView/issues
Expand Down

0 comments on commit 1fa833a

Please sign in to comment.