From 9fc012e45b74f7ac3862659921153ea0a9301a9f Mon Sep 17 00:00:00 2001 From: Jieyi Date: Fri, 13 Jul 2018 16:44:17 +0900 Subject: [PATCH] Fixed: fixed the children item won't fit the width and height not for androidx. --- .../com/devrapid/adaptiverecyclerview/AdaptiveAdapter.kt | 5 +++-- gradle.properties | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) 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