mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-24 00:10:47 +00:00
[Android] Fixed system navigation bar color
This commit is contained in:
parent
e4deac0fee
commit
afdbc92ac4
3 changed files with 11 additions and 2 deletions
|
@ -1,11 +1,18 @@
|
||||||
package com.vodemn.lightmeter
|
package com.vodemn.lightmeter
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
|
import androidx.core.view.WindowCompat
|
||||||
import io.flutter.embedding.android.FlutterActivity
|
import io.flutter.embedding.android.FlutterActivity
|
||||||
import io.flutter.embedding.engine.FlutterEngine
|
import io.flutter.embedding.engine.FlutterEngine
|
||||||
import io.flutter.plugin.common.MethodChannel
|
import io.flutter.plugin.common.MethodChannel
|
||||||
|
|
||||||
class MainActivity : FlutterActivity() {
|
class MainActivity : FlutterActivity() {
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||||
|
}
|
||||||
|
|
||||||
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
|
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
|
||||||
super.configureFlutterEngine(flutterEngine)
|
super.configureFlutterEngine(flutterEngine)
|
||||||
MethodChannel(
|
MethodChannel(
|
||||||
|
|
|
@ -57,7 +57,7 @@ class Application extends StatelessWidget {
|
||||||
? Brightness.dark
|
? Brightness.dark
|
||||||
: Brightness.light,
|
: Brightness.light,
|
||||||
statusBarIconBrightness: systemIconsBrightness,
|
statusBarIconBrightness: systemIconsBrightness,
|
||||||
systemNavigationBarColor: context.watch<ThemeData>().colorScheme.surface,
|
systemNavigationBarColor: Colors.transparent,
|
||||||
systemNavigationBarIconBrightness: systemIconsBrightness,
|
systemNavigationBarIconBrightness: systemIconsBrightness,
|
||||||
),
|
),
|
||||||
child: MaterialApp(
|
child: MaterialApp(
|
||||||
|
|
|
@ -25,6 +25,7 @@ class SettingsScreen extends StatelessWidget {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
top: false,
|
top: false,
|
||||||
|
bottom: false,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
slivers: <Widget>[
|
slivers: <Widget>[
|
||||||
SliverAppBar(
|
SliverAppBar(
|
||||||
|
@ -51,7 +52,7 @@ class SettingsScreen extends StatelessWidget {
|
||||||
),
|
),
|
||||||
SliverList(
|
SliverList(
|
||||||
delegate: SliverChildListDelegate(
|
delegate: SliverChildListDelegate(
|
||||||
<SettingsSection>[
|
<Widget>[
|
||||||
SettingsSection(
|
SettingsSection(
|
||||||
title: S.of(context).metering,
|
title: S.of(context).metering,
|
||||||
children: const [
|
children: const [
|
||||||
|
@ -84,6 +85,7 @@ class SettingsScreen extends StatelessWidget {
|
||||||
VersionListTile(),
|
VersionListTile(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
SizedBox(height: MediaQuery.of(context).padding.bottom),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue