-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 After rebase fixes
- Loading branch information
David Sucharda
committed
Mar 2, 2022
1 parent
fcb3c8c
commit 5ed54b0
Showing
7 changed files
with
44 additions
and
94 deletions.
There are no files selected for viewing
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
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
9 changes: 5 additions & 4 deletions
9
kaal-presentation/src/main/kotlin/cz/eman/kaal/presentation/adapter/BindingAdapterConfig.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
package cz.eman.kaal.presentation.adapter | ||
|
||
import android.view.View | ||
import androidx.recyclerview.widget.DiffUtil | ||
import cz.eman.kaal.presentation.adapter.binder.ItemBinder | ||
import cz.eman.kaal.presentation.adapter.binder.VariableBinder | ||
|
||
/** | ||
* Wrapper data class for Binding adapter configuration. It is used when binding adapter is being created. Holds only | ||
* common information and all extending information must be handled separately. | ||
* | ||
* @property items displayed in the adapter | ||
* @property itemBinder defines layout for specific item types | ||
* @property variableBinders allows sending custom variables to the layout | ||
* @property itemClickListener enables to handle item click (not sub-view click) | ||
* @property itemLongClickListener enables to handle item long click (not sub-view click) | ||
* @property limit of how many items can be displayed | ||
* @property differ used to compare items | ||
* @author: eMan a.s. | ||
* @since 0.9.0 | ||
*/ | ||
data class BindingAdapterConfig<T : Any>( | ||
val items: Collection<T>?, | ||
class BindingAdapterConfig<T : Any>( | ||
val itemBinder: ItemBinder<T>, | ||
val variableBinders: Array<VariableBinder<T>>?, | ||
val itemClickListener: ((View, T) -> Unit)?, | ||
val itemLongClickListener: ((View, T) -> Unit)?, | ||
val limit: Int? = null | ||
val limit: Int? = null, | ||
val differ: DiffUtil.ItemCallback<T>? = null | ||
) |
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
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
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
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