Skip to content

Commit

Permalink
Unlock screen orientation for Android 12+ devices (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
kekkyojin authored Oct 26, 2022
1 parent 26fb161 commit 4d5520a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/src/main/java/com/odysee/app/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4d5520a

Please sign in to comment.