forked from unoplatform/uno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request unoplatform#325 from unoplatform/dev/spouliot/maco…
…s-skia-badge feat(macos/skia): add badge support
- Loading branch information
Showing
5 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/Uno.UI.Runtime.Skia.MacOS/MacOSBadgeUpdaterExtension.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Globalization; | ||
using Uno.Foundation.Extensibility; | ||
using Uno.UI.Notifications; | ||
|
||
namespace Uno.UI.Runtime.Skia.MacOS; | ||
|
||
internal class MacOSBadgeUpdaterExtension : IBadgeUpdaterExtension | ||
{ | ||
private static readonly MacOSBadgeUpdaterExtension _instance = new(); | ||
|
||
private MacOSBadgeUpdaterExtension() | ||
{ | ||
} | ||
|
||
public static void Register() => ApiExtensibility.Register(typeof(IBadgeUpdaterExtension), _ => _instance); | ||
|
||
public void SetBadge(int? value) | ||
{ | ||
var s = string.Empty; | ||
if (value is not null) | ||
{ | ||
s = value.Value.ToString(CultureInfo.CurrentUICulture.NumberFormat); | ||
} | ||
// NativeUno.uno_application_set_badge(s); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters