[BUGFIX] Controllato null su componenti grafiche come la toolbar

This commit is contained in:
2019-02-20 19:26:43 +01:00
parent 58b664a232
commit 9bef19636e
4 changed files with 11 additions and 7 deletions

View File

@@ -54,8 +54,10 @@ open class WaterfallToolbar : androidx.cardview.widget.CardView {
var scrollViewScrollListener : ViewTreeObserver.OnScrollChangedListener = ViewTreeObserver.OnScrollChangedListener {
// real position must always get updated
realPosition.value = scrollView!!.scrollY
mutualScrollListenerAction()
if(scrollView != null) {
realPosition.value = scrollView!!.scrollY
mutualScrollListenerAction()
}
}
/**
@@ -69,8 +71,10 @@ open class WaterfallToolbar : androidx.cardview.widget.CardView {
var nestedScrollViewScrollListener : ViewTreeObserver.OnScrollChangedListener = ViewTreeObserver.OnScrollChangedListener {
// real position must always get updated
realPosition.value = nestedScrollView!!.scrollY
mutualScrollListenerAction()
if(nestedScrollView != null) {
realPosition.value = nestedScrollView!!.scrollY
mutualScrollListenerAction()
}
}
/**