Pause autoplaying video in ViewPostDetailActivity in onPause().

This commit is contained in:
Alex Ning 2020-08-11 14:49:40 +08:00
parent b1b2b1aa71
commit a8dd4b351b
2 changed files with 17 additions and 1 deletions

View File

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

View File

@ -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" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>