[Catalog][Carousel] Fix issue with locked orientation with fullscreen carousel

Resolves https://github.com/material-components/material-components-android/pull/3835
Resolves https://github.com/material-components/material-components-android/issues/3834

GIT_ORIGIN_REV_ID=da20780aaf0dcd4ca6abb6cf2dc7107342c2eb53
PiperOrigin-RevId: 582497746
This commit is contained in:
manabu-nakamura 2023-11-15 02:05:28 +00:00 committed by Dan Nizri
parent 198e08cf5e
commit 54d2c8b87f

View File

@ -62,6 +62,12 @@ public class FullScreenStrategyDemoFragment extends DemoFragment {
R.layout.cat_carousel_full_screen_fragment, viewGroup, false /* attachToRoot */);
}
@Override
public void onDestroyView() {
super.onDestroyView();
getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
}
@Override
@SuppressWarnings("RestrictTo")
public void onViewCreated(@NonNull View view, @Nullable Bundle bundle) {