Add an option to mute nsfw videos. Show preview before autoplaying videos in CommentAndPostRecyclerViewAdapter.

This commit is contained in:
Alex Ning
2020-07-09 10:51:24 +08:00
parent 6f34d854ea
commit 45f6ba5532
13 changed files with 103 additions and 18 deletions

View File

@@ -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

View File

@@ -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"

View File

@@ -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>

View File

@@ -8,6 +8,12 @@
app:icon="@drawable/ic_mute_preferences_24dp"
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"