From a8dd4b351b1382ea73d43ada8c5f2de48d728c2f Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Tue, 11 Aug 2020 14:49:40 +0800 Subject: Pause autoplaying video in ViewPostDetailActivity in onPause(). --- .../Activity/ViewPostDetailActivity.java | 16 ++++++++++++++++ app/src/main/res/layout/activity_view_post_detail.xml | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPostDetailActivity.java index d46fdfe1..a150f656 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPostDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPostDetailActivity.java @@ -386,6 +386,22 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS mPostCommentSortTypeBottomSheetFragment = new PostCommentSortTypeBottomSheetFragment(); } + @Override + protected void onResume() { + super.onResume(); + if (mAdapter != null && mRecyclerView != null) { + mRecyclerView.onWindowVisibilityChanged(View.VISIBLE); + } + } + + @Override + protected void onPause() { + super.onPause(); + if (mAdapter != null && mRecyclerView != null) { + mRecyclerView.onWindowVisibilityChanged(View.GONE); + } + } + @Override public SharedPreferences getDefaultSharedPreferences() { return mSharedPreferences; diff --git a/app/src/main/res/layout/activity_view_post_detail.xml b/app/src/main/res/layout/activity_view_post_detail.xml index a4492fc4..d250cb83 100644 --- a/app/src/main/res/layout/activity_view_post_detail.xml +++ b/app/src/main/res/layout/activity_view_post_detail.xml @@ -42,7 +42,7 @@ android:id="@+id/recycler_view_view_post_detail" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingBottom="48dp" + android:paddingBottom="144dp" android:clipToPadding="false" /> -- cgit v1.2.3