Fix crash on theme switching, reworded settings for catalouges

This commit is contained in:
Jay 2020-03-11 00:46:55 -07:00
parent dbf5424b77
commit f2a45e5b53
3 changed files with 4 additions and 2 deletions

View File

@ -339,6 +339,7 @@ fun Controller.scrollViewWith(recycler: RecyclerView,
super.onScrolled(recyclerView, dx, dy)
if (router?.backstack?.lastOrNull()?.controller() == this@scrollViewWith &&
statusBarHeight > -1 &&
activity != null &&
activity!!.appbar.height > 0) {
activity!!.appbar.y -= dy
activity!!.appbar.y = clamp(
@ -353,7 +354,7 @@ fun Controller.scrollViewWith(recycler: RecyclerView,
super.onScrollStateChanged(recyclerView, newState)
if (newState == RecyclerView.SCROLL_STATE_IDLE) {
if (router?.backstack?.lastOrNull()?.controller() == this@scrollViewWith &&
statusBarHeight > -1 &&
statusBarHeight > -1 && activity != null &&
activity!!.appbar.height > 0) {
val halfWay = abs((-activity!!.appbar.height.toFloat()) / 2)
val shortAnimationDuration = resources?.getInteger(

View File

@ -11,7 +11,7 @@
app:actionViewClass="androidx.appcompat.widget.SearchView"/>
<item android:id="@+id/action_filter"
android:title="@string/action_filter"
android:title="@string/action_view_all_sources"
android:icon="@drawable/ic_filter_list_white_24dp"
app:showAsAction="never"/>

View File

@ -42,6 +42,7 @@
<!-- Actions -->
<string name="action_filter">Filter</string>
<string name="action_view_all_sources">View all sources</string>
<string name="action_view_options">View options</string>
<string name="action_filter_downloaded">Downloaded</string>
<string name="action_filter_not_downloaded">Not downloaded</string>