From 4d5520a7173a8a4838eff0b6231d676c69a06b7e Mon Sep 17 00:00:00 2001 From: Javi Rueda Date: Wed, 26 Oct 2022 17:02:11 +0200 Subject: [PATCH] Unlock screen orientation for Android 12+ devices (#368) --- app/src/main/java/com/odysee/app/MainActivity.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/com/odysee/app/MainActivity.java b/app/src/main/java/com/odysee/app/MainActivity.java index dcc7925b..031dcd35 100644 --- a/app/src/main/java/com/odysee/app/MainActivity.java +++ b/app/src/main/java/com/odysee/app/MainActivity.java @@ -539,9 +539,11 @@ protected void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_main); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) { + //noinspection deprecation findViewById(R.id.root).setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); findViewById(R.id.launch_splash).setVisibility(View.VISIBLE); } else { + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); findViewById(R.id.root).getViewTreeObserver().addOnPreDrawListener( new ViewTreeObserver.OnPreDrawListener() { @Override