This file contains hidden or 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
addOnItemTouchListener( | |
object : RecyclerView.OnItemTouchListener { | |
private var startX = 0f | |
override fun onInterceptTouchEvent( | |
recyclerView: RecyclerView, | |
event: MotionEvent | |
): Boolean = | |
when (event.action) { | |
MotionEvent.ACTION_DOWN -> { startX = event.x } |
This file contains hidden or 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
interface IComponent { | |
val dataSource: Any | |
val layoutRes: Int | |
val bindingKey: Int | |
} |
This file contains hidden or 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
/* | |
* before | |
*/ | |
class ViewModel { | |
val nameInput = MutableLiveData("") | |
val ageInput = MutableLiveData(0) | |
} | |
<layout> | |
<data> |
This file contains hidden or 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
sealed class MergerLiveData<TargetType> : MediatorLiveData<TargetType>() { | |
// One | |
class Two<FirstSourceType, SecondSourceType, TargetType>( | |
private val firstSource: LiveData<FirstSourceType>, | |
private val secondSource: LiveData<SecondSourceType>, | |
private val distinctUntilChanged: Boolean = true, | |
private val merging: (FirstSourceType, SecondSourceType) -> TargetType | |
) : MediatorLiveData<TargetType>() { | |
override fun onActive() { |
This file contains hidden or 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
### Keybase proof | |
I hereby claim: | |
* I am danielknauf on github. | |
* I am knaufdan (https://keybase.io/knaufdan) on keybase. | |
* I have a public key ASBKEDkmhoAWM1v67IGHFio1viMY65i9dwUppIdYTw82GQo | |
To claim this, I am signing this object: |