Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 709b61de authored by Steve McKay's avatar Steve McKay
Browse files

Pick column count based on available space.

Set background color of RecyclerView.

BUG: 22640007
BUG: 22672201
Change-Id: Ic9c65a2a25164698bc08b4620bfa0b067d620f1b
parent 3b409d01
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@
        android:paddingBottom="@dimen/grid_padding_vert"
        android:clipToPadding="false"
        android:scrollbarStyle="outsideOverlay"
        android:drawSelectorOnTop="true" />
        android:drawSelectorOnTop="true"
        android:background="@color/item_doc_grid_background" />

</com.android.documentsui.DirectoryView>
+4 −4
Original line number Diff line number Diff line
@@ -510,18 +510,18 @@ public class DirectoryFragment extends Fragment {
        final LayoutManager layout;
        switch (mode) {
            case MODE_GRID:
                thumbSize = getResources().getDimensionPixelSize(R.dimen.grid_width);
                if (mGridLayout == null) {
                    // TODO: Determine appropriate column count.
                    mGridLayout = new GridLayoutManager(getContext(), 4);
                    int columnCount = Math.max(1, mRecView.getWidth() / thumbSize);
                    mGridLayout = new GridLayoutManager(getContext(), columnCount);
                }
                thumbSize = getResources().getDimensionPixelSize(R.dimen.grid_width);
                layout = mGridLayout;
                break;
            case MODE_LIST:
                thumbSize = getResources().getDimensionPixelSize(R.dimen.icon_size);
                if (mListLayout == null) {
                    mListLayout = new LinearLayoutManager(getContext());
                }
                thumbSize = getResources().getDimensionPixelSize(R.dimen.icon_size);
                layout = mListLayout;
                break;
            case MODE_UNKNOWN: