* Pixiview/UI/CircleUIs.cs:

* Pixiview.iOS/Pixiview.iOS.csproj:
* Pixiview.iOS/Renderers/RoundLabelRenderer.cs:
* Pixiview.iOS/Renderers/CircleImageRenderer.cs: custom round corner
  controls

* Pixiview/App.xaml:
* Pixiview/Utils/Converters.cs:
* Pixiview/GlobalSuppressions.cs:
* Pixiview/UI/StyleDefinition.cs:

* Pixiview/UI/AdaptedPage.cs:
* Pixiview.iOS/Renderers/AdaptedPageRenderer.cs: observe orientation

* Pixiview/MainPage.xaml:
* Pixiview/Utils/Stores.cs:
* Pixiview/MainPage.xaml.cs:
* Pixiview/Utils/IllustData.cs: data and UI adjust
This commit is contained in:
2020-05-05 01:53:33 +08:00
parent e7fbee8d41
commit 66f0c1ba1b
14 changed files with 536 additions and 30 deletions

View File

@ -1,4 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using Foundation;
using Pixiview.iOS.Renderers;
using Pixiview.UI;
using Pixiview.Utils;
@ -11,6 +12,9 @@ namespace Pixiview.iOS.Renderers
{
public class AdaptedPageRenderer : PageRenderer
{
UIDeviceOrientation lastOrientation;
NSObject observer;
public override void ViewDidLoad()
{
base.ViewDidLoad();
@ -30,6 +34,20 @@ namespace Pixiview.iOS.Renderers
{
SetStatusBarStyle(style);
}
observer = UIDevice.Notifications.ObserveOrientationDidChange(ChangeOrientation);
ChangeOrientation(null, null);
}
public override void ViewWillDisappear(bool animated)
{
if (observer != null)
{
observer.Dispose();
observer = null;
}
base.ViewWillDisappear(animated);
}
private void SetStatusBarStyle(UIStatusBarStyle style)
@ -64,5 +82,23 @@ namespace Pixiview.iOS.Renderers
return UIStatusBarStyle.Default;
}
}
void ChangeOrientation(object sender, NSNotificationEventArgs e)
{
var current = UIDevice.CurrentDevice.Orientation;
if (current == UIDeviceOrientation.FaceUp || current == UIDeviceOrientation.FaceDown)
{
//current = UIDeviceOrientation.Portrait;
return;
}
if (lastOrientation != current)
{
lastOrientation = current;
if (Element is AdaptedPage page)
{
page.OnOrientationChanged((Orientation)lastOrientation);
}
}
}
}
}