summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Knight <adrianknight89@outlook.com>2016-11-26 12:16:10 -0600
committerRui Marinho <me@ruimarinho.net>2017-02-22 11:30:19 +0000
commit41763299671bb7e9e8068c17cd2ecebdd3622f7c (patch)
tree50c873ae6337705d3d31565e936057c2a1d2dd35
parentec32701f4b631876f5d8920b7daafe785610351b (diff)
downloadxamarin-forms-41763299671bb7e9e8068c17cd2ecebdd3622f7c.tar.gz
xamarin-forms-41763299671bb7e9e8068c17cd2ecebdd3622f7c.tar.bz2
xamarin-forms-41763299671bb7e9e8068c17cd2ecebdd3622f7c.zip
added sample code
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla47923.cs102
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems1
2 files changed, 103 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla47923.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla47923.cs
new file mode 100644
index 00000000..3928740d
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla47923.cs
@@ -0,0 +1,102 @@
+using Xamarin.Forms.CustomAttributes;
+using Xamarin.Forms.Internals;
+
+#if UITEST
+using Xamarin.UITest;
+using NUnit.Framework;
+#endif
+
+// Apply the default category of "Issues" to all of the tests in this assembly
+// We use this as a catch-all for tests which haven't been individually categorized
+#if UITEST
+[assembly: NUnit.Framework.Category("Issues")]
+#endif
+
+namespace Xamarin.Forms.Controls.Issues
+{
+ [Preserve(AllMembers = true)]
+ [Issue(IssueTracker.Bugzilla, 47923, "Vectors don\'t work in Images, and work badly in Buttons", PlatformAffected.Android)]
+ public class Bugzilla47923 : TestNavigationPage // or TestMasterDetailPage, etc ...
+ {
+ protected override void Init()
+ {
+ PushAsync(new LandingPage());
+ }
+ }
+
+ public class VectorImagePage : ContentPage
+ {
+ public VectorImagePage(Aspect aspect)
+ {
+ var scrollView = new ScrollView();
+ var stackLayout = new StackLayout
+ {
+ Orientation = StackOrientation.Vertical,
+ Spacing = 10
+ };
+
+ var vectors = new[] { "cartman", "heart", "error" };
+
+ for (var i = 0; i < vectors.Length; i++)
+ {
+ for (var j = 0; j < 3; j++)
+ {
+ var image = new Image
+ {
+ Source = vectors[i],
+ WidthRequest = j == 1 ? 150 : 300,
+ HeightRequest = j == 2 ? 150 : 300,
+ BackgroundColor = i == 0 ? Color.Red : (i == 1 ? Color.Green : Color.Yellow),
+ HorizontalOptions = LayoutOptions.Center,
+ Aspect = aspect
+ };
+ stackLayout.Children.Add(image);
+ }
+ }
+
+ scrollView.Content = stackLayout;
+ Content = scrollView;
+ }
+ }
+
+ public class LandingPage : ContentPage
+ {
+ public LandingPage()
+ {
+ var scrollView = new ScrollView();
+ var stackLayout = new StackLayout
+ {
+ Orientation = StackOrientation.Vertical,
+ HorizontalOptions = LayoutOptions.Center,
+ Spacing = 10
+ };
+
+ var button1 = new Button
+ {
+ Text = "AspectFit",
+ Command = new Command(() => { Navigation.PushAsync(new VectorImagePage(Aspect.AspectFit)); }),
+ HorizontalOptions = LayoutOptions.Center
+ };
+ stackLayout.Children.Add(button1);
+
+ var button2 = new Button
+ {
+ Text = "AspectFill",
+ Command = new Command(() => { Navigation.PushAsync(new VectorImagePage(Aspect.AspectFill)); }),
+ HorizontalOptions = LayoutOptions.Center
+ };
+ stackLayout.Children.Add(button2);
+
+ var button3 = new Button
+ {
+ Text = "Fill",
+ Command = new Command(() => { Navigation.PushAsync(new VectorImagePage(Aspect.Fill)); }),
+ HorizontalOptions = LayoutOptions.Center
+ };
+ stackLayout.Children.Add(button3);
+
+ scrollView.Content = stackLayout;
+ Content = scrollView;
+ }
+ }
+} \ No newline at end of file
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
index 40da9e96..1bb0a0c7 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
@@ -168,6 +168,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla46494.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla44476.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla46630.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla47923.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla48236.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla47971.cs" />
<Compile Include="$(MSBuildThisFileDirectory)CarouselAsync.cs" />