Skip to content

Commit

Permalink
fix: not refreshing after toggling pitch black
Browse files Browse the repository at this point in the history
  • Loading branch information
MSOB7YY committed Dec 13, 2024
1 parent 221b653 commit 3d10050
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions lib/controller/current_color.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,34 +107,37 @@ class CurrentColor {
void updateColorAfterThemeModeChange() {
if (settings.autoColor.value) {
final nc = _namidaColor.value ?? _defaultNamidaColor;
_namidaColor.value = NamidaColor(
_namidaColor.set(NamidaColor(
used: nc.color.withAlpha(colorAlpha),
mix: nc.mix,
palette: nc.palette,
);
));
} else {
final nc = playerStaticColor.lighter;
_namidaColor.value = NamidaColor(
_namidaColor.set(NamidaColor(
used: nc,
mix: nc,
palette: [nc],
);
));
}
_namidaColor.refresh();
}

void updatePlayerColorFromColor(Color color, [bool customAlpha = true]) async {
final colorWithAlpha = customAlpha ? color.withAlpha(colorAlpha) : color;
_namidaColor.value = NamidaColor(
_namidaColor.set(NamidaColor(
used: colorWithAlpha,
mix: colorWithAlpha,
palette: [colorWithAlpha],
);
));
_namidaColor.refresh();
}

Future<void> refreshColorsAfterResumeApp() async {
final namidaColor = await getPlayerColorFromDeviceWallpaper(forceCheck: true);
if (namidaColor != null && settings.autoColor.value && _shouldUpdateFromDeviceWallpaper) {
_namidaColor.value = namidaColor;
_namidaColor.set(namidaColor);
_namidaColor.refresh();
_updateCurrentPaletteHalfs(namidaColor);
}
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: namida
description: A Beautiful and Feature-rich Music Player, With YouTube & Video Support Built in Flutter
publish_to: "none"
version: 4.8.15-beta+241213123
version: 4.8.16-beta+241213125

environment:
sdk: ">=3.4.0 <4.0.0"
Expand Down

0 comments on commit 3d10050

Please sign in to comment.