aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-02-16 10:31:42 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-02-16 10:31:42 +0000
commit9efeeb88ac1fde770ccd7506f7c6667c0d333f1e (patch)
tree35aa7664f9a6b13d567ba40c4bdb854f993a8ed5 /app/src/main
parent538827f11e2dd20dd8076544f8fbb3b85eb83df8 (diff)
downloadinfinity-for-reddit-9efeeb88ac1fde770ccd7506f7c6667c0d333f1e.tar
infinity-for-reddit-9efeeb88ac1fde770ccd7506f7c6667c0d333f1e.tar.gz
infinity-for-reddit-9efeeb88ac1fde770ccd7506f7c6667c0d333f1e.tar.bz2
infinity-for-reddit-9efeeb88ac1fde770ccd7506f7c6667c0d333f1e.tar.lz
infinity-for-reddit-9efeeb88ac1fde770ccd7506f7c6667c0d333f1e.tar.xz
infinity-for-reddit-9efeeb88ac1fde770ccd7506f7c6667c0d333f1e.tar.zst
infinity-for-reddit-9efeeb88ac1fde770ccd7506f7c6667c0d333f1e.zip
Continue adding Gallery Layout.
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java6
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java4
-rw-r--r--app/src/main/res/drawable-night/ic_gallery_24dp.xml5
-rw-r--r--app/src/main/res/drawable-night/ic_link.xml2
-rw-r--r--app/src/main/res/drawable/ic_link.xml2
-rw-r--r--app/src/main/res/layout/item_post_gallery.xml34
6 files changed, 32 insertions, 21 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 47db2b6d..b4230074 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java
@@ -1095,6 +1095,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
((PostGalleryViewHolder) holder).imageView.setVisibility(View.VISIBLE);
((PostGalleryViewHolder) holder).progressBar.setVisibility(View.VISIBLE);
((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setVisibility(View.VISIBLE);
+ ((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setImageDrawable(mActivity.getDrawable(R.drawable.ic_play_circle_36dp));
Post.Preview preview = getSuitablePreview(post.getPreviews());
if (preview != null) {
@@ -1119,6 +1120,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
((PostGalleryViewHolder) holder).imageView.setVisibility(View.VISIBLE);
((PostGalleryViewHolder) holder).progressBar.setVisibility(View.VISIBLE);
((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setVisibility(View.VISIBLE);
+ ((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setImageDrawable(mActivity.getDrawable(R.drawable.ic_play_circle_36dp));
Post.Preview preview = getSuitablePreview(post.getPreviews());
if (preview != null) {
@@ -1142,6 +1144,8 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
case Post.LINK_TYPE: {
((PostGalleryViewHolder) holder).imageView.setVisibility(View.VISIBLE);
((PostGalleryViewHolder) holder).progressBar.setVisibility(View.VISIBLE);
+ ((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setVisibility(View.VISIBLE);
+ ((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setImageDrawable(mActivity.getDrawable(R.drawable.ic_link));
Post.Preview preview = getSuitablePreview(post.getPreviews());
if (preview != null) {
@@ -1175,6 +1179,8 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
case Post.GALLERY_TYPE: {
((PostGalleryViewHolder) holder).imageView.setVisibility(View.VISIBLE);
((PostGalleryViewHolder) holder).progressBar.setVisibility(View.VISIBLE);
+ ((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setVisibility(View.VISIBLE);
+ ((PostGalleryViewHolder) holder).videoOrGifIndicatorImageView.setImageDrawable(mActivity.getDrawable(R.drawable.ic_gallery_24dp));
Post.Preview preview = getSuitablePreview(post.getPreviews());
if (preview != null) {
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java
index c2be273a..b514b160 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java
@@ -1711,9 +1711,9 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
int halfOffset = mItemOffset / 2;
if (spanIndex == 0) {
- outRect.set(halfOffset, 0, halfOffset, 0);
+ outRect.set(halfOffset, 0, halfOffset / 2, 0);
} else {
- outRect.set(halfOffset, 0, halfOffset, 0);
+ outRect.set(halfOffset / 2, 0, halfOffset, 0);
}
}
}
diff --git a/app/src/main/res/drawable-night/ic_gallery_24dp.xml b/app/src/main/res/drawable-night/ic_gallery_24dp.xml
new file mode 100644
index 00000000..74716ba7
--- /dev/null
+++ b/app/src/main/res/drawable-night/ic_gallery_24dp.xml
@@ -0,0 +1,5 @@
+<vector android:height="24dp" android:tint="#000000"
+ android:viewportHeight="24" android:viewportWidth="24"
+ android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="@android:color/white" android:pathData="M20,4v12L8,16L8,4h12m0,-2L8,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM11.5,11.67l1.69,2.26 2.48,-3.1L19,15L9,15zM2,6v14c0,1.1 0.9,2 2,2h14v-2L4,20L4,6L2,6z"/>
+</vector>
diff --git a/app/src/main/res/drawable-night/ic_link.xml b/app/src/main/res/drawable-night/ic_link.xml
index 7d73bd27..4b447423 100644
--- a/app/src/main/res/drawable-night/ic_link.xml
+++ b/app/src/main/res/drawable-night/ic_link.xml
@@ -4,6 +4,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
- android:fillColor="#FFFFFFFF"
+ android:fillColor="#000000"
android:pathData="M17,7h-4v2h4c1.65,0 3,1.35 3,3s-1.35,3 -3,3h-4v2h4c2.76,0 5,-2.24 5,-5s-2.24,-5 -5,-5zM11,15L7,15c-1.65,0 -3,-1.35 -3,-3s1.35,-3 3,-3h4L11,7L7,7c-2.76,0 -5,2.24 -5,5s2.24,5 5,5h4v-2zM8,11h8v2L8,13z"/>
</vector>
diff --git a/app/src/main/res/drawable/ic_link.xml b/app/src/main/res/drawable/ic_link.xml
index bfe6b0c4..720bb7c5 100644
--- a/app/src/main/res/drawable/ic_link.xml
+++ b/app/src/main/res/drawable/ic_link.xml
@@ -4,6 +4,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
- android:fillColor="#FF000000"
+ android:fillColor="#FFFFFF"
android:pathData="M17,7h-4v2h4c1.65,0 3,1.35 3,3s-1.35,3 -3,3h-4v2h4c2.76,0 5,-2.24 5,-5s-2.24,-5 -5,-5zM11,15L7,15c-1.65,0 -3,-1.35 -3,-3s1.35,-3 3,-3h4L11,7L7,7c-2.76,0 -5,2.24 -5,5s2.24,5 5,5h4v-2zM8,11h8v2L8,13z"/>
</vector>
diff --git a/app/src/main/res/layout/item_post_gallery.xml b/app/src/main/res/layout/item_post_gallery.xml
index dd1c7c1d..4d40c4d8 100644
--- a/app/src/main/res/layout/item_post_gallery.xml
+++ b/app/src/main/res/layout/item_post_gallery.xml
@@ -19,14 +19,28 @@
android:layout_gravity="center"
android:visibility="gone" />
+ <ml.docilealligator.infinityforreddit.customviews.AspectRatioGifImageView
+ android:id="@+id/image_view_item_post_gallery"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:visibility="gone" />
+
+ <ImageView
+ android:id="@+id/image_view_no_preview_item_post_gallery"
+ android:layout_width="match_parent"
+ android:layout_height="150dp"
+ android:scaleType="center"
+ android:background="@drawable/thumbnail_compact_layout_rounded_edge"
+ android:visibility="gone" />
+
<ImageView
android:id="@+id/video_or_gif_indicator_image_view_item_post_gallery"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_width="36dp"
+ android:layout_height="36dp"
android:layout_margin="16dp"
android:layout_gravity="start"
+ android:scaleType="center"
android:background="@drawable/play_button_round_background"
- android:src="@drawable/ic_play_circle_36dp"
android:visibility="gone" />
<RelativeLayout
@@ -49,20 +63,6 @@
</RelativeLayout>
- <ml.docilealligator.infinityforreddit.customviews.AspectRatioGifImageView
- android:id="@+id/image_view_item_post_gallery"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:visibility="gone" />
-
- <ImageView
- android:id="@+id/image_view_no_preview_item_post_gallery"
- android:layout_width="match_parent"
- android:layout_height="150dp"
- android:scaleType="center"
- android:background="@drawable/thumbnail_compact_layout_rounded_edge"
- android:visibility="gone" />
-
<TextView
android:id="@+id/title_text_view_item_post_gallery"
android:layout_width="match_parent"