Skip to content

Commit 9ee62c1

Browse files
myrootrookiejavaJoonghyunChosung-su박인서/Common Platform Lab(SR)/Associate/삼성전자
authored
[main][Tizen] Replace Tizen Backend engine (#9619)
* Remove comment * Remove image resource on Tizen project * Remove space * Fix compatibility issue (#41) * Fix compatibility issue * Fix Compatibility Resource path * Bump to latest - Modal Navigation Manager (#1563) - Implement the basic WindowHandler (#1468) - Don't extract native defaults, meaning users can no longer reset a color back to a platform theme (#1485) - Implement Alerts (Alert, Prompt and ActionSheet) (#1328) - And so on. * [SingleProject] Fix Issues (#50) * Bumt to latest - Effects (#1574) - Improve Window and AnimationManager (#1653) - and so on * Add Microsoft.Maui.Graphics.Skia as PackageReference * Add Essentials.Samples.Tizen (#24) * Add Essentials.Samples.Tizen * Add guard for null exception * Fix Essentials.Samples for Tizen * Fix csproj for net6 * Remove Forms.Init * Fix build error (#60) * Update referenced Tizen.UIExtensions version (#61) * Add BlazorWebView skeleton code (#62) * Bump to latest (#71) - Window lifecycle (#1754) - Move New Navigation Handler to Core and make it internal (#1800) - Scrollview handler (#1669) - ScrollView Resize + Window Handler Resize (#1676) - Font AutoScalingEnabled (#1774) - Rename Font Properties (#1755) - Update layout system to ensure native measure/arrange are called for all controls, even from Page subclasses (#1819) - IContainer as IList<IView> (#1724) - Implement Layout padding for new StackLayouts and GridLayout (#1749) - Delete all the TabIndex, TabStop, Focusable things! (#1777) - Introduce SetSemanticFocus API via SemanticExtensions (#1829) - Improve Window and AnimationManager (#1653) - And so on * Remove IPage on Tizen (#72) - Merge IFrameworkElement and IView and Remove IPage (#1875) * Add Blazor webview (#67) * Add Blazor webview * Replace space to tab * remove space * Fix entry cursor error (#68) * Fix entry cursor error * Update code referring to android extension * Remove duplicate code & Add exception cases * Code fixes for consistency * Fix nullable issue (#77) * Fix Image loading (#78) * Fix nested layout issue (#79) Co-authored-by: 허강호/Common Platform Lab(SR)/Principal Engineer/삼성전자 <[email protected]> * Fix issues caused by bump up (#75) * Fix issues caused by bump up * Update Tizen file provider * Update file provider with proper path * Fix unmatched partial method (#84) * Fixes incorrect parameter type for ILayoutManager.ArrangeChildren (Rectangle -> Size). (#91) * Make the HandlerToRendererShim simple * Revert "Fixes incorrect parameter type for ILayoutManager.ArrangeChildren (Rectangle -> Size). (#91)" (#97) This reverts commit c54ac83. * Refactor the LayoutHandler (#99) * Fix layout measure issue (#100) * Fix LayoutHandler Update issue (#103) * Fix LayoutHandler Update issue * Implement InvalidateMeasure propagation * Update MapBackground * Add InitializationOptions (#107) * Add InitializationOptions * Set UseSkiaSharp true as default * Apply DP as default * Fix SKClipperView to have proper size (#115) * Fix Essentials sample (#108) * Fix Essentials sample for Tizen * Remove UseSkiaSharp flag * Remove MaterialComponents * Fix Tizen flag * Remove CustomRenderer * Add ShellHandler (#64) * Add ShellHandler * Move ShellView into Platform/Tizen * Update ShellView * Move the code for embedded tizen resources to csproj * Add UIExtenstions for shell * MAUI workload for Tizen (#66) * Fix build and runtime error after bumping to latest code * Fix HandlerToRendererShim dispose (#127) * Add ShellSearchView (#121) * Add ShellSearchView * Fix the layout issue in ShellSearchResultList * Enable nullable * Fix maximum height of ShellSearchResultList * Fix scaling issue on Clip (#130) * Fix DisplayResolutionUnit sync issue (#134) * Fix build error (#137) * Replace SkiaGraphicsView with local patch (#135) This commit will be revert when upstream code is updated * Support Min/Max Height/Width on IView and applying MauiApp/MauiAppBuilder pattern - Support Min/Max Height/Width on IView (#2265) - Updating .NET MAUI to use MauiApp/MauiAppBuilder pattern and use MS.Extensions.DependencyInjection (#2137) * Fix Tizen Templates (#144) * Fix webview break caused by updated dependency (#143) * Update the Tizen.UIExtension.ElmSharp version (#145) * Reomve internal UIExtensions compoments for Shell (#147) * Adds missing implementation after bumping to latest main * [Tizen] Adds BoxView Handler * [Tizen] Implement ProgressColor property in ProgressBarHandlers - Implement ProgressColor property in ProgressBarHandlers (#600) * [Tizen] Handle ContentViews and templated content in new layout system * Bump to latest (rc1) - ImageButtonHandler and Handler Re-usability (#2352) - Remove IBoxView (#2619) - Add SupportedOSPlatformVersion (#2565) - Merge all the .NET 6 projects/solutions (#2505) - Shadow Support (#570) - Add IndicatorView handler(#2038) * [Tizen] Apply graphics related code review feedback * [Tizen] Port H/V TextAlignment to Editor/Picker Handler * [Tizen] Add TVShellView (#183) * [Tizen] Add TVShellView * [Tizen] Update TVShellView * [Tizen] Update NativeView for Shell * [Tizen] Update ShellView * [Tizen] Change default FlyoutBackgroundColor for TV * [Tizen] Enable nullable * Refactor WrapperView to draw drawable features (#186) * Refactor WrapperView to draw drawable features * Update class names and devide files * Override NeesContainer to remove duplicated code * Update class names * [Tizen] Adds ApplicationHandler * Fix Background issue of Frame (#193) * Fix UpdateBackground (#194) * Fix UpdateBackground * Add ContentView Background mapper * Fix Editor/Entry/Label/Layout Background * Add IWrapperViewCanvas.Content * Add PageHandler Background mapper * Restore WrapperView * Remove unnecessary namespace * [Tizen] Fix build error on PageHandler * [Tizen] Apply ITextButton related changes * [Tizen] Add Shadows (#233) * [Tizen] Add Shadows * [Tizen] Apply review comments * [Tizen] Move updating shape in proper position * [Tizen] Update BackgroundDrawable * [Tizen] Apply review comments * [Tizen] Add BorderDrawable (#224) * Move to platform specific * Fix border handler for Tizen * Rename ToDrawable method * Fix border content layout * Fix BorderView * Apply rebase * [Tizen] Fix entry cursor issue (#222) * Fix entry cursor issue * Fix UpdateSelectionLength method * [Tizen] Remove TVNavigationDrawer TVNavigationView (#223) * [Tizen] Remove TVNavigationDrawer TVNavigationView * [Elmsharp] Update Tizen.UIExtensions version * [Tizen] Initial Multi Window support * [Tizen] Fix MauiContext * [Tizen] Refactor Border by defining MauiDrawable (#248) * [Tizen] Refactor Border by defining MauiDrawable * [Tizen] Apply review comments * [Tizen] Remove unnecessary type casting * [Tizen] Move getting path logic to drawable * [Tizen] Obsolete AndExpand & Remove IsolatedStorage * Fix tizen solution (.sln) correctly * [Tizen] Add VerticalTextAlignment * [Tizen] Fix Scoping of MauiContext * [Tizen] Use CoreApplication as native app type * [Tizen] Applying upstream changes * [Tizen] Add ContainerView to Layout if it's present * [Tizen] Initial Reloadyfy support * [Tizen] Initial IVisualDiagnosticOveraly support * [Tizen] Move types in the Platform folder into the Platform namespaces * Fix CollectionView layout issue (#288) * Fix CollectionView layout issue * Remove unnecessary code * [Tizen] ZIndex proof-of-concept * Fix ScrollView ContentSize and Padding margin (#291) * Fix ScrollView ContentSize and Padding margin * Fix MapRequestScrollTo * Update src/Core/src/Handlers/ScrollView/ScrollViewHandler.Tizen.cs Co-authored-by: 허강호/Common Platform Lab(SR)/Principal Engineer/삼성전자 <[email protected]> * Update src/Core/src/Handlers/ScrollView/ScrollViewHandler.Tizen.cs Co-authored-by: 허강호/Common Platform Lab(SR)/Principal Engineer/삼성전자 <[email protected]> * Remove MapContentSize Co-authored-by: 허강호/Common Platform Lab(SR)/Principal Engineer/삼성전자 <[email protected]> * Implements WindowOverlay and VisualDiagnosticsOverlay (#294) * Implements WindowOverlay and VisualDiagnosticsOverlay * Apply code review * [Tizen] Fix Image Handler * Remove GetDesiredSize (#295) * [Tizen] Fix ButtonHandler * [Tizen] Organize and centralize HandlerExtensions * Refactor WrapperView and Fix Issue (#302) * Refactor WrapperView * Use Thickness type for Shadow margin * Update variable name * Update class name to GraphicsExtensions * Fix essentials sample for Tizen (#305) * [Tizen] Fix NativeView casting issue * Fix BlazorWebview binary resource issue (#317) * [Tizen] Handle query strings in Blazor static assets by trimming them out * Refactor MauiContext (#330) * [Tizen] Adds PaintExtensions * [Tizen] Implement CursorPosition in IEditor/ITextInput Handlers * [Tizen] Remove GetNative * [Tizen] Update Microsoft.NET.Sdk.Maui/WorkloadManifest * [Tizen] Bump to latest * [Tizen] Use legacy compat renderers temporarily * [Tizen] Implement IPlatformApplication.Current * [Tizen] Fix INativeViewHandler to return more expected NativeView * [Tizen] Remove legacy TFMs * [Tizen] Remove `IPlatformInvalidate` and `Device.Invalidate() * [Tizen] Fix Essential sample build error * [Tizen] Refactor Essential's implementations * [Tizen] Renaming public APIs Native -> Platform * [Tizen] Interfaced Handler for Label, Page, NavigationView, Picker, ProgressBar, SwipeView * [Tizen] Moved GetPlatformSize logic into a new service * [Tizen] Interfaced handler for Switch, TimePicker, WebView, Slider, SearchBar, RefreshView, RadioButton * [Tizen] Fix build error after rebasing * [Tizen] Move TabbedPageHandler to TabbedViewHandler * [Tizen] Backport p14 changes * [Tizen] Loaded/Unloaded events and propagate Window * [Tizen] Implement FillRule property in Polygon/PolylineHandler * [Tizen] Add install tizen to provision.yml * [Tizen] Move package version into Versions.props * Adds the Tizen backend * [Tizen] Add Resizetizer Tizen Implementation * Bump to latest and fix build error * Bump to latest - Apply to start adding in APIs for adding legacy renderers via assembly scanning (#1333) - Update to IMauiContext (#1357) - and so on * Bump to latest - Apply to patch related to Animation (#1436) - Apply to register Microsoft.Maui.Graphics Platforms (#1441) - and so on. * Bump to latest - Modal Navigation Manager (#1563) - Implement the basic WindowHandler (#1468) - Don't extract native defaults, meaning users can no longer reset a color back to a platform theme (#1485) - Implement Alerts (Alert, Prompt and ActionSheet) (#1328) - And so on. * Bumt to latest - Effects (#1574) - Improve Window and AnimationManager (#1653) - and so on * Fix build error (#60) * Bump to latest (#71) - Window lifecycle (#1754) - Move New Navigation Handler to Core and make it internal (#1800) - Scrollview handler (#1669) - ScrollView Resize + Window Handler Resize (#1676) - Font AutoScalingEnabled (#1774) - Rename Font Properties (#1755) - Update layout system to ensure native measure/arrange are called for all controls, even from Page subclasses (#1819) - IContainer as IList<IView> (#1724) - Implement Layout padding for new StackLayouts and GridLayout (#1749) - Delete all the TabIndex, TabStop, Focusable things! (#1777) - Introduce SetSemanticFocus API via SemanticExtensions (#1829) - Improve Window and AnimationManager (#1653) - And so on * Bump to latest * Fix Essentials sample (#108) * Fix Essentials sample for Tizen * Remove UseSkiaSharp flag * Remove MaterialComponents * Fix Tizen flag * Remove CustomRenderer * Add ShellHandler (#64) * Add ShellHandler * Move ShellView into Platform/Tizen * Update ShellView * Move the code for embedded tizen resources to csproj * Add UIExtenstions for shell * MAUI workload for Tizen (#66) * Fix build and runtime error after bumping to latest code * Fix Essentials (#146) * Fix Essentials sample for tizen * Add SemanticScreenReader for Tizen * Fix Startup * Adds missing implementation after bumping to latest main * Bump to latest (rc1) - ImageButtonHandler and Handler Re-usability (#2352) - Remove IBoxView (#2619) - Add SupportedOSPlatformVersion (#2565) - Merge all the .NET 6 projects/solutions (#2505) - Shadow Support (#570) - Add IndicatorView handler(#2038) * Refactor WrapperView to draw drawable features (#186) * Refactor WrapperView to draw drawable features * Update class names and devide files * Override NeesContainer to remove duplicated code * Update class names * [Tizen] Adds ApplicationHandler * Fix UpdateBackground (#194) * Fix UpdateBackground * Add ContentView Background mapper * Fix Editor/Entry/Label/Layout Background * Add IWrapperViewCanvas.Content * Add PageHandler Background mapper * Restore WrapperView * Remove unnecessary namespace * [Tizen] Add BorderDrawable (#224) * Move to platform specific * Fix border handler for Tizen * Rename ToDrawable method * Fix border content layout * Fix BorderView * Apply rebase * [Tizen] Refactor Border by defining MauiDrawable (#248) * [Tizen] Refactor Border by defining MauiDrawable * [Tizen] Apply review comments * [Tizen] Remove unnecessary type casting * [Tizen] Move getting path logic to drawable * [Tizen] Fix Scoping of MauiContext * [Tizen] Applying upstream changes * [Tizen] Move types in the Platform folder into the Platform namespaces * [Tizen] Fix ButtonHandler * [Tizen] Organize and centralize HandlerExtensions * Refactor MauiContext (#330) * Add NUI handler * [Tizen] Refactor MauiApplication and MauiContext (#216) * Add AlertManager (#214) * Code clean up (#218) * Fix build error on Controls.Sample (#225) * [Tizen] Initail CollectionViewHandler for NUI * Fix PlatformEffect NativeView type (#231) * Fix Control.Sample correctly (#234) * Fix NamedSize (#242) * Update NavigationPageRenderer (#238) - Implement title view * Fix build errors and apply upstream changes * Refactoring Window and modal (#246) * Obsolete AndExpand & fix build eror * [NUI] Implement BlazorWebView (#259) * Implement BlazorWebView * Update NUI WebView alias name * Bump to latest * Fix MinimumWidth/Height MaximumWidth/Height (#270) * [NUI] Add GestureManager (#272) * Add gesture handler * enable nullable * use lazy * Remove unnessary EFL code in ScrollViewHandler (#274) * Add TabbedPage Renderer (#275) * [NUI] Implement WrapperView enabling Border and Shadow (#273) * [NUI] Add MauiDrawable enabling Border and Shadow * [NUI] Remove BorderView type and refactor * Refactor StrokeExtensions * Remove unnecessary code * Update a way clearing content * [NUI] Add Picker handler (#276) * Add Picker handler * Apply code review * Change timing adding event handler * Update Picker on touch (#293) * Fix NeedsContainer (#306) * Update FrameRenderer to support Brush (#309) * Fix minor layout issue (#314) * Fix build error * Fix ScrollView ContentSize (#324) * Refactor Maui context (#328) * Fix build error after bumping to latest * [Tizen] Add ImageButtonHandler (#334) * [NUI] Implement Editor/Entry handler (#335) * Implement Editor/Entry handler * Fix measure issue * Update paramer name * Fix if statement * Fix Editor/Entry CursorPosition issue (#336) * [NUI] Add CollectionViewHandler (#352) * Fix EmptyView on CollectionView * Add CollectionViewHandler * Add SearchBar handler (#354) * Implement Clip (#384) * Bump to latest * [NUI] Add TimePickerHandler (#390) * [NUI] Add TimePickerHandler * Update button placement * Clean up code after rebase (#399) * Fix TabbedPage to use Controls.Grid instead Compatibility.Grid (#400) * Fix Controls MapText (#406) * Fix focus management (#407) * Update WrapperView (#409) * Update Tizen platform to tizen10.0 (#416) * Update WebView handler and MauiWebView handler (#417) * Update Label shadow (#420) * Fix build error after rebase * Fix InputTransparent (#424) * Implement CarouselView handler (#428) * Fix GestureManager crash issue (#432) * Update WebView EvaluateJavaScript async (#435) * Fix CascadeInputTransparent (#442) * Add NavigationView handler (#449) * Update WindowOverlay handler (#452) * Update ViewExtensions (#455) * Update ImageSourceService (#454) * Fix MauiSearchBar IsEnabled property (#458) * Add SwipeView handler (#460) * Clean code after rebase * Fix GetPath to return a correct path (#465) * Update for focus navigation (#459) * Cleanup code after rebase * Fix build error after rebase * Implement UpdateBackgroundImageSourceAsync extensions method (#479) * [NUI] Update SliderHandler with NUI slider component (#487) * Update SliderHandler with NUI compnent * Update SliderHandler with review feedback * Update with review feedback * Fix GetPlatformViewBounds as Pixel coordinate (#488) * Fix ScrollView content size update issue (#492) * Implement Controls.Compatibility for tizen (#493) * Optimize Layout Measure (#495) * Code cleanup after code rebase * Fix z-order on Layout (#497) * [NUI] Update StepperHandler (#498) * Update StepperHandler * Apply Review comment * Fix Frame measure (#501) * Fix BorderView (#500) * Add RadioButton handler (#499) * Fix CollectionView Item measure (#502) * Fix Measure contraint convert (#504) * Fix WrapperView measure (#507) * Implement Missing mapper (#509) * Fix WrapperView Width/HeightSpecification (#510) * Fix ShapeView (#511) * Optimize View measure (#513) * Fix NavigationPage disposing pages (#514) * Fix build error after rebase * Fix WebView (#515) * Fix TableView (#516) * Fix Compatibility Cell templates (#517) * [NUI] Add IndicatorViewHandler (#518) * Add IndicatorViewHandler * Update review comment * Add space * Fix ListViewRenderer (#519) * Fix Binding error on CollectionView (#520) * Fix layout issue when view was shown from hide (#522) * [NUI] Fix ImageButton Clicked (#523) * Fix ImageButton Clicked * Apply review comment * Fix BlazorWebView RequestIntercept issue (#524) * Fix Layout size issue (#525) * Fix build error after rebase * [NUI] Add DatePicker Handler (#528) * Add DatePicker * Add missing class * Update Style and Use DummyPopupPage * Refactoring with MauiTimePicker * add new file Co-authored-by: Jay Cho <[email protected]> * Fix GetBoundingBox/OverlayWindow touch point coordinate to DP (#529) * Fix CollectionView EmptyView HeaderFooter (#530) * Update DateTimePicker width on horizontal (#531) * Fix DisconnectHandler (#532) * Update Page default background color (#533) * Clean up NuGet.config (#535) * [NUI] Update font size (#536) * Update FontNamedSize * adjust font size on tv profile * Add RefreshViewHandler (#490) * [Tizen] Refactor compat renderers (#538) * [Tizen] Refactor the TabbedPageRenderer (#541) * [Tizen] Add FlyoutViewHandler (#540) * Add FlyoutView * Update FlyoutView to cover TV drawer * Add missing connecting handler * Update handler implementation using extensions * Simplify code Co-authored-by: Jay Cho <[email protected]> * [Tizen] Add MauiPicker (#543) * Add MenuIcon to Toolbar (#542) * Add MenuIcon to Toolbar * Apply Reviews Co-authored-by: Jay Cho <[email protected]> * [Tizen] Add ShellHandler (#539) * [NUI] Add ShellHandler * Update PublicAPI.Shipped.txt file * Fix build error * Update AppHostingBuilder * Update ShellView with review feedback * Remove unnecessary code * Update Shell navigation stack * Add IDisposable interface * Update ShellSectionView * Update AdppHostBuilderExtensions * Rebase and update toolbar to resolve conflict * Remove ShellContentHandler and update ToolbarHandler * Update ShellView to handle DrawerToggleVisible * Remove unnecessary code * Fix build error after rebase Co-authored-by: Kangho Hur <[email protected]> Co-authored-by: 조중현/Common Platform Lab(SR)/Engineer/삼성전자 <[email protected]> Co-authored-by: 김성수/Common Platform Lab(SR)/Staff Engineer/삼성전자 <[email protected]> Co-authored-by: 박인서/Common Platform Lab(SR)/Associate/삼성전자 <[email protected]> Co-authored-by: 민성현/Common Platform Lab(SR)/Staff Engineer/삼성전자 <[email protected]> Co-authored-by: Jay Cho <[email protected]>
1 parent 79cac92 commit 9ee62c1

File tree

539 files changed

+12429
-39503
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

539 files changed

+12429
-39503
lines changed

.nuspec/Microsoft.Maui.Controls.MultiTargeting.targets

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,4 @@
113113
<PropertyGroup Condition=" $(TargetFramework.StartsWith('uap10.0')) ">
114114
<DefineConstants>WINDOWS_UWP;$(DefineConstants)</DefineConstants>
115115
</PropertyGroup>
116-
117116
</Project>

.nuspec/Microsoft.Maui.Controls.SingleProject.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
BeforeTargets="_MauiInjectXamlCssAdditionalFiles;GenerateMSBuildEditorConfigFileShouldRun"
112112
Condition=" '$(EnableDefaultItems)' == 'true' and '$(SingleProject)' == 'true' ">
113113

114-
<!-- Removals -->
114+
<!-- Removals -->
115115
<ItemGroup>
116116
<!-- Remove everything that isn't part of this platform -->
117117
<Compile

eng/Microsoft.Extensions.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
Version="$(MicrosoftCodeAnalysisPublicApiAnalyzersVersion)"
127127
/>
128128
<PackageReference
129-
Update="Tizen.UIExtensions.ElmSharp"
129+
Update="Tizen.UIExtensions.NUI"
130130
Version="$(TizenUIExtensionsVersion)"
131131
/>
132132
<PackageReference

src/BlazorWebView/src/Maui/PublicAPI/net-tizen/PublicAPI.Shipped.txt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,9 @@ Microsoft.AspNetCore.Components.WebView.Maui.RootComponentsCollection
3636
Microsoft.AspNetCore.Components.WebView.Maui.RootComponentsCollection.JSComponents.get -> Microsoft.AspNetCore.Components.Web.JSComponentConfigurationStore!
3737
Microsoft.AspNetCore.Components.WebView.Maui.RootComponentsCollection.RootComponentsCollection(Microsoft.AspNetCore.Components.Web.JSComponentConfigurationStore! jsComponents) -> void
3838
Microsoft.AspNetCore.Components.WebView.Maui.TizenWebViewManager
39-
Microsoft.AspNetCore.Components.WebView.Maui.TizenWebViewManager.TizenWebViewManager(Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler! blazorMauiWebViewHandler, Tizen.WebView.WebView! webview, System.IServiceProvider! provider, Microsoft.AspNetCore.Components.Dispatcher! dispatcher, Microsoft.Extensions.FileProviders.IFileProvider! fileProvider, Microsoft.AspNetCore.Components.Web.JSComponentConfigurationStore! jsComponents, string! contentRootRelativeToAppRoot, string! hostPageRelativePath) -> void
39+
Microsoft.AspNetCore.Components.WebView.Maui.TizenWebViewManager.TizenWebViewManager(Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler! blazorMauiWebViewHandler, Tizen.NUI.BaseComponents.WebView! webview, System.IServiceProvider! provider, Microsoft.AspNetCore.Components.Dispatcher! dispatcher, Microsoft.Extensions.FileProviders.IFileProvider! fileProvider, Microsoft.AspNetCore.Components.Web.JSComponentConfigurationStore! jsComponents, string! contentRootRelativeToAppRoot, string! hostPageRelativePath) -> void
4040
override Microsoft.AspNetCore.Components.WebView.Maui.TizenWebViewManager.NavigateCore(System.Uri! absoluteUri) -> void
4141
override Microsoft.AspNetCore.Components.WebView.Maui.TizenWebViewManager.SendMessage(string! message) -> void
42-
Microsoft.AspNetCore.Components.WebView.Maui.WebViewContainer
43-
Microsoft.AspNetCore.Components.WebView.Maui.WebViewContainer.WebViewContainer(ElmSharp.EvasObject! parent) -> void
44-
Microsoft.AspNetCore.Components.WebView.Maui.WebViewContainer.WebView.get -> Tizen.WebView.WebView!
4542
Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs
4643
Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs.Url.get -> System.Uri!
4744
Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs.UrlLoadingStrategy.get -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
@@ -51,13 +48,13 @@ Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy.CancelLoad = 2 -> Mic
5148
Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy.OpenExternally = 0 -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
5249
Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy.OpenInWebView = 1 -> Microsoft.AspNetCore.Components.WebView.UrlLoadingStrategy
5350
Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions
54-
override Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.CreatePlatformView() -> Microsoft.AspNetCore.Components.WebView.Maui.WebViewContainer!
55-
override Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.ConnectHandler(Microsoft.AspNetCore.Components.WebView.Maui.WebViewContainer! platformView) -> void
56-
override Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.DisconnectHandler(Microsoft.AspNetCore.Components.WebView.Maui.WebViewContainer! platformView) -> void
51+
override Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.CreatePlatformView() -> Tizen.NUI.BaseComponents.WebView!
52+
override Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.ConnectHandler(Tizen.NUI.BaseComponents.WebView! platformView) -> void
53+
override Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.DisconnectHandler(Tizen.NUI.BaseComponents.WebView! platformView) -> void
5754
static Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.MapHostPage(Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler! handler, Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView! webView) -> void
5855
static Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.MapRootComponents(Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler! handler, Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView! webView) -> void
5956
static Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions.AddBlazorWebViewDeveloperTools(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
6057
static Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions.AddMauiBlazorWebView(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.AspNetCore.Components.WebView.Maui.IMauiBlazorWebViewBuilder!
6158
static Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.BlazorWebViewMapper -> Microsoft.Maui.PropertyMapper<Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView!, Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler!>!
6259
virtual Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.CreateFileProvider(string! contentRootDir) -> Microsoft.Extensions.FileProviders.IFileProvider!
63-
~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs.WebView.get -> Tizen.WebView.WebView
60+
~Microsoft.AspNetCore.Components.WebView.BlazorWebViewInitializedEventArgs.WebView.get -> Tizen.NUI.BaseComponents.WebView

src/BlazorWebView/src/Maui/Tizen/BlazorWebViewHandler.Tizen.cs

Lines changed: 77 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
using System;
2+
using System.Collections.Generic;
23
using System.IO;
34
using Microsoft.Extensions.DependencyInjection;
45
using Microsoft.Extensions.FileProviders;
56
using Microsoft.Maui;
67
using Microsoft.Maui.Dispatching;
78
using Microsoft.Maui.Handlers;
8-
using Tizen.WebView;
9-
using TChromium = Tizen.WebView.Chromium;
10-
using TWebView = Tizen.WebView.WebView;
9+
using Tizen.NUI;
10+
using NWebView = Tizen.NUI.BaseComponents.WebView;
1111

1212
namespace Microsoft.AspNetCore.Components.WebView.Maui
1313
{
1414
/// <summary>
1515
/// The Tizen <see cref="ViewHandler"/> for <see cref="BlazorWebView"/>.
1616
/// </summary>
17-
public partial class BlazorWebViewHandler : ViewHandler<IBlazorWebView, WebViewContainer>
17+
public partial class BlazorWebViewHandler : ViewHandler<IBlazorWebView, NWebView>
1818
{
19+
private const string BlazorWebViewIdentifier = "BlazorWebView:";
20+
private const string UserAgentHeaderKey = "User-Agent";
1921
private const string AppOrigin = "http://0.0.0.0/";
2022
private const string BlazorInitScript = @"
2123
window.__receiveMessageCallbacks = [];
@@ -42,53 +44,99 @@ public partial class BlazorWebViewHandler : ViewHandler<IBlazorWebView, WebViewC
4244
})();
4345
";
4446

45-
private TizenWebViewManager? _webviewManager;
46-
private WebViewExtensions.InterceptRequestCallback? _interceptRequestCallback;
47+
static private Dictionary<string, WeakReference<BlazorWebViewHandler>> s_webviewHandlerTable = new Dictionary<string, WeakReference<BlazorWebViewHandler>>();
4748

48-
private TWebView PlatformWebView => PlatformView.WebView;
49+
private TizenWebViewManager? _webviewManager;
4950

5051
private bool RequiredStartupPropertiesSet =>
5152
//_webview != null &&
5253
HostPage != null &&
5354
Services != null;
5455

5556
/// <inheritdoc />
56-
protected override WebViewContainer CreatePlatformView()
57+
protected override NWebView CreatePlatformView()
5758
{
58-
TChromium.Initialize();
59-
MauiApplication.Current.Terminated += (s, e) => TChromium.Shutdown();
60-
61-
return new WebViewContainer(PlatformParent);
59+
return new NWebView()
60+
{
61+
MouseEventsEnabled = true,
62+
KeyEventsEnabled = true,
63+
};
6264
}
6365

6466
/// <inheritdoc />
65-
protected override void ConnectHandler(WebViewContainer platformView)
67+
protected override void ConnectHandler(NWebView platformView)
6668
{
67-
_interceptRequestCallback = OnRequestInterceptCallback;
68-
PlatformWebView.LoadFinished += OnLoadFinished;
69-
PlatformWebView.AddJavaScriptMessageHandler("BlazorHandler", PostMessageFromJS);
70-
PlatformWebView.SetInterceptRequestCallback(_interceptRequestCallback);
71-
PlatformWebView.GetSettings().JavaScriptEnabled = true;
69+
platformView.PageLoadFinished += OnLoadFinished;
70+
platformView.Context.RegisterHttpRequestInterceptedCallback(OnRequestInterceptStaticCallback);
71+
platformView.AddJavaScriptMessageHandler("BlazorHandler", PostMessageFromJS);
72+
platformView.UserAgent += $" {BlazorWebViewIdentifier}{GetHashCode()}";
73+
s_webviewHandlerTable[GetHashCode().ToString()] = new WeakReference<BlazorWebViewHandler>(this);
7274
}
7375

7476
/// <inheritdoc />
75-
protected override void DisconnectHandler(WebViewContainer platformView)
77+
protected override void DisconnectHandler(NWebView platformView)
7678
{
77-
PlatformWebView.LoadFinished -= OnLoadFinished;
79+
platformView.PageLoadFinished -= OnLoadFinished;
7880
base.DisconnectHandler(platformView);
81+
s_webviewHandlerTable.Remove(GetHashCode().ToString());
82+
}
83+
84+
85+
private void PostMessageFromJS(string message)
86+
{
87+
_webviewManager!.MessageReceivedInternal(new Uri(PlatformView.Url), message);
7988
}
8089

81-
private void PostMessageFromJS(JavaScriptMessage message)
90+
private void OnLoadFinished(object? sender, WebViewPageLoadEventArgs e)
8291
{
83-
if (message is null)
92+
//FocusManager.Instance.SetCurrentFocusView(NativeView);
93+
var url = PlatformView.Url;
94+
95+
if (url == AppOrigin)
96+
PlatformView.EvaluateJavaScript(BlazorInitScript);
97+
}
98+
99+
private static void OnRequestInterceptStaticCallback(WebHttpRequestInterceptor interceptor)
100+
{
101+
if (interceptor.Headers.TryGetValue(UserAgentHeaderKey, out var agent))
84102
{
85-
throw new ArgumentNullException(nameof(message));
103+
var idx = agent.IndexOf(BlazorWebViewIdentifier);
104+
if (idx >= 0)
105+
{
106+
var webviewKey = agent.Substring(idx + BlazorWebViewIdentifier.Length);
107+
if (s_webviewHandlerTable.TryGetValue(webviewKey, out var weakHandler)
108+
&& weakHandler.TryGetTarget(out var handler))
109+
{
110+
handler.OnRequestInterceptCallback(interceptor);
111+
return;
112+
}
113+
}
86114
}
115+
interceptor.Ignore();
116+
}
87117

88-
if (message.Name.Equals("BlazorHandler", StringComparison.Ordinal))
118+
private void OnRequestInterceptCallback(WebHttpRequestInterceptor interceptor)
119+
{
120+
var url = interceptor.Url;
121+
if (url.StartsWith(AppOrigin))
89122
{
90-
_webviewManager!.MessageReceivedInternal(new Uri(PlatformWebView.Url), message.GetBodyAsString());
123+
var allowFallbackOnHostPage = url.EndsWith("/");
124+
url = QueryStringHelper.RemovePossibleQueryString(url);
125+
if (_webviewManager!.TryGetResponseContentInternal(url, allowFallbackOnHostPage, out var statusCode, out var statusMessage, out var content, out var headers))
126+
{
127+
var header = $"HTTP/1.0 200 OK\r\n";
128+
foreach (var item in headers)
129+
{
130+
header += $"{item.Key}:{item.Value}\r\n";
131+
}
132+
header += "\r\n";
133+
MemoryStream memstream = new MemoryStream();
134+
content.CopyTo(memstream);
135+
interceptor.SetResponse(header, memstream.ToArray());
136+
return;
137+
}
91138
}
139+
interceptor.Ignore();
92140
}
93141

94142
private void StartWebViewCoreIfPossible()
@@ -105,14 +153,14 @@ private void StartWebViewCoreIfPossible()
105153

106154
// We assume the host page is always in the root of the content directory, because it's
107155
// unclear there's any other use case. We can add more options later if so.
108-
var contentRootDir = Path.GetDirectoryName(HostPage!) ?? string.Empty;
109-
var hostPageRelativePath = Path.GetRelativePath(contentRootDir, HostPage!);
156+
var contentRootDir = System.IO.Path.GetDirectoryName(HostPage!) ?? string.Empty;
157+
var hostPageRelativePath = System.IO.Path.GetRelativePath(contentRootDir, HostPage!);
110158

111159
var fileProvider = VirtualView.CreateFileProvider(contentRootDir);
112160

113161
_webviewManager = new TizenWebViewManager(
114162
this,
115-
PlatformWebView,
163+
PlatformView,
116164
Services!,
117165
new MauiDispatcher(Services!.GetRequiredService<IDispatcher>()),
118166
fileProvider,
@@ -125,7 +173,7 @@ private void StartWebViewCoreIfPossible()
125173
VirtualView.BlazorWebViewInitializing(new BlazorWebViewInitializingEventArgs());
126174
VirtualView.BlazorWebViewInitialized(new BlazorWebViewInitializedEventArgs
127175
{
128-
WebView = PlatformWebView,
176+
WebView = PlatformView,
129177
});
130178

131179
if (RootComponents != null)
@@ -139,50 +187,6 @@ private void StartWebViewCoreIfPossible()
139187
_webviewManager.Navigate("/");
140188
}
141189

142-
private void OnRequestInterceptCallback(IntPtr context, IntPtr request, IntPtr userdata)
143-
{
144-
if (request == IntPtr.Zero)
145-
{
146-
return;
147-
}
148-
149-
var url = PlatformWebView.GetInterceptRequestUrl(request);
150-
151-
if (url.StartsWith(AppOrigin))
152-
{
153-
var allowFallbackOnHostPage = url.EndsWith("/");
154-
url = QueryStringHelper.RemovePossibleQueryString(url);
155-
if (_webviewManager!.TryGetResponseContentInternal(url, allowFallbackOnHostPage, out var statusCode, out var statusMessage, out var content, out var headers))
156-
{
157-
var header = $"HTTP/1.0 200 OK\r\n";
158-
foreach (var item in headers)
159-
{
160-
header += $"{item.Key}:{item.Value}\r\n";
161-
}
162-
header += "\r\n";
163-
164-
using (MemoryStream memstream = new MemoryStream())
165-
{
166-
content.CopyTo(memstream);
167-
var body = memstream.ToArray();
168-
PlatformWebView.SetInterceptRequestResponse(request, header, body, (uint)body.Length);
169-
}
170-
return;
171-
}
172-
}
173-
174-
PlatformWebView.IgnoreInterceptRequest(request);
175-
}
176-
177-
private void OnLoadFinished(object? sender, EventArgs e)
178-
{
179-
PlatformWebView.SetFocus(true);
180-
var url = PlatformWebView.Url;
181-
182-
if (url == AppOrigin)
183-
PlatformWebView.Eval(BlazorInitScript);
184-
}
185-
186190
internal IFileProvider CreateFileProvider(string contentRootDir)
187191
{
188192
return new TizenMauiAssetFileProvider(contentRootDir);

src/BlazorWebView/src/Maui/Tizen/TizenWebViewManager.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Text.Encodings.Web;
55
using Microsoft.AspNetCore.Components.Web;
66
using Microsoft.Extensions.FileProviders;
7-
using TWebView = Tizen.WebView.WebView;
7+
using NWebView = Tizen.NUI.BaseComponents.WebView;
88

99
namespace Microsoft.AspNetCore.Components.WebView.Maui
1010
{
@@ -17,7 +17,7 @@ public class TizenWebViewManager : WebViewManager
1717
private const string AppOrigin = "http://0.0.0.0/";
1818

1919
private readonly BlazorWebViewHandler _blazorMauiWebViewHandler;
20-
private readonly TWebView _webview;
20+
private readonly NWebView _webview;
2121
private readonly string _contentRootRelativeToAppRoot;
2222

2323
/// <summary>
@@ -31,7 +31,7 @@ public class TizenWebViewManager : WebViewManager
3131
/// <param name="jsComponents">Describes configuration for adding, removing, and updating root components from JavaScript code.</param>
3232
/// <param name="contentRootRelativeToAppRoot">Path to the directory containing application content files.</param>
3333
/// <param name="hostPageRelativePath">Path to the host page within the fileProvider.</param>
34-
public TizenWebViewManager(BlazorWebViewHandler blazorMauiWebViewHandler, TWebView webview, IServiceProvider provider, Dispatcher dispatcher, IFileProvider fileProvider, JSComponentConfigurationStore jsComponents, string contentRootRelativeToAppRoot, string hostPageRelativePath)
34+
public TizenWebViewManager(BlazorWebViewHandler blazorMauiWebViewHandler, NWebView webview, IServiceProvider provider, Dispatcher dispatcher, IFileProvider fileProvider, JSComponentConfigurationStore jsComponents, string contentRootRelativeToAppRoot, string hostPageRelativePath)
3535
: base(provider, dispatcher, new Uri(AppOrigin), fileProvider, jsComponents, hostPageRelativePath)
3636
{
3737
_blazorMauiWebViewHandler = blazorMauiWebViewHandler ?? throw new ArgumentNullException(nameof(blazorMauiWebViewHandler));
@@ -58,7 +58,7 @@ protected override void NavigateCore(Uri absoluteUri)
5858
protected override void SendMessage(string message)
5959
{
6060
var messageJSStringLiteral = JavaScriptEncoder.Default.Encode(message);
61-
_webview.Eval($"__dispatchMessageCallback(\"{messageJSStringLiteral}\")");
61+
_webview.EvaluateJavaScript($"__dispatchMessageCallback(\"{messageJSStringLiteral}\")");
6262
}
6363

6464
internal void MessageReceivedInternal(Uri uri, string message)

src/BlazorWebView/src/Maui/Tizen/WebViewContainer.cs

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

0 commit comments

Comments
 (0)