mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
don't allow fast scrolling until data is available
fixes #4666 closes #4693 // FREEBIE
This commit is contained in:
parent
473e470883
commit
d58f4d1232
@ -28,6 +28,7 @@
|
||||
android:id="@+id/fast_scroller"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
android:layout_gravity="right"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
@ -101,7 +101,6 @@ public class ContactSelectionListFragment extends Fragment
|
||||
swipeRefresh = ViewUtil.findById(view, R.id.swipe_refresh);
|
||||
fastScroller = ViewUtil.findById(view, R.id.fast_scroller);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
fastScroller.setRecyclerView(recyclerView);
|
||||
|
||||
swipeRefresh.setEnabled(getActivity().getIntent().getBooleanExtra(REFRESHABLE, true) &&
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN);
|
||||
@ -163,11 +162,16 @@ public class ContactSelectionListFragment extends Fragment
|
||||
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
|
||||
((CursorRecyclerViewAdapter) recyclerView.getAdapter()).changeCursor(data);
|
||||
emptyText.setText(R.string.contact_selection_group_activity__no_contacts);
|
||||
if (recyclerView.getAdapter().getItemCount() > 20) {
|
||||
fastScroller.setVisibility(View.VISIBLE);
|
||||
fastScroller.setRecyclerView(recyclerView);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoaderReset(Loader<Cursor> loader) {
|
||||
((CursorRecyclerViewAdapter) recyclerView.getAdapter()).changeCursor(null);
|
||||
fastScroller.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
private class ListClickListener implements ContactSelectionListAdapter.ItemClickListener {
|
||||
|
Loading…
Reference in New Issue
Block a user