--- /dev/null
+<?xml version="1.0" encoding="utf-8" ?>
+<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+ xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
+ x:Class="Xamarin.Forms.Controls.Issues.Issue6130">
+ <ContentPage.Content>
+ <WebView Source="http://www.xamarin.com" android:WebView.EnableZoomControls="True" android:WebView.DisplayZoomControls="True" />
+ </ContentPage.Content>
+</ContentPage>
\ No newline at end of file
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using Xamarin.Forms;
+using Xamarin.Forms.CustomAttributes;
+using Xamarin.Forms.Internals;
+using Xamarin.Forms.Xaml;
+
+namespace Xamarin.Forms.Controls.Issues
+{
+ [Preserve(AllMembers = true)]
+ [Issue(IssueTracker.Github, 6130, "[Bug] [Forms 4.0] [Android] Mismatch in WebView.EnableZoomControls platform-specific", PlatformAffected.Android)]
+ public partial class Issue6130 : ContentPage
+ {
+ public Issue6130()
+ {
+#if APP
+ InitializeComponent();
+#endif
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+using Xamarin.Forms.CustomAttributes;
+using Xamarin.Forms.Internals;
+using Xamarin.Forms.PlatformConfiguration;
+using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
+
+namespace Xamarin.Forms.Controls.Issues
+{
+ [Preserve(AllMembers = true)]
+ [Issue(IssueTracker.Github, 6132, "[Bug] [Forms 4.0] [Android] WebView.EnableZoomControls platform-specific doesn't work ", PlatformAffected.Android)]
+ public class Issue6132 : TestContentPage
+ {
+ protected override void Init()
+ {
+ Title = "WebView Zoom Controls";
+ WebView webView = new WebView
+ {
+ Source = "https://www.xamarin.com"
+ };
+
+ webView.On<Android>().EnableZoomControls(true);
+ webView.On<Android>().DisplayZoomControls(true);
+
+ Content = webView;
+ }
+ }
+}
\ No newline at end of file
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Issue5535.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue5793.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Issue6130.xaml.cs">
+ <SubType>Code</SubType>
+ </Compile>
<Compile Include="$(MSBuildThisFileDirectory)LegacyComponents\NonAppCompatSwitch.cs" />
<Compile Include="$(MSBuildThisFileDirectory)MapsModalCrash.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ModalActivityIndicatorTest.cs" />
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Issue5470.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue5724.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Issue6132.cs" />
<Compile Include="$(MSBuildThisFileDirectory)_Template.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla56298.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla42620.cs" />
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
</ItemGroup>
-</Project>
\ No newline at end of file
+ <ItemGroup>
+ <EmbeddedResource Include="$(MSBuildThisFileDirectory)Issue6130.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Update="$(MSBuildThisFileDirectory)Issue6130.xaml.cs">
+ <DependentUpon>Issue6130.xaml</DependentUpon>
+ </Compile>
+ </ItemGroup>
+</Project>
var enableZoomControlsWebView = new WebView();
enableZoomControlsWebView.On<Android>().SetEnableZoomControls(true);
- Assert.AreEqual(defaultWebView.On<Android>().EnableZoomControls(), false);
- Assert.AreEqual(enableZoomControlsWebView.On<Android>().EnableZoomControls(), true);
+ Assert.AreEqual(defaultWebView.On<Android>().ZoomControlsEnabled(), false);
+ Assert.AreEqual(enableZoomControlsWebView.On<Android>().ZoomControlsEnabled(), true);
}
[Test]
var displayZoomControlsWebView = new WebView();
displayZoomControlsWebView.On<Android>().SetDisplayZoomControls(false);
- Assert.AreEqual(defaultWebView.On<Android>().DisplayZoomControls(), true);
- Assert.AreEqual(displayZoomControlsWebView.On<Android>().DisplayZoomControls(), false);
+ Assert.AreEqual(defaultWebView.On<Android>().ZoomControlsDisplayed(), true);
+ Assert.AreEqual(displayZoomControlsWebView.On<Android>().ZoomControlsDisplayed(), false);
}
[Test]
return config;
}
- public static readonly BindableProperty EnableZoomControlProperty = BindableProperty.Create("EnableZoomControls", typeof(bool), typeof(FormsElement), false);
+ public static readonly BindableProperty EnableZoomControlsProperty = BindableProperty.Create("EnableZoomControls", typeof(bool), typeof(FormsElement), false);
public static bool GetEnableZoomControls(FormsElement element)
{
- return (bool)element.GetValue(EnableZoomControlProperty);
+ return (bool)element.GetValue(EnableZoomControlsProperty);
}
public static void SetEnableZoomControls(FormsElement element, bool value)
{
- element.SetValue(EnableZoomControlProperty, value);
+ element.SetValue(EnableZoomControlsProperty, value);
}
- public static bool EnableZoomControls(this IPlatformElementConfiguration<Android, FormsElement> config)
+ public static void EnableZoomControls(this IPlatformElementConfiguration<Android, FormsElement> config, bool value)
+ {
+ SetEnableZoomControls(config.Element, value);
+ }
+ public static bool ZoomControlsEnabled(this IPlatformElementConfiguration<Android, FormsElement> config)
{
return GetEnableZoomControls(config.Element);
}
element.SetValue(DisplayZoomControlsProperty, value);
}
- public static bool DisplayZoomControls(this IPlatformElementConfiguration<Android, FormsElement> config)
+ public static void DisplayZoomControls(this IPlatformElementConfiguration<Android, FormsElement> config, bool value)
+ {
+ SetDisplayZoomControls(config.Element, value);
+ }
+
+ public static bool ZoomControlsDisplayed(this IPlatformElementConfiguration<Android, FormsElement> config)
{
return GetDisplayZoomControls(config.Element);
}
void UpdateEnableZoomControls()
{
- var value = Element.OnThisPlatform().EnableZoomControls();
+ var value = Element.OnThisPlatform().ZoomControlsEnabled();
Control.Settings.SetSupportZoom(value);
Control.Settings.BuiltInZoomControls = value;
}
void UpdateDisplayZoomControls()
{
- Control.Settings.DisplayZoomControls = Element.OnThisPlatform().DisplayZoomControls();
+ Control.Settings.DisplayZoomControls = Element.OnThisPlatform().ZoomControlsDisplayed();
}
class JavascriptResult : Java.Lang.Object, IValueCallback