Fix scrollbars

Fixes #5487
Closes #5671

// FREEBIE
master
Christian Ascheberg 2016-09-07 21:26:34 +02:00 committed by Moxie Marlinspike
parent 32f5bd5336
commit 3432db37d9
3 changed files with 7 additions and 3 deletions

View File

@ -12,7 +12,8 @@
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:scrollbars="vertical" />
<TextView android:id="@android:id/empty"
android:layout_width="match_parent"

View File

@ -9,7 +9,8 @@
<android.support.v7.widget.RecyclerView
android:id="@+id/media_grid"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:scrollbars="vertical" />
<TextView android:id="@+id/no_images"
android:layout_width="match_parent"

View File

@ -162,7 +162,9 @@ 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) {
boolean useFastScroller = (recyclerView.getAdapter().getItemCount() > 20);
recyclerView.setVerticalScrollBarEnabled(!useFastScroller);
if (useFastScroller) {
fastScroller.setVisibility(View.VISIBLE);
fastScroller.setRecyclerView(recyclerView);
}