Skip to content

Commit

Permalink
kotin demo #15
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenCoder committed Jul 24, 2019
1 parent cbec3df commit 69576b6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/src/main/java/com/allen/kotlinapp/ItemClickActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ class ItemClickActivity : BaseActivity() {
val adapterData: MutableList<ClickEntity> = adapter.data
toast(adapterData.size)
}
adapter.onItemLongClickListener = BaseQuickAdapter.OnItemLongClickListener { _, _, position ->
Log.d(TAG, "onItemLongClick: ")

toast( "onItemLongClick" + position)
adapter.setOnItemLongClickListener{ madapter, view, position ->
Log.d(TAG, "onItemClick: ")
toast("onItemClick" + position)
val adapterData: MutableList<ClickEntity> = madapter.data as MutableList<ClickEntity>
toast(adapterData.size)
true
}
adapter.onItemChildClickListener = BaseQuickAdapter.OnItemChildClickListener { _, _, position ->
Expand Down Expand Up @@ -138,7 +139,7 @@ class ItemClickActivity : BaseActivity() {
data.add(ClickEntity(ClickEntity.LONG_CLICK_ITEM_CHILD_VIEW))
data.add(ClickEntity(ClickEntity.NEST_CLICK_ITEM_CHILD_VIEW))
adapter = ItemClickAdapter(data)
adapter?.openLoadAnimation()
adapter.openLoadAnimation()
mRecyclerView?.adapter = adapter
}

Expand Down

0 comments on commit 69576b6

Please sign in to comment.