forked from organicmaps/organicmaps
[android] Scroll to start list results.
This commit is contained in:
parent
db059d77b6
commit
72daad486c
2 changed files with 7 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/scroll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?windowBackgroundForced"
|
||||
|
|
|
@ -18,6 +18,7 @@ import androidx.annotation.NonNull;
|
|||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.SimpleItemAnimator;
|
||||
|
@ -96,6 +97,8 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<BookmarkListA
|
|||
private RecyclerView mCollectionRecyclerView;
|
||||
@NonNull
|
||||
private BookmarkManager.BookmarksCatalogListener mCatalogListener;
|
||||
@NonNull
|
||||
private NestedScrollView mNestedScrollView;
|
||||
|
||||
@NonNull
|
||||
private final RecyclerView.OnScrollListener mRecyclerListener = new RecyclerView.OnScrollListener()
|
||||
|
@ -180,6 +183,8 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<BookmarkListA
|
|||
mDescriptionView = view.findViewById(R.id.guide_info);
|
||||
configureGuidesInfoLayout();
|
||||
|
||||
mNestedScrollView = view.findViewById(R.id.scroll_view);
|
||||
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
ActionBar bar = ((AppCompatActivity) requireActivity()).getSupportActionBar();
|
||||
|
@ -384,6 +389,7 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<BookmarkListA
|
|||
BookmarkListAdapter adapter = getAdapter();
|
||||
adapter.setSearchResults(bookmarkIds);
|
||||
adapter.notifyDataSetChanged();
|
||||
mNestedScrollView.smoothScrollTo(0, 0);
|
||||
updateRecyclerVisibility();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue