Skip to content

Commit

Permalink
feat: edge-to-edge layout
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterds committed Jul 4, 2023
1 parent cfb51e0 commit 874229c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
package io.evix.reactnativetvexample;

import android.os.Bundle;
import android.view.View;

import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;

public class MainActivity extends ReactActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
// https://developer.android.com/develop/ui/views/layout/edge-to-edge
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
);

super.onCreate(savedInstanceState);
}

/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
Expand Down
11 changes: 11 additions & 0 deletions android/app/src/main/res/values-v28/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<resources xmlns:tools="http://schemas.android.com/tools">

<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="android:windowBackground">@color/bg</item>

<!-- https://developer.android.com/develop/ui/views/layout/edge-to-edge -->
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
</style>

</resources>

0 comments on commit 874229c

Please sign in to comment.