TouchyTickets/Android/AndroidPlatform.cs

29 lines
773 B
C#
Raw Normal View History

using Android.App;
2020-06-30 19:06:35 +02:00
using Android.Content;
using Android.Views;
using TouchyTickets;
2020-07-21 20:26:52 +02:00
using Uri = Android.Net.Uri;
2023-02-11 10:16:42 +01:00
namespace Android;
2023-02-11 10:16:42 +01:00
public class AndroidPlatform : Platform {
2023-02-11 10:16:42 +01:00
private readonly Activity activity;
2023-03-04 10:50:45 +01:00
public AndroidPlatform(Activity activity) {
2023-02-11 10:16:42 +01:00
this.activity = activity;
}
public override void SetKeepScreenOn(bool keep) {
if (keep) {
this.activity.Window.AddFlags(WindowManagerFlags.KeepScreenOn);
} else {
this.activity.Window.ClearFlags(WindowManagerFlags.KeepScreenOn);
2020-07-21 21:51:30 +02:00
}
2023-02-11 10:16:42 +01:00
}
2020-07-21 21:51:30 +02:00
2023-02-11 10:16:42 +01:00
public override void OpenRateLink() {
this.activity.StartActivity(new Intent(Intent.ActionView, Uri.Parse("https://play.google.com/store/apps/details?id=de.ellpeck.touchytickets")));
}
}