Fix catalog layout having too much padding between the cards on <5

multisite
Floens 10 years ago
parent 876b67d146
commit b1b442cdfa
  1. 2
      Clover/app/proguard.cfg
  2. 3
      Clover/app/src/main/java/org/floens/chan/ui/layout/ThreadListLayout.java
  3. 3
      Clover/app/src/main/res/layout/cell_post_card.xml
  4. 20
      Clover/app/src/main/res/values-v21/dimens.xml
  5. 1
      Clover/app/src/main/res/values/dimens.xml

@ -11,7 +11,7 @@
# used if you are only targeting Android 2.0 or later.) Make sure you # used if you are only targeting Android 2.0 or later.) Make sure you
# test thoroughly if you go this route. # test thoroughly if you go this route.
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/* -optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
-optimizationpasses 5 -optimizationpasses 2
-allowaccessmodification -allowaccessmodification
-dontpreverify -dontpreverify

@ -53,6 +53,7 @@ import java.util.List;
import static org.floens.chan.utils.AndroidUtils.ROBOTO_MEDIUM; import static org.floens.chan.utils.AndroidUtils.ROBOTO_MEDIUM;
import static org.floens.chan.utils.AndroidUtils.dp; import static org.floens.chan.utils.AndroidUtils.dp;
import static org.floens.chan.utils.AndroidUtils.getAttrColor; import static org.floens.chan.utils.AndroidUtils.getAttrColor;
import static org.floens.chan.utils.AndroidUtils.getDimen;
/** /**
* A layout that wraps around a {@link RecyclerView} and a {@link ReplyLayout} to manage showing and replying to posts. * A layout that wraps around a {@link RecyclerView} and a {@link ReplyLayout} to manage showing and replying to posts.
@ -316,7 +317,7 @@ public class ThreadListLayout extends FrameLayout implements ReplyLayout.ReplyLa
case CARD: case CARD:
if (getTopAdapterPosition() == 0) { if (getTopAdapterPosition() == 0) {
View top = layoutManager.findViewByPosition(0); View top = layoutManager.findViewByPosition(0);
return top.getTop() != dp(8) + toolbarHeight(); // 4dp for the cards, 4dp for this layout return top.getTop() != getDimen(getContext(), R.dimen.grid_card_margin) + dp(4) + toolbarHeight(); // 4dp for the cards, 4dp for this layout
} }
break; break;
} }

@ -20,8 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="4dp" android:layout_margin="@dimen/grid_card_margin"
android:padding="50dp"
card_view:cardBackgroundColor="?backcolor" card_view:cardBackgroundColor="?backcolor"
card_view:cardCornerRadius="2dp" card_view:cardCornerRadius="2dp"
card_view:cardElevation="4dp"> card_view:cardElevation="4dp">

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?><!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
<dimen name="grid_card_margin">4dp</dimen>
</resources>

@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<dimen name="grid_card_width">120dp</dimen> <dimen name="grid_card_width">120dp</dimen>
<dimen name="grid_card_height">200dp</dimen> <dimen name="grid_card_height">200dp</dimen>
<dimen name="grid_card_margin">0dp</dimen>
<dimen name="cell_post_thumbnail_size">72dp</dimen> <dimen name="cell_post_thumbnail_size">72dp</dimen>
</resources> </resources>

Loading…
Cancel
Save