File tree Expand file tree Collapse file tree 6 files changed +24
-19
lines changed Expand file tree Collapse file tree 6 files changed +24
-19
lines changed Original file line number Diff line number Diff line change 1- using Android . Content . PM ;
1+ using Android . Content ;
2+ using Android . Content . PM ;
23using Android . Content . Res ;
4+ using Android . Net ;
35using Android . OS ;
46using Avalonia . Controls . ApplicationLifetimes ;
57using Pixed . Application . Platform ;
8+ using Uri = Android . Net . Uri ;
69namespace Pixed . Android ;
710internal class PlatformSettings : IPlatformSettings
811{
@@ -23,6 +26,13 @@ public string GetVersion()
2326 return info . VersionName ;
2427 }
2528
29+ public void OpenUrl ( string url )
30+ {
31+ Intent intent = new ( Intent . ActionView , Uri . Parse ( url ) ) ;
32+
33+ MainActivity . StartActivity ( intent ) ;
34+ }
35+
2636 public void ProcessMinimumScreenSize ( int minScreenSize )
2737 {
2838 var system = Resources . System ;
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ public async Task Build(bool clear = true)
5959
6060 MenuItem onlineHelpMenu = new ( "Online help" )
6161 {
62- Command = new ActionCommand < string > ( PlatformUtils . OpenUrl ) ,
62+ Command = new ActionCommand < string > ( IPlatformSettings . Instance . OpenUrl ) ,
6363 CommandParameter = "https://github.com/Mateusz-Nejman/Pixed/wiki" ,
6464 Icon = new ( "avares://Pixed.Application/Resources/fluent-icons/ic_fluent_globe_48_regular.svg" )
6565 } ;
Original file line number Diff line number Diff line change @@ -25,6 +25,16 @@ public string GetVersion()
2525 return versionInfo . FileVersion ;
2626 }
2727
28+ public void OpenUrl ( string url )
29+ {
30+ var psi = new ProcessStartInfo
31+ {
32+ FileName = url ,
33+ UseShellExecute = true
34+ } ;
35+ Process . Start ( psi ) ;
36+ }
37+
2838 public void ProcessMinimumScreenSize ( int minScreenSize )
2939 {
3040 //Not used
Original file line number Diff line number Diff line change @@ -11,4 +11,5 @@ public interface IPlatformSettings
1111 public void Close ( ) ;
1212 public string GetVersion ( ) ;
1313 public void ProcessMinimumScreenSize ( int minScreenSize ) ;
14+ public void OpenUrl ( string url ) ;
1415}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11using Pixed . Application . Controls ;
22using Pixed . Application . Platform ;
3- using Pixed . Application . Utils ;
43using Pixed . Core ;
54using System . Windows . Input ;
65
@@ -11,7 +10,7 @@ internal class AboutViewModel : ExtendedViewModel
1110 public string AppVersion { get ; }
1211 public AboutViewModel ( )
1312 {
14- OpenUrlCommand = new ActionCommand < string > ( PlatformUtils . OpenUrl ) ;
13+ OpenUrlCommand = new ActionCommand < string > ( IPlatformSettings . Instance . OpenUrl ) ;
1514 AppVersion = "Version: " + GetVersion ( ) ;
1615 }
1716
You can’t perform that action at this time.
0 commit comments