private void exitFullscreenAnimated(boolean animated) { if (!isVideoFullScreen()) return; swipeRefreshLayout.setVisibility(View.VISIBLE); // reset the values correctly viewer.setRotation(0.f); viewer.setScaleX(1.f); viewer.setScaleY(1.f); viewer.setTranslationX(0.f); // simulate scrolling to fix the clipping and translationY simulateScroll(); // go back to normal! FragmentActivity activity = getActivity(); activity.supportInvalidateOptionsMenu(); if (activity instanceof ToolbarActivity) { // show the toolbar again ((ToolbarActivity) activity).getScrollHideToolbarListener().reset(); } Screen.unlockOrientation(activity); }
@Override public void onDestroyView() { content.removeOnScrollListener(scrollHandler); // restore orientation if the user closes this view Screen.unlockOrientation(getActivity()); adapter = null; super.onDestroyView(); }