aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-02-22 13:02:09 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-02-22 13:02:09 +0000
commit5b831aafbc58f70a44d3df8a7aaf27a81bfd2dac (patch)
tree3fe6654f0ddb89e214bfd3603c4a6a6b25729251 /app/src/main
parent947be2101deef03bf521f6d8210f3adee8f2283e (diff)
downloadinfinity-for-reddit-5b831aafbc58f70a44d3df8a7aaf27a81bfd2dac.tar
infinity-for-reddit-5b831aafbc58f70a44d3df8a7aaf27a81bfd2dac.tar.gz
infinity-for-reddit-5b831aafbc58f70a44d3df8a7aaf27a81bfd2dac.tar.bz2
infinity-for-reddit-5b831aafbc58f70a44d3df8a7aaf27a81bfd2dac.tar.lz
infinity-for-reddit-5b831aafbc58f70a44d3df8a7aaf27a81bfd2dac.tar.xz
infinity-for-reddit-5b831aafbc58f70a44d3df8a7aaf27a81bfd2dac.tar.zst
infinity-for-reddit-5b831aafbc58f70a44d3df8a7aaf27a81bfd2dac.zip
Continue adding Card Layout 2.
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java9
-rw-r--r--app/src/main/res/layout/item_post_card_2_text.xml4
-rw-r--r--app/src/main/res/layout/item_post_card_2_video_autoplay.xml4
-rw-r--r--app/src/main/res/layout/item_post_card_2_with_preview.xml4
4 files changed, 13 insertions, 8 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java
index 09bb8e27..04b23880 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java
@@ -1755,8 +1755,13 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) holder.itemView.getLayoutParams();
params.height = ViewGroup.LayoutParams.WRAP_CONTENT;
int marginPixel = (int) Utils.convertDpToPixel(8, mActivity);
- params.topMargin = marginPixel;
- params.bottomMargin = marginPixel;
+ if (holder instanceof PostCard2VideoAutoplayViewHolder || holder instanceof PostCard2WithPreviewViewHolder
+ || holder instanceof PostCard2TextTypeViewHolder) {
+ ((PostBaseViewHolder) holder).itemView.setPadding(0, marginPixel, 0, 0);
+ } else {
+ params.topMargin = marginPixel;
+ params.bottomMargin = marginPixel;
+ }
holder.itemView.setLayoutParams(params);
((PostBaseViewHolder) holder).itemView.setBackgroundTintList(ColorStateList.valueOf(mCardViewBackgroundColor));
((PostBaseViewHolder) holder).titleTextView.setTextColor(mPostTitleColor);
diff --git a/app/src/main/res/layout/item_post_card_2_text.xml b/app/src/main/res/layout/item_post_card_2_text.xml
index 35daac06..af8fe398 100644
--- a/app/src/main/res/layout/item_post_card_2_text.xml
+++ b/app/src/main/res/layout/item_post_card_2_text.xml
@@ -5,7 +5,6 @@
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:paddingTop="8dp"
- android:layout_marginBottom="8dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground"
@@ -264,6 +263,7 @@
<View
android:id="@+id/divider_item_post_card_2_text"
android:layout_width="match_parent"
- android:layout_height="1dp" />
+ android:layout_height="1dp"
+ android:paddingBottom="8dp" />
</LinearLayout> \ No newline at end of file
diff --git a/app/src/main/res/layout/item_post_card_2_video_autoplay.xml b/app/src/main/res/layout/item_post_card_2_video_autoplay.xml
index 99b9497a..9047c717 100644
--- a/app/src/main/res/layout/item_post_card_2_video_autoplay.xml
+++ b/app/src/main/res/layout/item_post_card_2_video_autoplay.xml
@@ -5,7 +5,6 @@
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:paddingTop="8dp"
- android:layout_marginBottom="8dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground"
@@ -303,6 +302,7 @@
<View
android:id="@+id/divider_item_post_card_2_video_autoplay"
android:layout_width="match_parent"
- android:layout_height="1dp" />
+ android:layout_height="1dp"
+ android:paddingBottom="8dp" />
</LinearLayout> \ No newline at end of file
diff --git a/app/src/main/res/layout/item_post_card_2_with_preview.xml b/app/src/main/res/layout/item_post_card_2_with_preview.xml
index 351fd1d7..4007aae2 100644
--- a/app/src/main/res/layout/item_post_card_2_with_preview.xml
+++ b/app/src/main/res/layout/item_post_card_2_with_preview.xml
@@ -5,7 +5,6 @@
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:paddingTop="8dp"
- android:layout_marginBottom="8dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground"
@@ -320,6 +319,7 @@
<View
android:id="@+id/divider_item_post_card_2_with_preview"
android:layout_width="match_parent"
- android:layout_height="1dp" />
+ android:layout_height="1dp"
+ android:paddingBottom="8dp" />
</LinearLayout> \ No newline at end of file