import android.view.View import com.chad.library.adapter.base.viewholder.BaseViewHolder class XBaseViewHolder(view: View) : BaseViewHolder(view) { fun getItemPosition(): Int { return layoutPosition } fun getItemViewsType(): Int { return itemViewType } }用Java代码写
时间: 2023-12-03 10:47:12 浏览: 60
android 通用的ViewHolder实现
5星 · 资源好评率100%
Here's the equivalent code in Java:
```java
import android.view.View;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
public class XBaseViewHolder extends BaseViewHolder {
public XBaseViewHolder(View view) {
super(view);
}
public int getItemPosition() {
return getLayoutPosition();
}
public int getItemViewType() {
return getItemViewType();
}
}
```
阅读全文