diff --git a/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewActivity.kt b/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewActivity.kt index d906429..2acf1ce 100644 --- a/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewActivity.kt +++ b/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewActivity.kt @@ -25,7 +25,7 @@ import androidx.recyclerview.widget.RecyclerView import io.reactivex.disposables.CompositeDisposable import io.reactivex.disposables.Disposable -abstract class BaseRecycleViewActivity, T : IsSame> : AppCompatActivity(), View.OnClickListener { +abstract class BaseRecycleViewActivity, T : IsSame> : AppCompatActivity(), View.OnClickListener { lateinit var mBinding: DB lateinit var mViewModel: VM protected var mCompositeDisposable = CompositeDisposable() diff --git a/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewAdapter.kt b/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewAdapter.kt index 8368bde..ac68b72 100644 --- a/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewAdapter.kt +++ b/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewAdapter.kt @@ -11,7 +11,7 @@ import androidx.databinding.ViewDataBinding import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.RecyclerView -abstract class BaseRecycleViewAdapter : RecyclerView.Adapter>() { +abstract class BaseRecycleViewAdapter> : RecyclerView.Adapter() { protected var mData: List? = ArrayList() protected var mListener: OnClickListener? = null @@ -47,7 +47,7 @@ abstract class BaseRecycleViewAdapter : RecyclerView.Adapter { + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): VH { return createHolder(parent, viewType) } @@ -56,12 +56,12 @@ abstract class BaseRecycleViewAdapter : RecyclerView.Adapter + protected abstract fun createHolder(parent: ViewGroup, viewType: Int): VH /** * 子类不用继承 */ - override fun onBindViewHolder(holder: BaseViewHolder<*>, position: Int) { + override fun onBindViewHolder(holder: VH, position: Int) { holder.binding.root.setOnClickListener { if (mListener != null) { mListener!!.onClick(position) diff --git a/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewFragment.kt b/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewFragment.kt index 29c8874..8d4498e 100644 --- a/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewFragment.kt +++ b/mvvmbase/src/main/java/com/bing/mvvmbase/base/recycleview/BaseRecycleViewFragment.kt @@ -28,7 +28,7 @@ import androidx.recyclerview.widget.RecyclerView import io.reactivex.disposables.CompositeDisposable import io.reactivex.disposables.Disposable -abstract class BaseRecycleViewFragment, T : IsSame> : Fragment(), View.OnClickListener { +abstract class BaseRecycleViewFragment, T : IsSame> : Fragment(), View.OnClickListener { lateinit var mBinding: DB lateinit var mViewModel: VM lateinit var mActivityViewModel: AVM