Skip to content

Commit

Permalink
Fix fullscreen switch not working for Android <12v in System.dark mode.
Browse files Browse the repository at this point in the history
Fixes #559.
  • Loading branch information
jonbhanson committed Jun 4, 2023
1 parent dd7a57c commit 78c3a70
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 49 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Unreleased
- Package speed up using Isolates to generate files at the same time
## [2.3.1] - (2023-Jun-04)
- Package speed up using Isolates to generate files at the same time. Thanks [Vladimir](https://github.com/vlazdra) for [PR #558](https://github.com/jonbhanson/flutter_native_splash/pull/558).
- New command for generating all flavors at once: --flavors
- Replaced deprecated 'flutter pub run' with 'dart run'. Thanks [Aditya](https://github.com/adityar224) for [PR #554](https://github.com/jonbhanson/flutter_native_splash/pull/554).
- Fix fullscreen switch not working for Android <12v in System.dark mode. Fixes [#559](https://github.com/jonbhanson/flutter_native_splash/issues/559).

## [2.3.0] - (2023-May-15)
- Support for GIFs in splash screen for web. Thanks [OutdatedGuy](https://github.com/OutdatedGuy) for [PR #547](https://github.com/jonbhanson/flutter_native_splash/pull/547).
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ First, add `flutter_native_splash` as a dependency in your pubspec.yaml file.

```yaml
dependencies:
flutter_native_splash: ^2.3.0
flutter_native_splash: ^2.3.1
```
Don't forget to `flutter pub get`.
Expand Down
6 changes: 3 additions & 3 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ packages:
path: ".."
relative: true
source: path
version: "2.3.0"
version: "2.3.1"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -272,10 +272,10 @@ packages:
dependency: transitive
description:
name: universal_io
sha256: "06866290206d196064fd61df4c7aea1ffe9a4e7c4ccaa8fcded42dd41948005d"
sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
version: "2.2.2"
vector_math:
dependency: transitive
description:
Expand Down
64 changes: 23 additions & 41 deletions lib/android.dart
Original file line number Diff line number Diff line change
Expand Up @@ -171,55 +171,37 @@ void _createAndroidSplash({
}

print('[Android] Updating styles...');
if (android12BackgroundColor != null ||
android12ImagePath != null ||
android12IconBackgroundColor != null ||
android12BrandingImagePath != null) {
_applyStylesXml(
fullScreen: fullscreen,
file: _flavorHelper.androidV31StylesFile,
template: _androidV31StylesXml,
android12BackgroundColor: android12BackgroundColor,
android12ImagePath: android12ImagePath,
android12IconBackgroundColor: android12IconBackgroundColor,
android12BrandingImagePath: android12BrandingImagePath,
);
} else {
File file = File(_flavorHelper.androidV31StylesFile);
if (file.existsSync()) file.deleteSync();
}
_applyStylesXml(
fullScreen: fullscreen,
file: _flavorHelper.androidV31StylesFile,
template: _androidV31StylesXml,
android12BackgroundColor: android12BackgroundColor,
android12ImagePath: android12ImagePath,
android12IconBackgroundColor: android12IconBackgroundColor,
android12BrandingImagePath: android12BrandingImagePath,
);

if (android12DarkBackgroundColor != null ||
android12DarkImagePath != null ||
darkAndroid12IconBackgroundColor != null ||
brandingDarkImagePath != null) {
_applyStylesXml(
fullScreen: fullscreen,
file: _flavorHelper.androidV31StylesNightFile,
template: _androidV31StylesNightXml,
android12BackgroundColor: android12DarkBackgroundColor,
android12ImagePath: android12DarkImagePath,
android12IconBackgroundColor: darkAndroid12IconBackgroundColor,
android12BrandingImagePath: android12DarkBrandingImagePath,
);
} else {
File file = File(_flavorHelper.androidV31StylesNightFile);
if (file.existsSync()) file.deleteSync();
}
_applyStylesXml(
fullScreen: fullscreen,
file: _flavorHelper.androidV31StylesNightFile,
template: _androidV31StylesNightXml,
android12BackgroundColor: android12DarkBackgroundColor,
android12ImagePath: android12DarkImagePath,
android12IconBackgroundColor: darkAndroid12IconBackgroundColor,
android12BrandingImagePath: android12DarkBrandingImagePath,
);

_applyStylesXml(
fullScreen: fullscreen,
file: _flavorHelper.androidStylesFile,
template: _androidStylesXml,
);

if (darkColor != null || darkBackgroundImage != null) {
_applyStylesXml(
fullScreen: fullscreen,
file: _flavorHelper.androidNightStylesFile,
template: _androidStylesNightXml,
);
}
_applyStylesXml(
fullScreen: fullscreen,
file: _flavorHelper.androidNightStylesFile,
template: _androidStylesNightXml,
);

_applyOrientation(orientation: screenOrientation);
}
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: flutter_native_splash
description: Customize Flutter's default white native splash screen with
background color and splash image. Supports dark mode, full screen, and more.
version: 2.3.0
version: 2.3.1
repository: https://github.com/jonbhanson/flutter_native_splash
issue_tracker: https://github.com/jonbhanson/flutter_native_splash/issues

Expand All @@ -20,7 +20,7 @@ dependencies:
image: ^4.0.17
meta: ^1.9.1
path: ^1.8.3
universal_io: ^2.2.0
universal_io: ^2.2.2
xml: ^6.3.0
yaml: ^3.1.2

Expand Down

0 comments on commit 78c3a70

Please sign in to comment.