Skip to content

kotlin/recyclerview-adapters#92

Open
saifer2505 wants to merge 3 commits intofeature/kotlinfrom
kotlin/recyclerview-adapters
Open

kotlin/recyclerview-adapters#92
saifer2505 wants to merge 3 commits intofeature/kotlinfrom
kotlin/recyclerview-adapters

Conversation

@saifer2505
Copy link
Copy Markdown
Contributor

recyclerview-adapters: Java => Kotlin

Copy link
Copy Markdown
Contributor

@maxbach maxbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Запусти статик

</TItem></TViewHolder> */
abstract class ItemAdapterDelegate<TViewHolder : RecyclerView.ViewHolder, TItem> : AdapterDelegate<TViewHolder>() {

override fun isForViewType(items: List<*>, adapterPosition: Int, collectionPosition: Int): Boolean {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without return

abstract class ItemAdapterDelegate<TViewHolder : RecyclerView.ViewHolder, TItem> : AdapterDelegate<TViewHolder>() {

override fun isForViewType(items: List<*>, adapterPosition: Int, collectionPosition: Int): Boolean {
return (collectionPosition >= 0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Скобки лишние

override fun isForViewType(items: List<*>, adapterPosition: Int, collectionPosition: Int): Boolean {
return (collectionPosition >= 0
&& collectionPosition < items.size
&& isForViewType(items[collectionPosition]!!, adapterPosition, collectionPosition))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

force unwrap

* @param collectionPosition Position of item in collection that contains item;
* @return True if item is processable by this delegate.
*/
open fun isForViewType(item: Any, adapterPosition: Int, collectionPosition: Int): Boolean {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without return

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Везде

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants