Skip to content

Commit

Permalink
Merge pull request #19 from wcoder/feature/upgrade-ns2
Browse files Browse the repository at this point in the history
Update solution
  • Loading branch information
wcoder authored Mar 2, 2019
2 parents 1211672 + 0f781b4 commit 5865d8b
Show file tree
Hide file tree
Showing 26 changed files with 77 additions and 346 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ ClientBin/
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
#*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ Simple cross-platform plugin to work with screen orientation of mobile device.

|Platform|Version|
| ------------------- | :------------------: |
|Xamarin.iOS|iOS 6+|
|Xamarin.Android|API 14+|
|Windows 10 UWP|10.0.10240+|
|Xamarin.iOS|iOS 10+|
|Xamarin.Android|API 19+|
|Windows 10 UWP|10.0.16299+|

v2.0 updated to NetStandard 2.0

#### Deprecated platforms

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

---
© 2018 MIT License
© 2016-2019 MIT License
14 changes: 5 additions & 9 deletions nuget/DeviceOrientation.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata minClientVersion="2.8.1">
<id>Plugin.DeviceOrientation</id>
<version>1.0.7</version>
<version>2.0.0-beta</version>
<title>Device Orientation Plugin for Xamarin and Windows</title>
<authors>Yauheni Pakala</authors>
<owners>Yauheni Pakala</owners>
Expand All @@ -13,23 +13,19 @@
<description>
Simple cross-platform plugin to work with screen orientation of mobile device.
</description>
<releaseNotes>
</releaseNotes>
<releaseNotes>See: https://github.com/wcoder/Xamarin.Plugin.DeviceOrientation/releases</releaseNotes>
<summary>Simple cross-platform plugin to work with screen orientation of mobile device.</summary>
<tags>xamarin, pcl, xam.pcl, orientation, .netstandart, uwp, android, xamarin.forms, ios, orientation lock, device orientation</tags>
<tags>xamarin, orientation, .netstandart, uwp, android, xamarin.forms, ios, orientation lock, device orientation</tags>
<dependencies>
<group targetFramework="netstandard1.0">
<dependency id="NETStandard.Library" version="1.6.1" />
</group>
<group targetFramework="MonoAndroid10">
<dependency id="Plugin.CurrentActivity" version="1.0.1"/>
<dependency id="Plugin.CurrentActivity" version="2.1.0.4"/>
</group>
</dependencies>
</metadata>
<files>

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

<!--Xamarin.Android-->
<file src="..\src\DeviceOrientation\Plugin.DeviceOrientation.Android\bin\Release\Plugin.DeviceOrientation.*" target="lib\MonoAndroid10" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
<AndroidResgenClass>Resource</AndroidResgenClass>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidApplication>True</AndroidApplication>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v7.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
<AssemblyName>DeviceOrientation.Samples.Droid</AssemblyName>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
</PropertyGroup>
Expand All @@ -38,14 +37,15 @@
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="Plugin.CurrentActivity, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Plugin.CurrentActivity.1.0.1\lib\MonoAndroid10\Plugin.CurrentActivity.dll</HintPath>
</Reference>
<Reference Include="Java.Interop" />
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Mono.Android" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Plugin.CurrentActivity" Version="2.1.0.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\DeviceOrientation\Plugin.DeviceOrientation.Abstractions\Plugin.DeviceOrientation.Abstractions.csproj">
<Project>{6edb0588-ffc5-4ef5-8a99-9e241d0f878d}</Project>
Expand All @@ -66,7 +66,6 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="Resources\AboutResources.txt" />
<None Include="Properties\AndroidManifest.xml" />
<None Include="Assets\AboutAssets.txt" />
Expand Down
55 changes: 9 additions & 46 deletions samples/DeviceOrientation.Samples.Droid/MainApplication.cs
Original file line number Diff line number Diff line change
@@ -1,63 +1,26 @@
using System;

using System;
using Android.App;
using Android.OS;
using Android.Runtime;
using Plugin.CurrentActivity;

