Created
October 29, 2020 15:57
-
-
Save yogeshpaliyal/dcb381941b9f0dec2cb366c85f8ce15b to your computer and use it in GitHub Desktop.
Universal RecyclerView Adapters Initialize
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val mAdapter by lazy { | |
UniversalRecyclerAdapter<UserModel>( | |
R.layout.item_user, | |
resourceShimmer = R.layout.layout_loading_full_page, | |
defaultShimmerItems = 1, | |
mListener = object : BasicListener<UserModel> { | |
override fun onClick(model: UserModel) { | |
Toast.makeText(this@LoadingListingActivity, model.name, Toast.LENGTH_SHORT) | |
.show() | |
} | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val mAdapter by lazy { | |
UniversalRecyclerAdapter<MultiSelectModel>( | |
R.layout.item_multi_select, | |
mListener = object : BasicListener<MultiSelectModel> { | |
override fun onClick(model: MultiSelectModel) { | |
mViewModel.logData() | |
} | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val mAdapter by lazy { | |
UniversalRecyclerAdapter<UserModel>( | |
R.layout.item_user, | |
resourceShimmer = R.layout.item_user_shimmer, | |
defaultShimmerItems = 5, | |
loaderFooter = R.layout.item_loading_more, | |
mListener = object : BasicListener<UserModel> { | |
override fun onClick(model: UserModel) { | |
Toast.makeText(this@PaginationListingActivity, model.name, Toast.LENGTH_SHORT) | |
.show() | |
} | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val mAdapter by lazy { | |
UniversalRecyclerAdapter<UserModel>( | |
R.layout.item_user, resourceShimmer = R.layout.item_user_shimmer, | |
defaultShimmerItems = 5, | |
mListener = object : BasicListener<UserModel> { | |
override fun onClick(model: UserModel) { | |
Toast.makeText(this@ShimmerListingActivity, model.name, Toast.LENGTH_SHORT) | |
.show() | |
} | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val mAdapter by lazy { | |
UniversalRecyclerAdapter<BasicModel>( | |
R.layout.item_simple, | |
mListener = object : BasicListener<BasicModel> { | |
override fun onClick(model: BasicModel) { | |
Toast.makeText(this@BasicListingActivity, model.name, Toast.LENGTH_SHORT).show() | |
} | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val mAdapter by lazy { | |
UniversalRecyclerAdapter<UserModel>( | |
R.layout.item_user, | |
mListener = object : BasicListener<UserModel> { | |
override fun onClick(model: UserModel) { | |
Toast.makeText(this@UserListingActivity, model.name, Toast.LENGTH_SHORT).show() | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment