aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2020-07-09 02:51:24 +0000
committerAlex Ning <chineseperson5@gmail.com>2020-07-09 02:51:24 +0000
commit45f6ba553251a1920ce8688c20679b9504389e30 (patch)
tree0e135319fbec5cd212ffddb3e54ea50cfb5ff9b2 /app/src/main/res
parent6f34d854ea7552fadd9b22e934b45cd86ebc162b (diff)
downloadinfinity-for-reddit-45f6ba553251a1920ce8688c20679b9504389e30.tar
infinity-for-reddit-45f6ba553251a1920ce8688c20679b9504389e30.tar.gz
infinity-for-reddit-45f6ba553251a1920ce8688c20679b9504389e30.tar.bz2
infinity-for-reddit-45f6ba553251a1920ce8688c20679b9504389e30.tar.lz
infinity-for-reddit-45f6ba553251a1920ce8688c20679b9504389e30.tar.xz
infinity-for-reddit-45f6ba553251a1920ce8688c20679b9504389e30.tar.zst
infinity-for-reddit-45f6ba553251a1920ce8688c20679b9504389e30.zip
Add an option to mute nsfw videos. Show preview before autoplaying videos in CommentAndPostRecyclerViewAdapter.
Diffstat (limited to 'app/src/main/res')
-rw-r--r--app/src/main/res/layout/item_post_detail_video_autoplay.xml14
-rw-r--r--app/src/main/res/layout/item_post_video_type_autoplay.xml2
-rw-r--r--app/src/main/res/values/strings.xml3
-rw-r--r--app/src/main/res/xml/video_preferences.xml6
4 files changed, 16 insertions, 9 deletions
diff --git a/app/src/main/res/layout/item_post_detail_video_autoplay.xml b/app/src/main/res/layout/item_post_detail_video_autoplay.xml
index b8b75860..9d8e8590 100644
--- a/app/src/main/res/layout/item_post_detail_video_autoplay.xml
+++ b/app/src/main/res/layout/item_post_detail_video_autoplay.xml
@@ -202,19 +202,19 @@
android:background="#000000"
app:resize_mode="fixed_width">
- <ImageView
- android:id="@+id/preview_image_view_item_post_detail_video_autoplay"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scaleType="fitStart"
- android:visibility="gone" />
-
<com.google.android.exoplayer2.ui.PlayerView
android:id="@+id/player_view_item_post_detail_video_autoplay"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:controller_layout_id="@layout/exo_autoplay_playback_control_view"/>
+ <pl.droidsonroids.gif.GifImageView
+ android:id="@+id/preview_image_view_item_post_detail_video_autoplay"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:scaleType="fitStart"
+ android:visibility="gone" />
+
</com.google.android.exoplayer2.ui.AspectRatioFrameLayout>
<androidx.constraintlayout.widget.ConstraintLayout
diff --git a/app/src/main/res/layout/item_post_video_type_autoplay.xml b/app/src/main/res/layout/item_post_video_type_autoplay.xml
index c5713565..6f0648b9 100644
--- a/app/src/main/res/layout/item_post_video_type_autoplay.xml
+++ b/app/src/main/res/layout/item_post_video_type_autoplay.xml
@@ -208,7 +208,7 @@
android:layout_height="match_parent"
app:controller_layout_id="@layout/exo_autoplay_playback_control_view" />
- <ImageView
+ <pl.droidsonroids.gif.GifImageView
android:id="@+id/preview_image_view_item_post_video_type_autoplay"
android:layout_width="match_parent"
android:layout_height="match_parent"
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 6c31ed48..54763f42 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -361,7 +361,8 @@
<string name="settings_vote_buttons_on_the_right_title">Vote Buttons on the Right</string>
<string name="settings_volume_keys_navigate_comments_title">Use Volume Keys to Navigate Comments in Posts</string>
<string name="settings_volume_keys_navigate_posts_title">Use Volume Keys to Navigate Posts</string>
- <string name="settings_mute_video_title">Mute Video</string>
+ <string name="settings_mute_video_title">Mute Videos</string>
+ <string name="settings_mute_nsfw_video_title">Mute NSFW Videos</string>
<string name="settings_automatically_try_redgifs_title">Automatically Try Accessing Redgifs if Videos on Gfycat are Removed.</string>
<string name="settings_confirm_to_exit">Confirm to Exit</string>
<string name="settings_show_top_level_comments_first_title">Show Top-level Comments First</string>
diff --git a/app/src/main/res/xml/video_preferences.xml b/app/src/main/res/xml/video_preferences.xml
index e570c478..9c215db2 100644
--- a/app/src/main/res/xml/video_preferences.xml
+++ b/app/src/main/res/xml/video_preferences.xml
@@ -9,6 +9,12 @@
app:title="@string/settings_mute_video_title" />
<SwitchPreference
+ app:defaultValue="false"
+ app:key="mute_nsfw_video"
+ app:icon="@drawable/ic_mute_preferences_24dp"
+ app:title="@string/settings_mute_nsfw_video_title" />
+
+ <SwitchPreference
app:defaultValue="true"
app:key="automatically_try_redgifs"
app:title="@string/settings_automatically_try_redgifs_title" />