Skip to content

Commit

Permalink
Use binary icon format
Browse files Browse the repository at this point in the history
  • Loading branch information
alesimula committed Jan 23, 2022
1 parent 30a65d5 commit a3dea3b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
Binary file added assets/icons/missing_icon_background.si
Binary file not shown.
Binary file added assets/icons/missing_icon_foreground.si
Binary file not shown.
Binary file added assets/icons/missing_icon_legacy.si
Binary file not shown.
6 changes: 3 additions & 3 deletions lib/android/reader_apk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,12 @@ class ApkReader {
if (inner != null) await inner;
if (iconUpdThread != null) await iconUpdThread;
if (data.legacyIcon) data.execute(() async {if (GState.apkForegroundIcon.$ == null && GState.apkIcon.$ == null) {
final legacy = await ScalableImage.fromSvgAsset(rootBundle, "assets/icons/missing_icon_legacy.svg");
final legacy = await ScalableImage.fromSIAsset(rootBundle, "assets/icons/missing_icon_legacy.si");
GState.apkIcon.update((p0) => (ScalableImageWidget(si: legacy)));
}});
else data.execute(() async {if (GState.apkForegroundIcon.$ == null && GState.apkIcon.$ == null) {
final fBackground = ScalableImage.fromAvdAsset(rootBundle, "assets/icons/missing_icon_background.xml");
final fForeground = ScalableImage.fromAvdAsset(rootBundle, "assets/icons/missing_icon_foreground.xml");
final fBackground = ScalableImage.fromSIAsset(rootBundle, "assets/icons/missing_icon_background.si");
final fForeground = ScalableImage.fromSIAsset(rootBundle, "assets/icons/missing_icon_foreground.si");
final background = await fBackground;
final foreground = await fForeground;
GState.apkBackgroundIcon.update((p0) => (ScalableImageWidget(si: background)));
Expand Down
10 changes: 5 additions & 5 deletions lib/screens/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ class ScreenSettingsState extends State<ScreenSettings> {
ScreenSettingsState({this.controller});
final ScrollController? controller;

static late final _exBackground = _loadIcon("assets/icons/missing_icon_background.xml", true);
static late final _exForeground = _loadIcon("assets/icons/missing_icon_foreground.xml", true);
static late final _exLegacyIcon = _loadIcon("assets/icons/missing_icon_legacy.svg");
static late final _exBackground = _loadIcon("assets/icons/missing_icon_background.si");
static late final _exForeground = _loadIcon("assets/icons/missing_icon_foreground.si");
static late final _exLegacyIcon = _loadIcon("assets/icons/missing_icon_legacy.si");

static Future<ScalableImageWidget> _loadIcon(String asset, [bool isAvd = false]) async {
var scalable = isAvd ? ScalableImage.fromAvdAsset(rootBundle, asset) : ScalableImage.fromSvgAsset(rootBundle, asset);
static Future<ScalableImageWidget> _loadIcon(String asset) async {
var scalable = ScalableImage.fromSIAsset(rootBundle, asset);
return ScalableImageWidget(si: await scalable);
}

Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ flutter:
generate: true
uses-material-design: true
assets:
- assets/icons/missing_icon_background.xml
- assets/icons/missing_icon_foreground.xml
- assets/icons/missing_icon_legacy.svg
- assets/icons/missing_icon_background.si
- assets/icons/missing_icon_foreground.si
- assets/icons/missing_icon_legacy.si
- assets/images/logo.png

flutter_native_splash:
Expand Down

0 comments on commit a3dea3b

Please sign in to comment.