namespace DeviceOrientation.Samples.Droid
{
//You can specify additional application information in this attribute
[Application]
public class MainApplication : Application, Application.IActivityLifecycleCallbacks
#if DEBUG
[Application(Debuggable = true)]
#else
[Application(Debuggable = false)]
#endif
public class MainApplication : Application
{
public MainApplication(IntPtr handle, JniHandleOwnership transer)
:base(handle, transer)
: base(handle, transer)
{
}

public override void OnCreate()
{
base.OnCreate();
RegisterActivityLifecycleCallbacks(this);
//A great place to initialize Xamarin.Insights and Dependency Services!
}

public override void OnTerminate()
{
base.OnTerminate();
UnregisterActivityLifecycleCallbacks(this);
}

public void OnActivityCreated(Activity activity, Bundle savedInstanceState)
{
CrossCurrentActivity.Current.Activity = activity;
}

public void OnActivityDestroyed(Activity activity)
{
}

public void OnActivityPaused(Activity activity)
{
}

public void OnActivityResumed(Activity activity)
{
CrossCurrentActivity.Current.Activity = activity;
}

public void OnActivitySaveInstanceState(Activity activity, Bundle outState)
{
}

public void OnActivityStarted(Activity activity)
{
CrossCurrentActivity.Current.Activity = activity;
}

public void OnActivityStopped(Activity activity)
{
CrossCurrentActivity.Current.Init(this);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="15" />
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="26" />
<application></application>
</manifest>
</manifest>
4 changes: 0 additions & 4 deletions samples/DeviceOrientation.Samples.Droid/packages.config

This file was deleted.

15 changes: 1 addition & 14 deletions samples/DeviceOrientation.Samples.UWP/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

namespace DeviceOrientation.Samples.UWP
Expand All @@ -28,10 +18,7 @@ sealed partial class App : Application
/// </summary>
public App()
{
Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync(
Microsoft.ApplicationInsights.WindowsCollectors.Metadata |
Microsoft.ApplicationInsights.WindowsCollectors.Session);
this.InitializeComponent();
this.InitializeComponent();
this.Suspending += OnSuspending;
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
<AssemblyName>DeviceOrientation.Samples.UWP</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.10586.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17763.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<PackageCertificateKeyFile>DeviceOrientation.Samples.UWP_TemporaryKey.pfx</PackageCertificateKeyFile>
<RuntimeIdentifiers>win10-arm;win10-arm-aot;win10-x86;win10-x86-aot;win10-x64;win10-x64-aot</RuntimeIdentifiers>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -87,13 +88,9 @@
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
<Content Include="ApplicationInsights.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="project.json" />
</ItemGroup>
<PropertyGroup>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<ItemGroup>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
Expand Down Expand Up @@ -143,6 +140,11 @@
<Name>DeviceOrientation.Samples</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.1.9</Version>
</PackageReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
Expand Down
Binary file not shown.
19 changes: 0 additions & 19 deletions samples/DeviceOrientation.Samples.UWP/project.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<MtouchArch>i386</MtouchArch>
<MtouchArch>i386, x86_64</MtouchArch>
<MtouchLink>None</MtouchLink>
<MtouchDebug>true</MtouchDebug>
<MtouchProfiling>true</MtouchProfiling>
Expand Down Expand Up @@ -82,55 +82,55 @@
</ItemGroup>
<ItemGroup>
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Contents.json">
<InProject>false</InProject>
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-60%402x.png">
<InProject>false</InProject>
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-60%403x.png">
<InProject>false</InProject>
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-76.png">
<InProject>false</InProject>
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-76%402x.png">
<InProject>false</InProject>
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-Small.png">
<InProject>false</InProject>
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-Small%402x.png">
<InProject>false</InProject>
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-Small%403x.png">
<InProject>false</InProject>
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-Small-40.png">
<InProject>false</InProject>
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-Small-40%402x.png">
<InProject>false</InProject>
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-Small-40%403x.png">
<InProject>false</InProject>
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Resources\Images.xcassets\LaunchImage.launchimage\Contents.json">
<InProject>false</InProject>
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Resources\Images.xcassets\LaunchImage.launchimage\Default.png">
<InProject>false</InProject>
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Resources\Images.xcassets\LaunchImage.launchimage\Default%402x.png">
<InProject>false</InProject>
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Resources\Images.xcassets\LaunchImage.launchimage\Default-568h%402x.png">
<InProject>false</InProject>
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Resources\Images.xcassets\LaunchImage.launchimage\Default-Portrait.png">
<InProject>false</InProject>
<Visible>false</Visible>
</ImageAsset>
<ImageAsset Include="Resources\Images.xcassets\LaunchImage.launchimage\Default-Portrait%402x.png">
<InProject>false</InProject>
<Visible>false</Visible>
</ImageAsset>
</ItemGroup>
<ItemGroup>
Expand Down
Loading

0 comments on commit 5865d8b

Please sign in to comment.