mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Make the status bar translucent
This CL lets Sky apps draw behind the Android status bar, better matching the material design spec. R=eseidel@chromium.org Review URL: https://codereview.chromium.org/1010493007
This commit is contained in:
parent
9cae912b49
commit
be7eb7fbfa
@ -4,12 +4,13 @@
|
||||
|
||||
import '../fn.dart';
|
||||
import '../theme/colors.dart';
|
||||
import '../theme/view-configuration.dart';
|
||||
|
||||
class DrawerHeader extends Component {
|
||||
static final Style _style = new Style('''
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 140px;
|
||||
height: ${140 + kStatusBarHeight}px;
|
||||
-webkit-user-select: none;
|
||||
background-color: ${BlueGrey[50]};
|
||||
border-bottom: 1px solid #D1D9E1;
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
import '../fn.dart';
|
||||
import '../theme/colors.dart';
|
||||
import '../theme/shadows.dart';
|
||||
import '../theme/view-configuration.dart';
|
||||
|
||||
class Toolbar extends Component {
|
||||
List<Node> children;
|
||||
@ -15,6 +16,7 @@ class Toolbar extends Component {
|
||||
height: 56px;
|
||||
background-color: ${Purple[500]};
|
||||
color: white;
|
||||
padding-top: ${kStatusBarHeight}px;
|
||||
box-shadow: ${Shadow[2]};'''
|
||||
);
|
||||
|
||||
|
||||
@ -10,3 +10,4 @@ const int kMinFlingVelocity = 50;
|
||||
const int kScrollbarFadeDelay = 300;
|
||||
const int kScrollbarFadeDuration = 250;
|
||||
const int kScrollbarSize = 10;
|
||||
const int kStatusBarHeight = 25;
|
||||
|
||||
@ -6,6 +6,8 @@ package org.domokit.sky.shell;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
/**
|
||||
* Base class for activities that use Sky.
|
||||
@ -19,6 +21,14 @@ public class SkyActivity extends Activity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
getWindow().addFlags(
|
||||
WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
|
||||
getWindow().setStatusBarColor(0x40000000);
|
||||
getWindow().getDecorView().setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
|
||||
|
||||
SkyMain.ensureInitialized(getApplicationContext());
|
||||
mView = new PlatformView(this);
|
||||
setContentView(mView);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user