BaseRecyclerViewAdapterHelper icon indicating copy to clipboard operation
BaseRecyclerViewAdapterHelper copied to clipboard

3.0.7版本有个问题,BaseQuickAdapter中bindViewClickListener中viewHolder.bindingAdapterPosition方法没有

Open AngGoGo opened this issue 2 years ago • 10 comments

AngGoGo avatar Apr 22 '22 09:04 AngGoGo

亲测改成kt,可以使用 holder.adapterPosition;

shunplus avatar Apr 28 '22 10:04 shunplus

我也没找到

TopTime1 avatar May 08 '22 12:05 TopTime1

解决,具体是替换为viewHolder.adapterPosition;

thiskiller avatar May 10 '22 10:05 thiskiller

java 找不到这个

TopTime1 avatar May 10 '22 11:05 TopTime1

demo中,升级recyclerView版本就可

anthui avatar May 20 '22 07:05 anthui

java不兼容

xybCoder avatar May 23 '22 08:05 xybCoder

可以自己copy一份代碼

xybCoder avatar May 23 '22 08:05 xybCoder

这是因为library里面compileOnly 'androidx.recyclerview:recyclerview:1.2.1',使用的版本是1.2.1,bindingAdapterPosition是1.2.1里的,但是demo里的recycleView是1.1.0的,就出问题了,升级一下demo版本吧

hply avatar May 30 '22 06:05 hply

提供一个解决方法,不需要拉下来本地修改,在app的build中加入(我用的kotlin dsl)

subprojects {
	project.configurations.all {
        //遍历所有依赖库,通过判断 requested.group 和 requested.name 来指定使用的版本
        resolutionStrategy.eachDependency {
            if ("androidx.recyclerview".equals(requested.group)) {
                "1.2.1".let {
                    if ("recyclerview".equals(requested.module.name) && !it.equals(requested.version)) {
                        this.useVersion(it)
                    }
                }
            }

        }

    }
}

AlbertZyc avatar Aug 25 '22 06:08 AlbertZyc

强迫症可以试下 自定义一个类继承BaseViewHolder

open class BaseViewHolderEx (view: View) : BaseViewHolder(view) {
    open fun  getItemView() : View {
        return itemView
    }

    open fun  getAdapterItemViewType() : Int {
        return itemViewType
    }
}

然后再Adapter里把BaseViewHolder替换成BaseViewHolderEx 其他在Java里爆红的可以在里面添加就ok了

GXSZone avatar Sep 05 '22 16:09 GXSZone