Skip to content

Instantly share code, notes, and snippets.

View adolgiy's full-sized avatar

Aleksey Dolgiy adolgiy

View GitHub Profile
@adolgiy
adolgiy / BasePresenter.kt
Last active August 23, 2017 18:42
Shows one of comfort for me ways to design MVP with RxBindings
class BasePresenter {
private val detachDisposable = CompositeDisposable()
private val destroyDisposable = CompositeDisposable()
fun unsubscribeOnDetach(d: Disposable) {
detachDisposable.add(d)
}
fun unsubscribeOnDestroy(d: Disposable) {
<CoordinatorLayout>
<MyView app:layout_behavior="MyBehavior" />
<BottomSheet app:layout_behavior="BottomSheetBehavior"/>
<AppBarLayout app:layout_behavior="MyAppBarBehavior"/>
</CoordinatorLayout>