mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-29 07:27:36 +08:00
V1.2 新构架
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using Android.Content;
|
||||
using Android.Locations;
|
||||
using AndroidX.Core.Location;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace System
|
||||
{
|
||||
public static class LocationManagerExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取位置管理服务
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <returns></returns>
|
||||
public static LocationManager GetLocationManager(this Context context)
|
||||
=> context.GetSystemService<LocationManager>(Context.LocationService);
|
||||
|
||||
/// <summary>
|
||||
/// 位置开关是否打开
|
||||
/// </summary>
|
||||
/// <param name="locationManager"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsLocationEnabledCompat(this LocationManager locationManager)
|
||||
=> LocationManagerCompat.IsLocationEnabled(locationManager);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user