diff --git a/adaptiverecyclerview/src/main/java/com/devrapid/adaptiverecyclerview/AdaptiveAdapter.kt b/adaptiverecyclerview/src/main/java/com/devrapid/adaptiverecyclerview/AdaptiveAdapter.kt index 0b66f40..59e065c 100644 --- a/adaptiverecyclerview/src/main/java/com/devrapid/adaptiverecyclerview/AdaptiveAdapter.kt +++ b/adaptiverecyclerview/src/main/java/com/devrapid/adaptiverecyclerview/AdaptiveAdapter.kt @@ -1,7 +1,7 @@ package com.devrapid.adaptiverecyclerview import android.support.v7.widget.RecyclerView -import android.view.View +import android.view.LayoutInflater import android.view.ViewGroup /** @@ -46,7 +46,8 @@ abstract class AdaptiveAdapter, VH : Re (holder as AdaptiveViewHolder).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 = + LayoutInflater.from(parent.context).inflate(this.typeFactory.getLayoutResource(viewType), parent, false) return this.typeFactory.createViewHolder(viewType, itemView) as VH } diff --git a/gradle.properties b/gradle.properties index 4ed4422..37b6c67 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,7 +22,7 @@ proj_name=adaptiverecyclerview proj_libname=AdaptiveRecyclerview proj_group=com.devrapid.jieyi proj_artifactid=adaptiverecyclerview -proj_version=0.0.8 +proj_version=0.0.9 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 @@ -33,4 +33,4 @@ license_url='http://www.apache.org/licenses/LICENSE-2.0.txt' ## Developer information developer_id=pokk developer_name=Jieyi Wu -developer_email=pokkbaby@gmail.com \ No newline at end of file +developer_email=pokkbaby@gmail.com