Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import android.graphics.Color;
- import android.os.Build;
- import android.os.Bundle;
- import android.view.View;
- import android.view.Window;
- import io.flutter.app.FlutterActivity;
- import io.flutter.plugins.GeneratedPluginRegistrant;
- public class MainActivity extends FlutterActivity
- {
- @Override
- protected void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- GeneratedPluginRegistrant.registerWith(this);
- drawUnderSystemUi();
- }
- @Override
- protected void onPostResume()
- {
- super.onPostResume();
- drawUnderSystemUi();
- }
- private void drawUnderSystemUi()
- {
- if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
- Window window = getWindow();
- int color;
- if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){
- color = Color.TRANSPARENT;
- }
- else{
- color = 0x22000000;
- }
- window.setNavigationBarColor(color);
- window.getDecorView().setSystemUiVisibility(
- View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
- View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
- View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement