fix crash when recycler view is null

This commit is contained in:
sk
2023-01-23 12:23:15 +01:00
parent 1b23ef31d5
commit dab0c560e9

View File

@@ -1,11 +1,13 @@
package org.joinmastodon.android.fragments;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
public interface IsOnTop {
boolean isOnTop();
default boolean isRecyclerViewOnTop(RecyclerView list) {
default boolean isRecyclerViewOnTop(@Nullable RecyclerView list) {
if (list == null) return true;
return !list.canScrollVertically(-1);
}
}