From 4d753fc562864a44a1ee30fbaad785311b5e790a Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Sun, 14 Jun 2020 15:19:56 +0800 Subject: Add a rounded background to thumbnail in compact layout. Fix subreddits and users not clickable in sidebar. --- .../Adapter/PostRecyclerViewAdapter.java | 26 +- .../infinityforreddit/ParseSubredditData.java | 3 +- .../thumbnail_compact_layout_rounded_edge.xml | 5 + app/src/main/res/layout/item_post_compact.xml | 679 +++++++++++---------- 4 files changed, 364 insertions(+), 349 deletions(-) create mode 100644 app/src/main/res/drawable/thumbnail_compact_layout_rounded_edge.xml (limited to 'app/src') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java index 98355c69..2b65b05a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java @@ -898,8 +898,8 @@ public class PostRecyclerViewAdapter extends PagedListAdapter { + ((PostCompactViewHolder) holder).noPreviewLinkImageFrameLayout.setVisibility(View.VISIBLE); + ((PostCompactViewHolder) holder).noPreviewLinkImageFrameLayout.setOnClickListener(view -> { Intent intent = new Intent(mActivity, LinkResolverActivity.class); Uri uri = Uri.parse(post.getUrl()); if (uri.getScheme() == null && uri.getHost() == null) { @@ -1385,7 +1385,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_post_compact.xml b/app/src/main/res/layout/item_post_compact.xml index 59444cef..1cee1578 100644 --- a/app/src/main/res/layout/item_post_compact.xml +++ b/app/src/main/res/layout/item_post_compact.xml @@ -1,387 +1,388 @@ - + android:orientation="vertical"> - + android:paddingStart="16dp" + android:paddingTop="8dp" + android:paddingEnd="16dp" + android:paddingBottom="8dp"> + + + + + + + + + + + + - + + + + - - - - + + + + + android:padding="4dp" + android:text="@string/spoiler" + android:textSize="?attr/font_10" + android:visibility="gone" + app:lib_setRadius="3dp" + app:lib_setRoundedView="true" + app:lib_setShape="rectangle" /> - - - + + + android:padding="4dp" + android:textSize="?attr/font_10" + android:visibility="gone" + app:lib_setRadius="3dp" + app:lib_setRoundedView="true" + app:lib_setShape="rectangle" /> - + android:fontFamily="?attr/font_family" + android:padding="4dp" + android:textSize="?attr/font_10" + android:visibility="gone" + app:lib_setRadius="3dp" + app:lib_setRoundedView="true" + app:lib_setShape="rectangle" /> - + - + - - - - - - - - - - - - - + - + + + + + + + + android:id="@+id/image_view_item_post_compact" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@drawable/thumbnail_compact_layout_rounded_edge" + android:scaleType="center" /> - + - + - + - - - - - - - - - - - + + android:tint="@android:color/tab_indicator_text" /> - + - + - + - - - + - - - + + + + + + + + + + + - + - - - - - - - - - \ No newline at end of file + + + \ No newline at end of file -- cgit v1.2.3