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

Commit f34f094d authored by Steve McKay's avatar Steve McKay
Browse files

Make gutter between folders and docs smaller.

And shrink margin around grid by 1.

Change-Id: I36ebc23b8d7d4748f846f582614ba7835927c1d4
parent 2379a562
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -28,7 +28,8 @@
    <dimen name="grid_height">176dp</dimen>
    <dimen name="grid_item_width">152dp</dimen>
    <dimen name="grid_item_height">176dp</dimen>
    <dimen name="grid_item_margin">7dp</dimen>
    <dimen name="grid_section_separator_height">0dp</dimen>
    <dimen name="grid_item_margin">6dp</dimen>
    <dimen name="grid_padding_horiz">4dp</dimen>
    <dimen name="grid_padding_vert">4dp</dimen>
    <dimen name="list_item_height">72dp</dimen>
+8 −2
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ final class SectionBreakDocumentsAdapterWrapper extends DocumentsAdapter {
        mDelegate.registerAdapterDataObserver(new EventRelay());
    }

    @Override
    public GridLayoutManager.SpanSizeLookup createSpanSizeLookup() {
        return new GridLayoutManager.SpanSizeLookup() {
            @Override
@@ -178,19 +179,23 @@ final class SectionBreakDocumentsAdapterWrapper extends DocumentsAdapter {
    // Listener we add to our delegate. This allows us to relay events published
    // by the delegate to our listeners (presumably RecyclerView) with adjusted positions.
    private final class EventRelay extends AdapterDataObserver {
        @Override
        public void onChanged() {
            throw new UnsupportedOperationException();
        }

        @Override
        public void onItemRangeChanged(int positionStart, int itemCount) {
            throw new UnsupportedOperationException();
        }

        @Override
        public void onItemRangeChanged(int positionStart, int itemCount, Object payload) {
            assert(itemCount == 1);
            notifyItemRangeChanged(toViewPosition(positionStart), itemCount, payload);
        }

        @Override
        public void onItemRangeInserted(int positionStart, int itemCount) {
            assert(itemCount == 1);
            if (positionStart < mBreakPosition) {
@@ -199,6 +204,7 @@ final class SectionBreakDocumentsAdapterWrapper extends DocumentsAdapter {
            notifyItemRangeInserted(toViewPosition(positionStart), itemCount);
        }

        @Override
        public void onItemRangeRemoved(int positionStart, int itemCount) {
            assert(itemCount == 1);
            if (positionStart < mBreakPosition) {
@@ -207,6 +213,7 @@ final class SectionBreakDocumentsAdapterWrapper extends DocumentsAdapter {
            notifyItemRangeRemoved(toViewPosition(positionStart), itemCount);
        }

        @Override
        public void onItemRangeMoved(int fromPosition, int toPosition, int itemCount) {
            throw new UnsupportedOperationException();
        }
@@ -221,9 +228,8 @@ final class SectionBreakDocumentsAdapterWrapper extends DocumentsAdapter {
        public EmptyDocumentHolder(Context context) {
            super(context, new Space(context));

            // Per UX spec, this puts a bigger gap between the folders and documents in the grid.
            mVisibleHeight = context.getResources().getDimensionPixelSize(
                    R.dimen.grid_item_margin);
                    R.dimen.grid_section_separator_height);
        }

        public void bind(State state) {