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

Commit 73610b37 authored by Steve McKay's avatar Steve McKay
Browse files

Include padding in calculation of column count.

Also rename background color and don't sepcify background in grid items.

Change-Id: I4b565604156864384626e75f0bfd41c98623f90a
parent 08a38b68
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -46,6 +46,6 @@
        android:clipToPadding="false"
        android:scrollbarStyle="outsideOverlay"
        android:drawSelectorOnTop="true"
        android:background="@color/item_doc_grid_background" />
        android:background="@color/directory_background" />

</com.android.documentsui.DirectoryView>
+0 −1
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="@dimen/grid_item_height"
    android:background="@color/item_doc_grid_background"
    android:padding="@dimen/grid_item_padding">

    <ImageView
+1 −1
Original line number Diff line number Diff line
@@ -15,6 +15,6 @@
-->

<resources>
    <color name="item_doc_grid_background">#ff111111</color>
    <color name="directory_background">#ff111111</color>
    <color name="item_doc_grid_protect_background">#88ffffff</color>
</resources>
+1 −1
Original line number Diff line number Diff line
@@ -18,6 +18,6 @@
    <color name="material_grey_50">#fffafafa</color>
    <color name="material_grey_300">#ffeeeeee</color>

    <color name="item_doc_grid_background">@color/material_grey_300</color>
    <color name="directory_background">@color/material_grey_300</color>
    <color name="item_doc_grid_protect_background">#88000000</color>
</resources>
+6 −2
Original line number Diff line number Diff line
@@ -510,8 +510,12 @@ public class DirectoryFragment extends Fragment {
            case MODE_GRID:
                thumbSize = getResources().getDimensionPixelSize(R.dimen.grid_width);
                if (mGridLayout == null) {
                    int columnCount = Math.max(1, mRecView.getWidth() / thumbSize);
                    mGridLayout = new GridLayoutManager(getContext(), columnCount);
                    int itemPadding =
                            getResources().getDimensionPixelSize(R.dimen.grid_item_padding);
                    int viewPadding = mRecView.getPaddingLeft() + mRecView.getPaddingRight();
                    int columnCount =
                            (mRecView.getWidth() - viewPadding) / (thumbSize + itemPadding);
                    mGridLayout = new GridLayoutManager(getContext(), Math.max(1, columnCount));
                }
                layout = mGridLayout;
                break;