Skip to content

Commit 4602517

Browse files
committed
Fix updating of another android property
1 parent 95b20b0 commit 4602517

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

Directory.build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<RepositoryType>git</RepositoryType>
1515
<Product>$(AssemblyName) ($(TargetFramework))</Product>
1616
<NeutralLanguage>en</NeutralLanguage>
17-
<Version>0.6.8</Version>
17+
<Version>0.6.9</Version>
1818

1919
<LangVersion>latest</LangVersion>
2020
<NoWarn>$(NoWarn);1591;1701;1702;1705;VSX1000;NU1603</NoWarn>

MediaManager/MediaManagerBase.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public MediaManagerBase()
2424

2525
public bool IsInitialized { get; protected set; }
2626

27-
public Timer Timer { get; } = new Timer(1000);
27+
public Timer Timer { get; protected set; } = new Timer(1000);
2828

2929
private TimeSpan _stepSize = TimeSpan.FromSeconds(10);
3030
public virtual TimeSpan StepSize
@@ -211,6 +211,10 @@ public virtual Task StepForward()
211211
internal void OnStateChanged(object sender, StateChangedEventArgs e)
212212
{
213213
StateChanged?.Invoke(sender, e);
214+
215+
//TODO: Find a better way to trigger some changes.
216+
OnPropertyChanged(nameof(Duration));
217+
214218
NotificationManager?.UpdateNotification();
215219
}
216220

@@ -241,6 +245,7 @@ protected virtual void Timer_Elapsed(object sender, ElapsedEventArgs e)
241245
if (PreviousPosition != Position)
242246
{
243247
PreviousPosition = Position;
248+
//OnPropertyChanged(nameof(Position));
244249
OnPositionChanged(this, new PositionChangedEventArgs(Position));
245250
}
246251
}

MediaManager/Platforms/Android/MediaManagerImplementation.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ public virtual Context Context
4444
public int NotificationIconResource
4545
{
4646
get => _notificationIconResource;
47-
set => SetProperty(ref _notificationIconResource, value);
47+
set
48+
{
49+
SetProperty(ref _notificationIconResource, value);
50+
var playerNotificationManager = (NotificationManager as MediaManager.Platforms.Android.Notifications.NotificationManager)?.PlayerNotificationManager;
51+
playerNotificationManager?.SetSmallIcon(_notificationIconResource);
52+
}
4853
}
4954

5055
private MediaSessionCompat _mediaSession;

MediaManager/Platforms/Android/MediaSession/MediaBrowserService.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ protected virtual void PrepareNotificationManager()
104104
PlayerNotificationManager.SetRewindIncrementMs((long)MediaManager.StepSize.TotalMilliseconds);
105105
PlayerNotificationManager.SetNotificationListener(NotificationListener);
106106
PlayerNotificationManager.SetMediaSessionToken(SessionToken);
107-
PlayerNotificationManager.SetOngoing(false);
107+
PlayerNotificationManager.SetOngoing(true);
108108
PlayerNotificationManager.SetUsePlayPauseActions(MediaManager.NotificationManager.ShowPlayPauseControls);
109109
PlayerNotificationManager.SetUseNavigationActions(MediaManager.NotificationManager.ShowNavigationControls);
110110

0 commit comments

Comments
 (0)