aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2019-12-19 10:32:37 +0000
committerAlex Ning <chineseperson5@gmail.com>2019-12-19 10:32:37 +0000
commitae49dd50d4b8ccdbc99a142c44e29e63ab111a3a (patch)
tree46c42fbd205c226736bebeaa98a24d28312899fb /app/src/main/res
parentf0c04a2f6d5b848da159702e7800d22ccb16f71b (diff)
downloadinfinity-for-reddit-ae49dd50d4b8ccdbc99a142c44e29e63ab111a3a.tar
infinity-for-reddit-ae49dd50d4b8ccdbc99a142c44e29e63ab111a3a.tar.gz
infinity-for-reddit-ae49dd50d4b8ccdbc99a142c44e29e63ab111a3a.tar.bz2
infinity-for-reddit-ae49dd50d4b8ccdbc99a142c44e29e63ab111a3a.tar.lz
infinity-for-reddit-ae49dd50d4b8ccdbc99a142c44e29e63ab111a3a.tar.xz
infinity-for-reddit-ae49dd50d4b8ccdbc99a142c44e29e63ab111a3a.tar.zst
infinity-for-reddit-ae49dd50d4b8ccdbc99a142c44e29e63ab111a3a.zip
Show a play button on the image if the post is a video or an image.
Diffstat (limited to 'app/src/main/res')
-rw-r--r--app/src/main/res/drawable-night/ic_play_circle_36dp.xml4
-rw-r--r--app/src/main/res/drawable/ic_play_circle_36dp.xml4
-rw-r--r--app/src/main/res/drawable/play_button_round_background.xml9
-rw-r--r--app/src/main/res/layout/item_post.xml30
-rw-r--r--app/src/main/res/layout/item_post_compact.xml28
-rw-r--r--app/src/main/res/layout/item_post_detail.xml26
-rw-r--r--app/src/main/res/values-night/colors.xml2
-rw-r--r--app/src/main/res/values/colors.xml2
8 files changed, 87 insertions, 18 deletions
diff --git a/app/src/main/res/drawable-night/ic_play_circle_36dp.xml b/app/src/main/res/drawable-night/ic_play_circle_36dp.xml
new file mode 100644
index 00000000..2471417e
--- /dev/null
+++ b/app/src/main/res/drawable-night/ic_play_circle_36dp.xml
@@ -0,0 +1,4 @@
+<vector android:height="36dp" android:viewportHeight="24"
+ android:viewportWidth="24" android:width="36dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="#FF000000" android:pathData="M10,16.5l6,-4.5 -6,-4.5zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
+</vector>
diff --git a/app/src/main/res/drawable/ic_play_circle_36dp.xml b/app/src/main/res/drawable/ic_play_circle_36dp.xml
new file mode 100644
index 00000000..7a21d9a9
--- /dev/null
+++ b/app/src/main/res/drawable/ic_play_circle_36dp.xml
@@ -0,0 +1,4 @@
+<vector android:height="36dp" android:viewportHeight="24"
+ android:viewportWidth="24" android:width="36dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="#FFFFFFFF" android:pathData="M10,16.5l6,-4.5 -6,-4.5zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
+</vector>
diff --git a/app/src/main/res/drawable/play_button_round_background.xml b/app/src/main/res/drawable/play_button_round_background.xml
new file mode 100644
index 00000000..d047c68d
--- /dev/null
+++ b/app/src/main/res/drawable/play_button_round_background.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
+ <item>
+ <shape android:shape="oval">
+ <solid android:color="@color/backgroundColorInverse" />
+ </shape>
+ </item>
+
+</layer-list> \ No newline at end of file
diff --git a/app/src/main/res/layout/item_post.xml b/app/src/main/res/layout/item_post.xml
index 22b94789..787a1fe9 100644
--- a/app/src/main/res/layout/item_post.xml
+++ b/app/src/main/res/layout/item_post.xml
@@ -231,19 +231,35 @@
android:layout_height="wrap_content"
android:visibility="gone">
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView
+ android:id="@+id/image_view_best_post_item"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:adjustViewBounds="true"
+ android:scaleType="fitStart" />
+
+ <ImageView
+ android:id="@+id/play_button_image_view_item_post"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="16dp"
+ android:layout_gravity="start"
+ android:background="@drawable/play_button_round_background"
+ android:src="@drawable/ic_play_circle_36dp"
+ android:visibility="gone" />
+
+ </FrameLayout>
+
<ProgressBar
android:id="@+id/progress_bar_item_post"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
- <ml.docilealligator.infinityforreddit.CustomView.AspectRatioGifImageView
- android:id="@+id/image_view_best_post_item"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:adjustViewBounds="true"
- android:scaleType="fitStart" />
-
<RelativeLayout
android:id="@+id/load_image_error_relative_layout_item_post"
android:layout_width="match_parent"
diff --git a/app/src/main/res/layout/item_post_compact.xml b/app/src/main/res/layout/item_post_compact.xml
index c8ab31c2..411bf5fc 100644
--- a/app/src/main/res/layout/item_post_compact.xml
+++ b/app/src/main/res/layout/item_post_compact.xml
@@ -230,18 +230,34 @@
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible">
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ImageView
+ android:id="@+id/image_view_best_post_item"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:scaleType="center" />
+
+ <ImageView
+ android:id="@+id/play_button_image_view_item_post_compact"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="0dp"
+ android:layout_gravity="center"
+ android:background="@drawable/play_button_round_background"
+ android:src="@drawable/ic_play_circle_36dp"
+ android:visibility="gone" />
+
+ </FrameLayout>
+
<ProgressBar
android:id="@+id/progress_bar_item_post_compact"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_centerInParent="true" />
- <ImageView
- android:id="@+id/image_view_best_post_item"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scaleType="center" />
-
</RelativeLayout>
<ImageView
diff --git a/app/src/main/res/layout/item_post_detail.xml b/app/src/main/res/layout/item_post_detail.xml
index 63406305..7a9dac19 100644
--- a/app/src/main/res/layout/item_post_detail.xml
+++ b/app/src/main/res/layout/item_post_detail.xml
@@ -210,12 +210,28 @@
android:layout_height="wrap_content"
android:visibility="gone">
- <com.santalu.aspectratioimageview.AspectRatioImageView
- android:id="@+id/image_view_item_post_detail"
+ <FrameLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:adjustViewBounds="true"
- android:scaleType="fitStart"/>
+ android:layout_height="wrap_content">
+
+ <com.santalu.aspectratioimageview.AspectRatioImageView
+ android:id="@+id/image_view_item_post_detail"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:adjustViewBounds="true"
+ android:scaleType="fitStart"/>
+
+ <ImageView
+ android:id="@+id/play_button_image_view_item_post_detail"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="16dp"
+ android:layout_gravity="start"
+ android:background="@drawable/play_button_round_background"
+ android:src="@drawable/ic_play_circle_36dp"
+ android:visibility="gone" />
+
+ </FrameLayout>
<RelativeLayout
android:id="@+id/load_wrapper_item_post_detail"
diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml
index 6be140e4..f5d0ec6c 100644
--- a/app/src/main/res/values-night/colors.xml
+++ b/app/src/main/res/values-night/colors.xml
@@ -22,6 +22,8 @@
<color name="backgroundColorPrimaryDark">#1565C0</color>
+ <color name="backgroundColorInverse">#FFFFFF</color>
+
<color name="roundedBottomSheetPrimaryBackground">#242424</color>
<color name="voteAndReplyUnavailableVoteButtonColor">#3C3C3C</color>
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index bf8487e6..43811d56 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -22,6 +22,8 @@
<color name="backgroundColorPrimaryDark">@color/colorPrimaryDark</color>
+ <color name="backgroundColorInverse">#000000</color>
+
<color name="roundedBottomSheetPrimaryBackground">#FFFFFF</color>
<color name="roundedBottomSheetPrimaryNavigationBarColor">@android:color/black</color>