Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.

Commit 5865d8b

Browse files
authored
Merge pull request #19 from wcoder/feature/upgrade-ns2
Update solution
2 parents 1211672 + 0f781b4 commit 5865d8b

26 files changed

+77
-346
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ ClientBin/
198198
*~
199199
*.dbmdl
200200
*.dbproj.schemaview
201-
*.pfx
201+
#*.pfx
202202
*.publishsettings
203203
node_modules/
204204
orleans.codegen.cs

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ Simple cross-platform plugin to work with screen orientation of mobile device.
1515

1616
|Platform|Version|
1717
| ------------------- | :------------------: |
18-
|Xamarin.iOS|iOS 6+|
19-
|Xamarin.Android|API 14+|
20-
|Windows 10 UWP|10.0.10240+|
18+
|Xamarin.iOS|iOS 10+|
19+
|Xamarin.Android|API 19+|
20+
|Windows 10 UWP|10.0.16299+|
21+
22+
v2.0 updated to NetStandard 2.0
2123

2224
#### Deprecated platforms
2325

@@ -143,4 +145,4 @@ public override void OnConfigurationChanged(Configuration newConfig)
143145
* [Yauheni Pakala](https://github.com/wcoder)
144146

145147
---
146-
© 2018 MIT License
148+
© 2016-2019 MIT License

nuget/DeviceOrientation.nuspec

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
33
<metadata minClientVersion="2.8.1">
44
<id>Plugin.DeviceOrientation</id>
5-
<version>1.0.7</version>
5+
<version>2.0.0-beta</version>
66
<title>Device Orientation Plugin for Xamarin and Windows</title>
77
<authors>Yauheni Pakala</authors>
88
<owners>Yauheni Pakala</owners>
@@ -13,23 +13,19 @@
1313
<description>
1414
Simple cross-platform plugin to work with screen orientation of mobile device.
1515
</description>
16-
<releaseNotes>
17-
</releaseNotes>
16+
<releaseNotes>See: https://github.com/wcoder/Xamarin.Plugin.DeviceOrientation/releases</releaseNotes>
1817
<summary>Simple cross-platform plugin to work with screen orientation of mobile device.</summary>
19-
<tags>xamarin, pcl, xam.pcl, orientation, .netstandart, uwp, android, xamarin.forms, ios, orientation lock, device orientation</tags>
18+
<tags>xamarin, orientation, .netstandart, uwp, android, xamarin.forms, ios, orientation lock, device orientation</tags>
2019
<dependencies>
21-
<group targetFramework="netstandard1.0">
22-
<dependency id="NETStandard.Library" version="1.6.1" />
23-
</group>
2420
<group targetFramework="MonoAndroid10">
25-
<dependency id="Plugin.CurrentActivity" version="1.0.1"/>
21+
<dependency id="Plugin.CurrentActivity" version="2.1.0.4"/>
2622
</group>
2723
</dependencies>
2824
</metadata>
2925
<files>
3026

3127
<!--Core-->
32-
<file src="..\src\DeviceOrientation\Plugin.DeviceOrientation\bin\Release\netstandard1.0\Plugin.DeviceOrientation.*" target="lib\netstandard1.0" />
28+
<file src="..\src\DeviceOrientation\Plugin.DeviceOrientation\bin\Release\netstandard2.0\Plugin.DeviceOrientation.*" target="lib\netstandard2.0" />
3329

3430
<!--Xamarin.Android-->
3531
<file src="..\src\DeviceOrientation\Plugin.DeviceOrientation.Android\bin\Release\Plugin.DeviceOrientation.*" target="lib\MonoAndroid10" />

samples/DeviceOrientation.Samples.Droid/DeviceOrientation.Samples.Droid.csproj

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
<AndroidResgenClass>Resource</AndroidResgenClass>
1313
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
1414
<AndroidApplication>True</AndroidApplication>
15-
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
16-
<TargetFrameworkVersion>v7.1</TargetFrameworkVersion>
15+
<TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
1716
<AssemblyName>DeviceOrientation.Samples.Droid</AssemblyName>
1817
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
1918
</PropertyGroup>
@@ -38,14 +37,15 @@
3837
<ConsolePause>false</ConsolePause>
3938
</PropertyGroup>
4039
<ItemGroup>
41-
<Reference Include="Plugin.CurrentActivity, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
42-
<HintPath>..\packages\Plugin.CurrentActivity.1.0.1\lib\MonoAndroid10\Plugin.CurrentActivity.dll</HintPath>
43-
</Reference>
40+
<Reference Include="Java.Interop" />
4441
<Reference Include="System" />
4542
<Reference Include="System.Xml" />
4643
<Reference Include="System.Core" />
4744
<Reference Include="Mono.Android" />
4845
</ItemGroup>
46+
<ItemGroup>
47+
<PackageReference Include="Plugin.CurrentActivity" Version="2.1.0.4" />
48+
</ItemGroup>
4949
<ItemGroup>
5050
<ProjectReference Include="..\..\src\DeviceOrientation\Plugin.DeviceOrientation.Abstractions\Plugin.DeviceOrientation.Abstractions.csproj">
5151
<Project>{6edb0588-ffc5-4ef5-8a99-9e241d0f878d}</Project>
@@ -66,7 +66,6 @@
6666
<Compile Include="Properties\AssemblyInfo.cs" />
6767
</ItemGroup>
6868
<ItemGroup>
69-
<None Include="packages.config" />
7069
<None Include="Resources\AboutResources.txt" />
7170
<None Include="Properties\AndroidManifest.xml" />
7271
<None Include="Assets\AboutAssets.txt" />
Lines changed: 9 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,26 @@
1-
using System;
2-
1+
using System;
32
using Android.App;
4-
using Android.OS;
53
using Android.Runtime;
64
using Plugin.CurrentActivity;
75

86
namespace DeviceOrientation.Samples.Droid
97
{
10-
//You can specify additional application information in this attribute
11-
[Application]
12-
public class MainApplication : Application, Application.IActivityLifecycleCallbacks
8+
#if DEBUG
9+
[Application(Debuggable = true)]
10+
#else
11+
[Application(Debuggable = false)]
12+
#endif
13+
public class MainApplication : Application
1314
{
1415
public MainApplication(IntPtr handle, JniHandleOwnership transer)
15-
:base(handle, transer)
16+
: base(handle, transer)
1617
{
1718
}
1819

1920
public override void OnCreate()
2021
{
2122
base.OnCreate();
22-
RegisterActivityLifecycleCallbacks(this);
23-
//A great place to initialize Xamarin.Insights and Dependency Services!
24-
}
25-
26-
public override void OnTerminate()
27-
{
28-
base.OnTerminate();
29-
UnregisterActivityLifecycleCallbacks(this);
30-
}
31-
32-
public void OnActivityCreated(Activity activity, Bundle savedInstanceState)
33-
{
34-
CrossCurrentActivity.Current.Activity = activity;
35-
}
36-
37-
public void OnActivityDestroyed(Activity activity)
38-
{
39-
}
40-
41-
public void OnActivityPaused(Activity activity)
42-
{
43-
}
44-
45-
public void OnActivityResumed(Activity activity)
46-
{
47-
CrossCurrentActivity.Current.Activity = activity;
48-
}
49-
50-
public void OnActivitySaveInstanceState(Activity activity, Bundle outState)
51-
{
52-
}
53-
54-
public void OnActivityStarted(Activity activity)
55-
{
56-
CrossCurrentActivity.Current.Activity = activity;
57-
}
58-
59-
public void OnActivityStopped(Activity activity)
60-
{
23+
CrossCurrentActivity.Current.Init(this);
6124
}
6225
}
6326
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3-
<uses-sdk android:minSdkVersion="15" />
3+
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="26" />
44
<application></application>
5-
</manifest>
5+
</manifest>

samples/DeviceOrientation.Samples.Droid/packages.config

Lines changed: 0 additions & 4 deletions
This file was deleted.

samples/DeviceOrientation.Samples.UWP/App.xaml.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.IO;
4-
using System.Linq;
5-
using System.Runtime.InteropServices.WindowsRuntime;
62
using Windows.ApplicationModel;
73
using Windows.ApplicationModel.Activation;
8-
using Windows.Foundation;
9-
using Windows.Foundation.Collections;
104
using Windows.UI.Xaml;
115
using Windows.UI.Xaml.Controls;
12-
using Windows.UI.Xaml.Controls.Primitives;
13-
using Windows.UI.Xaml.Data;
14-
using Windows.UI.Xaml.Input;
15-
using Windows.UI.Xaml.Media;
166
using Windows.UI.Xaml.Navigation;
177

188
namespace DeviceOrientation.Samples.UWP
@@ -28,10 +18,7 @@ sealed partial class App : Application
2818
/// </summary>
2919
public App()
3020
{
31-
Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync(
32-
Microsoft.ApplicationInsights.WindowsCollectors.Metadata |
33-
Microsoft.ApplicationInsights.WindowsCollectors.Session);
34-
this.InitializeComponent();
21+
this.InitializeComponent();
3522
this.Suspending += OnSuspending;
3623
}
3724

samples/DeviceOrientation.Samples.UWP/ApplicationInsights.config

Lines changed: 0 additions & 3 deletions
This file was deleted.

samples/DeviceOrientation.Samples.UWP/DeviceOrientation.Samples.UWP.csproj

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
<AssemblyName>DeviceOrientation.Samples.UWP</AssemblyName>
1212
<DefaultLanguage>en-US</DefaultLanguage>
1313
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
14-
<TargetPlatformVersion>10.0.10586.0</TargetPlatformVersion>
15-
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
14+
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17763.0</TargetPlatformVersion>
15+
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
1616
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
1717
<FileAlignment>512</FileAlignment>
1818
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1919
<PackageCertificateKeyFile>DeviceOrientation.Samples.UWP_TemporaryKey.pfx</PackageCertificateKeyFile>
20+
<RuntimeIdentifiers>win10-arm;win10-arm-aot;win10-x86;win10-x86-aot;win10-x64;win10-x64-aot</RuntimeIdentifiers>
2021
</PropertyGroup>
2122
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
2223
<DebugSymbols>true</DebugSymbols>
@@ -87,13 +88,9 @@
8788
<Prefer32Bit>true</Prefer32Bit>
8889
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
8990
</PropertyGroup>
90-
<ItemGroup>
91-
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
92-
<Content Include="ApplicationInsights.config">
93-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
94-
</Content>
95-
<None Include="project.json" />
96-
</ItemGroup>
91+
<PropertyGroup>
92+
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
93+
</PropertyGroup>
9794
<ItemGroup>
9895
<Compile Include="App.xaml.cs">
9996
<DependentUpon>App.xaml</DependentUpon>
@@ -143,6 +140,11 @@
143140
<Name>DeviceOrientation.Samples</Name>
144141
</ProjectReference>
145142
</ItemGroup>
143+
<ItemGroup>
144+
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
145+
<Version>6.1.9</Version>
146+
</PackageReference>
147+
</ItemGroup>
146148
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
147149
<VisualStudioVersion>14.0</VisualStudioVersion>
148150
</PropertyGroup>

samples/DeviceOrientation.Samples.UWP/project.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

samples/DeviceOrientation.Samples.iOS/DeviceOrientation.Samples.iOS.csproj

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<ErrorReport>prompt</ErrorReport>
2020
<WarningLevel>4</WarningLevel>
2121
<ConsolePause>false</ConsolePause>
22-
<MtouchArch>i386</MtouchArch>
22+
<MtouchArch>i386, x86_64</MtouchArch>
2323
<MtouchLink>None</MtouchLink>
2424
<MtouchDebug>true</MtouchDebug>
2525
<MtouchProfiling>true</MtouchProfiling>
@@ -82,55 +82,55 @@
8282
</ItemGroup>
8383
<ItemGroup>
8484
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Contents.json">
85-
<InProject>false</InProject>
85+
<Visible>false</Visible>
8686
</ImageAsset>
8787
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-60%402x.png">
88-
<InProject>false</InProject>
88+
<Visible>false</Visible>
8989
</ImageAsset>
9090
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-60%403x.png">
91-
<InProject>false</InProject>
91+
<Visible>false</Visible>
9292
</ImageAsset>
9393
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-76.png">
94-
<InProject>false</InProject>
94+
<Visible>false</Visible>
9595
</ImageAsset>
9696
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-76%402x.png">
97-
<InProject>false</InProject>
97+
<Visible>false</Visible>
9898
</ImageAsset>
9999
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-Small.png">
100-
<InProject>false</InProject>
100+
<Visible>false</Visible>
101101
</ImageAsset>
102102
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-Small%402x.png">
103-
<InProject>false</InProject>
103+
<Visible>false</Visible>
104104
</ImageAsset>
105105
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-Small%403x.png">
106-
<InProject>false</InProject>
106+
<Visible>false</Visible>
107107
</ImageAsset>
108108
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-Small-40.png">
109-
<InProject>false</InProject>
109+
<Visible>false</Visible>
110110
</ImageAsset>
111111
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-Small-40%402x.png">
112-
<InProject>false</InProject>
112+
<Visible>false</Visible>
113113
</ImageAsset>
114114
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-Small-40%403x.png">
115-
<InProject>false</InProject>
115+
<Visible>false</Visible>
116116
</ImageAsset>
117117
<ImageAsset Include="Resources\Images.xcassets\LaunchImage.launchimage\Contents.json">
118-
<InProject>false</InProject>
118+
<Visible>false</Visible>
119119
</ImageAsset>
120120
<ImageAsset Include="Resources\Images.xcassets\LaunchImage.launchimage\Default.png">
121-
<InProject>false</InProject>
121+
<Visible>false</Visible>
122122
</ImageAsset>
123123
<ImageAsset Include="Resources\Images.xcassets\LaunchImage.launchimage\Default%402x.png">
124-
<InProject>false</InProject>
124+
<Visible>false</Visible>
125125
</ImageAsset>
126126
<ImageAsset Include="Resources\Images.xcassets\LaunchImage.launchimage\Default-568h%402x.png">
127-
<InProject>false</InProject>
127+
<Visible>false</Visible>
128128
</ImageAsset>
129129
<ImageAsset Include="Resources\Images.xcassets\LaunchImage.launchimage\Default-Portrait.png">
130-
<InProject>false</InProject>
130+
<Visible>false</Visible>
131131
</ImageAsset>
132132
<ImageAsset Include="Resources\Images.xcassets\LaunchImage.launchimage\Default-Portrait%402x.png">
133-
<InProject>false</InProject>
133+
<Visible>false</Visible>
134134
</ImageAsset>
135135
</ItemGroup>
136136
<ItemGroup>

0 commit comments

Comments
 (0)