maui-linux/Xamarin.Forms.Platform.Tizen/Platform.cs

575 строки
16 KiB
C#
Исходник Обычный вид История

2017-12-04 17:30:43 +03:00
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
2017-12-04 17:30:43 +03:00
using System.Linq;
using System.Threading.Tasks;
2018-06-22 14:16:22 +03:00
using System.ComponentModel;
2017-12-04 17:30:43 +03:00
using Xamarin.Forms.Internals;
2018-06-22 14:16:22 +03:00
using Xamarin.Forms.PlatformConfiguration.TizenSpecific;
2017-12-04 17:30:43 +03:00
using ElmSharp;
using EProgressBar = ElmSharp.ProgressBar;
using EButton = ElmSharp.Button;
using EColor = ElmSharp.Color;
2017-12-04 17:30:43 +03:00
[assembly: InternalsVisibleTo("Xamarin.Forms.Material")]
2017-12-04 17:30:43 +03:00
namespace Xamarin.Forms.Platform.Tizen
{
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
public static class Platform
2017-12-04 17:30:43 +03:00
{
internal static readonly BindableProperty RendererProperty = BindableProperty.CreateAttached("Renderer", typeof(IVisualElementRenderer), typeof(Platform), default(IVisualElementRenderer),
propertyChanged: (bindable, oldvalue, newvalue) =>
{
var ve = bindable as VisualElement;
if (ve != null && newvalue == null)
ve.IsPlatformEnabled = false;
});
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
public static IVisualElementRenderer GetRenderer(BindableObject bindable)
{
return (IVisualElementRenderer)bindable.GetValue(Platform.RendererProperty);
}
public static void SetRenderer(BindableObject bindable, IVisualElementRenderer value)
{
bindable.SetValue(Platform.RendererProperty, value);
}
/// <summary>
/// Gets the renderer associated with the <c>view</c>. If it doesn't exist, creates a new one.
/// </summary>
/// <returns>Renderer associated with the <c>view</c>.</returns>
/// <param name="element">VisualElement for which the renderer is going to be returned.</param>
public static IVisualElementRenderer GetOrCreateRenderer(VisualElement element)
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
{
return GetRenderer(element) ?? CreateRenderer(element);
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
}
internal static IVisualElementRenderer CreateRenderer(VisualElement element)
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
{
IVisualElementRenderer renderer = Registrar.Registered.GetHandlerForObject<IVisualElementRenderer>(element) ?? new DefaultRenderer();
renderer.SetElement(element);
return renderer;
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
}
internal static ITizenPlatform CreatePlatform(EvasObject parent)
{
ITizenPlatform platform;
if (Forms.Flags.Contains(Flags.LightweightPlatformExperimental))
{
platform = new LightweightPlatform(parent);
}
else
{
platform = new DefaultPlatform(parent);
}
return platform;
}
public static SizeRequest GetNativeSize(VisualElement view, double widthConstraint, double heightConstraint)
{
widthConstraint = widthConstraint <= -1 ? double.PositiveInfinity : widthConstraint;
heightConstraint = heightConstraint <= -1 ? double.PositiveInfinity : heightConstraint;
double width = !double.IsPositiveInfinity(widthConstraint) ? widthConstraint : Int32.MaxValue;
double height = !double.IsPositiveInfinity(heightConstraint) ? heightConstraint : Int32.MaxValue;
return Platform.GetRenderer(view).GetDesiredSize(width, height);
}
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
}
[EditorBrowsable(EditorBrowsableState.Never)]
public interface ITizenPlatform : IDisposable
#pragma warning disable CS0618 // Type or member is obsolete
, IPlatform
#pragma warning restore CS0618 // Type or member is obsolete
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
{
void SetPage(Page page);
bool SendBackButtonPressed();
EvasObject GetRootNativeView();
bool HasAlpha { get; set; }
event EventHandler<RootNativeViewChangedEventArgs> RootNativeViewChanged;
}
public class RootNativeViewChangedEventArgs : EventArgs
{
public RootNativeViewChangedEventArgs(EvasObject view) => RootNativeView = view;
public EvasObject RootNativeView { get; private set; }
}
public class DefaultPlatform : BindableObject, ITizenPlatform, INavigation
{
2017-12-04 17:30:43 +03:00
NavigationModel _navModel = new NavigationModel();
bool _disposed;
Native.Dialog _pageBusyDialog;
int _pageBusyCount;
2018-10-15 18:42:54 +03:00
readonly Naviframe _internalNaviframe;
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
2018-10-15 18:42:54 +03:00
readonly HashSet<EvasObject> _alerts = new HashSet<EvasObject>();
2018-04-09 05:15:23 +03:00
2019-03-27 21:38:38 +03:00
#pragma warning disable 0067
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
public event EventHandler<RootNativeViewChangedEventArgs> RootNativeViewChanged;
2019-03-27 21:38:38 +03:00
#pragma warning restore 0067
2017-12-04 17:30:43 +03:00
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
internal DefaultPlatform(EvasObject parent)
2017-12-04 17:30:43 +03:00
{
Forms.NativeParent = parent;
_pageBusyCount = 0;
MessagingCenter.Subscribe<Page, bool>(this, Page.BusySetSignalName, BusySetSignalNameHandler);
MessagingCenter.Subscribe<Page, AlertArguments>(this, Page.AlertSignalName, AlertSignalNameHandler);
MessagingCenter.Subscribe<Page, ActionSheetArguments>(this, Page.ActionSheetSignalName, ActionSheetSignalNameHandler);
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
_internalNaviframe = new Naviframe(Forms.NativeParent)
2017-12-04 17:30:43 +03:00
{
PreserveContentOnPop = true,
DefaultBackButtonEnabled = false,
};
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
_internalNaviframe.SetAlignment(-1, -1);
_internalNaviframe.SetWeight(1.0, 1.0);
_internalNaviframe.Show();
_internalNaviframe.AnimationFinished += NaviAnimationFinished;
2017-12-04 17:30:43 +03:00
}
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
~DefaultPlatform()
2017-12-04 17:30:43 +03:00
{
Dispose(false);
}
public Page Page { get; private set; }
public bool HasAlpha { get; set; }
2017-12-04 17:30:43 +03:00
Task CurrentModalNavigationTask { get; set; }
TaskCompletionSource<bool> CurrentTaskCompletionSource { get; set; }
IPageController CurrentPageController => _navModel.CurrentPage as IPageController;
IReadOnlyList<Page> INavigation.ModalStack => _navModel.Modals.ToList();
IReadOnlyList<Page> INavigation.NavigationStack => new List<Page>();
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
public void SetPage(Page newRoot)
{
if (Page != null)
{
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
var copyOfStack = new List<NaviItem>(_internalNaviframe.NavigationStack);
2017-12-04 17:30:43 +03:00
for (var i = 0; i < copyOfStack.Count; i++)
{
copyOfStack[i].Delete();
}
foreach (Page page in _navModel.Roots)
{
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
var renderer = Platform.GetRenderer(page);
2017-12-04 17:30:43 +03:00
renderer?.Dispose();
}
_navModel = new NavigationModel();
}
if (newRoot == null)
return;
_navModel.Push(newRoot, null);
Page = newRoot;
#pragma warning disable CS0618 // Type or member is obsolete
// The Platform property is no longer necessary, but we have to set it because some third-party
// library might still be retrieving it and using it
Page.Platform = this;
#pragma warning restore CS0618 // Type or member is obsolete
IVisualElementRenderer pageRenderer = Platform.CreateRenderer(Page);
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
var naviItem = _internalNaviframe.Push(pageRenderer.NativeView);
2017-12-04 17:30:43 +03:00
naviItem.TitleBarVisible = false;
// Make naviitem transparent if parent window is transparent.
2017-12-04 17:30:43 +03:00
// Make sure that this is only for _navModel._naviTree. (not for _navModel._modalStack)
// In addtion, the style of naviItem is only decided before the naviItem pushed into Naviframe. (not on-demand).
if (HasAlpha)
2017-12-04 17:30:43 +03:00
{
naviItem.Style = "default/transparent";
}
((Application)Page.RealParent).NavigationProxy.Inner = this;
Device.StartTimer(TimeSpan.Zero, () =>
{
CurrentPageController?.SendAppearing();
return false;
});
}
public bool SendBackButtonPressed()
{
bool handled = false;
if (_navModel.CurrentPage != null)
{
if (CurrentModalNavigationTask != null && !CurrentModalNavigationTask.IsCompleted)
{
handled = true;
}
else
{
handled = _navModel.CurrentPage.SendBackButtonPressed();
}
}
return handled;
}
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
public EvasObject GetRootNativeView()
{
return _internalNaviframe as EvasObject;
}
2017-12-04 17:30:43 +03:00
protected virtual void Dispose(bool disposing)
{
if (_disposed) return;
if (disposing)
{
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
MessagingCenter.Unsubscribe<Page, AlertArguments>(this, "Xamarin.SendAlert");
MessagingCenter.Unsubscribe<Page, bool>(this, "Xamarin.BusySet");
MessagingCenter.Unsubscribe<Page, ActionSheetArguments>(this, "Xamarin.ShowActionSheet");
2017-12-04 17:30:43 +03:00
SetPage(null);
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
_internalNaviframe.Unrealize();
2017-12-04 17:30:43 +03:00
}
_disposed = true;
}
protected override void OnBindingContextChanged()
{
BindableObject.SetInheritedBindingContext(Page, base.BindingContext);
base.OnBindingContextChanged();
}
void INavigation.InsertPageBefore(Page page, Page before)
{
throw new InvalidOperationException("InsertPageBefore is not supported globally on Tizen, please use a NavigationPage.");
}
Task<Page> INavigation.PopAsync()
{
return ((INavigation)this).PopAsync(true);
}
Task<Page> INavigation.PopAsync(bool animated)
{
throw new InvalidOperationException("PopAsync is not supported globally on Tizen, please use a NavigationPage.");
}
Task INavigation.PopToRootAsync()
{
return ((INavigation)this).PopToRootAsync(true);
}
Task INavigation.PopToRootAsync(bool animated)
{
throw new InvalidOperationException("PopToRootAsync is not supported globally on Tizen, please use a NavigationPage.");
}
Task INavigation.PushAsync(Page root)
{
return ((INavigation)this).PushAsync(root, true);
}
Task INavigation.PushAsync(Page root, bool animated)
{
throw new InvalidOperationException("PushAsync is not supported globally on Tizen, please use a NavigationPage.");
}
void INavigation.RemovePage(Page page)
{
throw new InvalidOperationException("RemovePage is not supported globally on Tizen, please use a NavigationPage.");
}
Task INavigation.PushModalAsync(Page modal)
{
return ((INavigation)this).PushModalAsync(modal, true);
}
async Task INavigation.PushModalAsync(Page modal, bool animated)
{
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
var previousPage = CurrentPageController;
Device.BeginInvokeOnMainThread(() => previousPage?.SendDisappearing());
2017-12-04 17:30:43 +03:00
_navModel.PushModal(modal);
await PushModalInternal(modal, animated);
// Verify that the modal is still on the stack
if (_navModel.CurrentPage == modal)
CurrentPageController.SendAppearing();
}
Task<Page> INavigation.PopModalAsync()
{
return ((INavigation)this).PopModalAsync(true);
}
async Task<Page> INavigation.PopModalAsync(bool animated)
{
Page modal = _navModel.PopModal();
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
IVisualElementRenderer modalRenderer = Platform.GetRenderer(modal);
2017-12-04 17:30:43 +03:00
if (modalRenderer != null)
{
await PopModalInternal(animated);
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
modalRenderer.Dispose();
2017-12-04 17:30:43 +03:00
}
CurrentPageController?.SendAppearing();
return modal;
}
async Task PushModalInternal(Page modal, bool animated)
{
TaskCompletionSource<bool> tcs = null;
if (CurrentModalNavigationTask != null && !CurrentModalNavigationTask.IsCompleted)
{
var previousTask = CurrentModalNavigationTask;
tcs = new TaskCompletionSource<bool>();
CurrentModalNavigationTask = tcs.Task;
await previousTask;
}
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
var after = _internalNaviframe.NavigationStack.LastOrDefault();
2017-12-04 17:30:43 +03:00
NaviItem pushed = null;
if (animated || after == null)
{
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
pushed = _internalNaviframe.Push(Platform.GetOrCreateRenderer(modal).NativeView, modal.Title);
2017-12-04 17:30:43 +03:00
}
else
{
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
pushed = _internalNaviframe.InsertAfter(after, Platform.GetOrCreateRenderer(modal).NativeView, modal.Title);
2017-12-04 17:30:43 +03:00
}
pushed.TitleBarVisible = false;
bool shouldWait = animated && after != null;
await WaitForCompletion(shouldWait, tcs);
}
async Task PopModalInternal(bool animated)
{
TaskCompletionSource<bool> tcs = null;
if (CurrentModalNavigationTask != null && !CurrentModalNavigationTask.IsCompleted)
{
var previousTask = CurrentModalNavigationTask;
tcs = new TaskCompletionSource<bool>();
CurrentModalNavigationTask = tcs.Task;
await previousTask;
}
if (animated)
{
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
_internalNaviframe.Pop();
2017-12-04 17:30:43 +03:00
}
else
{
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
_internalNaviframe.NavigationStack.LastOrDefault()?.Delete();
2017-12-04 17:30:43 +03:00
}
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
bool shouldWait = animated && (_internalNaviframe.NavigationStack.Count != 0);
2017-12-04 17:30:43 +03:00
await WaitForCompletion(shouldWait, tcs);
}
async Task WaitForCompletion(bool shouldWait, TaskCompletionSource<bool> tcs)
{
if (shouldWait)
{
tcs = tcs ?? new TaskCompletionSource<bool>();
CurrentTaskCompletionSource = tcs;
if (CurrentModalNavigationTask == null || CurrentModalNavigationTask.IsCompleted)
{
CurrentModalNavigationTask = CurrentTaskCompletionSource.Task;
}
}
else
{
tcs?.SetResult(true);
}
if (tcs != null)
await tcs.Task;
}
void NaviAnimationFinished(object sender, EventArgs e)
{
var tcs = CurrentTaskCompletionSource;
CurrentTaskCompletionSource = null;
tcs?.SetResult(true);
}
void BusySetSignalNameHandler(Page sender, bool enabled)
{
// Verify that the page making the request is child of this platform
if (!PageIsChildOfPlatform(sender))
return;
if (null == _pageBusyDialog)
{
_pageBusyDialog = new Native.Dialog(Forms.NativeParent)
{
Orientation = PopupOrientation.Center,
BackgroundColor = EColor.Transparent
};
if (Device.Idiom == TargetIdiom.Phone)
{
_pageBusyDialog.SetPartColor("bg_title", EColor.Transparent);
_pageBusyDialog.SetPartColor("bg_content", EColor.Transparent);
}
else if (Device.Idiom == TargetIdiom.Watch)
{
_pageBusyDialog.Style = "circle";
}
var activity = new EProgressBar(_pageBusyDialog)
{
Style = "process_large",
IsPulseMode = true,
};
activity.PlayPulse();
activity.Show();
_pageBusyDialog.Content = activity;
}
_pageBusyCount = Math.Max(0, enabled ? _pageBusyCount + 1 : _pageBusyCount - 1);
if (_pageBusyCount > 0)
{
_pageBusyDialog.Show();
}
else
{
_pageBusyDialog.Dismiss();
_pageBusyDialog = null;
}
}
void AlertSignalNameHandler(Page sender, AlertArguments arguments)
{
[Tizen] Slightly enhance tizen backend (#1800) * Add IVisualElementRenderer.GetNativeContentGeometry - GetNativeContentGeometry can be used to compute position of content. - It can fix invalid layout by root content that is not placed in (0,0) * Update focus policy explitly on MasterDetailPage - IsPresentedChangedEventArgs has been added. * Fixed renderer creation order - Fixed an issue where the current page location of CarouselPage changes when changing device orientation * Add static Forms.MainWindow Property * Fix ScrollView.ScrollToAsync doens't work * Fix MasterDetail crash issue - When MasterBehaivor was changed, does not working anymore Because wrong property update - Fix Layout issue when MasterBehavior was changed LayoutCallback was not called because geometry was not changed * Allow to user can change MasterPage ratio - To change the ration of MasterPage, use UpdateMasterPageRatio() in derrived renderer of MasterDetailPageRenderer. * Fix ViewInitialized event processing * Dispose modal renderer correctly * Fixed issue the button's of Date/TimePicker can not be selected. * Fix black scrren issue when application initialize * Refactoring DeviceOrientation for tizen backend - Use Device.Info.CurrentOrientation in MasterDetailPage - Orientation was decided by device screen ratio - PortraitXXX/LandscapeXXX was not used because it only defeind in iOS devices * Fix Date&TimePicker to get focused on TV - This commit includes the behavior change of Native.Editfield. - Text Input is activated when user select the field when it has focus on. * Fixed the Appearing / Disappearing Event Handling of Pages - Fixed a problem where Focus is moved to a page other than the current Page of TabbedPage & CarouselPage - Fixed an issue where Appearing & Disappearing Event of Master / Detail of MasterDetailPage was not called * Fix MasterDetailPage crash issue * Change API visibility of Forms's utility methods into public * Remove VisualElementRenderer.DoLayout to avoid any confusion * Refactor CellRenderer's implementation * Fix Completed event routine for Entry & Editor * Implement TizenPlatformServices.OpenUriAction * Refactor Platform, Forms and FormsApplication in Tizen backend * Refactor platform more flexible * Add LightweightPlatform
2018-02-07 13:33:14 +03:00
// Verify that the page making the request is child of this platform
if (!PageIsChildOfPlatform(sender))
return;
2018-06-22 14:16:22 +03:00
Native.Dialog alert = Native.Dialog.CreateDialog(Forms.NativeParent, (arguments.Accept != null));
alert.Title = arguments.Title;
var message = arguments.Message.Replace("&", "&amp;").Replace("<", "&lt;").Replace(">", "&gt;").Replace(Environment.NewLine, "<br>");
2018-06-22 14:16:22 +03:00
alert.Message = message;
EButton cancel = new EButton(alert) { Text = arguments.Cancel };
alert.NegativeButton = cancel;
cancel.Clicked += (s, evt) =>
{
arguments.SetResult(false);
alert.Dismiss();
};
if (arguments.Accept != null)
{
EButton ok = new EButton(alert) { Text = arguments.Accept };
alert.NeutralButton = ok;
ok.Clicked += (s, evt) =>
{
arguments.SetResult(true);
alert.Dismiss();
};
}
alert.BackButtonPressed += (s, evt) =>
{
arguments.SetResult(false);
alert.Dismiss();
};
alert.Show();
2018-04-09 05:15:23 +03:00
_alerts.Add(alert);
alert.Dismissed += (s, e) => _alerts.Remove(alert);
}
void ActionSheetSignalNameHandler(Page sender, ActionSheetArguments arguments)
{
// Verify that the page making the request is child of this platform
if (!PageIsChildOfPlatform(sender))
return;
2018-06-22 14:16:22 +03:00
Native.Dialog alert = Native.Dialog.CreateDialog(Forms.NativeParent);
alert.Title = arguments.Title;
Box box = new Box(alert);
if (null != arguments.Destruction)
{
Native.Button destruction = new Native.Button(alert)
{
Text = arguments.Destruction,
2018-06-22 14:16:22 +03:00
Style = ButtonStyle.Text,
TextColor = EColor.Red,
AlignmentX = -1
};
destruction.Clicked += (s, evt) =>
{
arguments.SetResult(arguments.Destruction);
alert.Dismiss();
};
destruction.Show();
box.PackEnd(destruction);
}
foreach (string buttonName in arguments.Buttons)
{
Native.Button button = new Native.Button(alert)
{
Text = buttonName,
2018-06-22 14:16:22 +03:00
Style = ButtonStyle.Text,
AlignmentX = -1
};
button.Clicked += (s, evt) =>
{
arguments.SetResult(buttonName);
alert.Dismiss();
};
button.Show();
box.PackEnd(button);
}
box.Show();
alert.Content = box;
if (null != arguments.Cancel)
{
EButton cancel = new EButton(Forms.NativeParent) { Text = arguments.Cancel };
alert.NegativeButton = cancel;
cancel.Clicked += (s, evt) =>
{
alert.Dismiss();
};
}
alert.BackButtonPressed += (s, evt) =>
{
alert.Dismiss();
};
alert.Show();
2018-04-09 05:15:23 +03:00
_alerts.Add(alert);
alert.Dismissed += (s, e) => _alerts.Remove(alert);
}
bool PageIsChildOfPlatform(Page page)
{
var parent = page.AncestorToRoot();
return Page == parent || _navModel.Roots.Contains(parent);
}
SizeRequest IPlatform.GetNativeSize(VisualElement view, double widthConstraint, double heightConstraint)
{
return Platform.GetNativeSize(view, widthConstraint, heightConstraint);
}
2017-12-04 17:30:43 +03:00
}
}