Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit e57d160

Browse files
committed
Merge 4.8.0 to 5.0.0
2 parents 780efca + 0bb52af commit e57d160

File tree

10 files changed

+103
-22
lines changed

10 files changed

+103
-22
lines changed

Xamarin.Forms.ControlGallery.WPF/Xamarin.Forms.ControlGallery.WPF.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<OutputType>WinExe</OutputType>
88
<UseWPF>true</UseWPF>
99
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
10-
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
11-
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
10+
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
11+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1212
</PropertyGroup>
1313
<PropertyGroup>
1414
<NoWarn>$(NoWarn);NU1701</NoWarn>

Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32898.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class Bugzilla32898 : TestContentPage
2424
Label _result;
2525
const string Success = "Success";
2626
const string Fail = "Fail";
27-
const int Timeout = 10000;
27+
const int Timeout = 20000;
2828

2929
protected override void Init()
3030
{
@@ -86,7 +86,7 @@ async void StartTrackPage2()
8686
[Test]
8787
public void Issu32898Test()
8888
{
89-
var timeout = Timeout + 5000; // Give this a little slop to set the result text
89+
var timeout = Timeout; // Give this a little slop to set the result text
9090
RunningApp.WaitForElement(Success, timeout: TimeSpan.FromMilliseconds(timeout));
9191
}
9292
#endif

Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue9682.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<ColumnDefinition Width="Auto" />
3737
<ColumnDefinition Width="*" />
3838
</Grid.ColumnDefinitions>
39-
<Image Aspect="AspectFill" AutomationId="MonkeyImages">
39+
<Image Aspect="AspectFit" AutomationId="MonkeyImages">
4040
<Image.Source>
4141
<UriImageSource Uri="{Binding Image}" CachingEnabled="False"></UriImageSource>
4242
</Image.Source>

Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue9682.xaml.cs

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,17 @@ public void MonkiesShouldLoad()
5050
{
5151
var images = RunningApp.WaitForElement("MonkeyImages");
5252

53-
if (images[0].Rect.Height < 50 || images[0].Rect.Width < 50)
53+
if (images[0].Rect.Height < 20 || images[0].Rect.Width < 20)
5454
return null;
5555

5656
return images;
5757
});
5858

59+
monkeyImages = monkeyImages ?? RunningApp.WaitForElement("MonkeyImages");
60+
5961
Assert.IsNotNull(monkeyImages);
60-
Assert.GreaterOrEqual(monkeyImages[0].Rect.Height, 50);
61-
Assert.GreaterOrEqual(monkeyImages[0].Rect.Width, 50);
62+
Assert.GreaterOrEqual(monkeyImages[0].Rect.Height, 20);
63+
Assert.GreaterOrEqual(monkeyImages[0].Rect.Width, 20);
6264
}
6365
#endif
6466
}
@@ -133,8 +135,46 @@ async Task GetMonkeysAsync()
133135
try
134136
{
135137
IsBusy = true;
136-
var json = await Client.GetStringAsync("https://montemagno.com/monkeys.json");
137-
Monkey[] monkeys = Monkey.FromJson(json);
138+
await Task.Delay(500);
139+
Monkey[] monkeys = new[]
140+
{
141+
new Monkey()
142+
{
143+
Details = "Climbs high buildings and enjoys swatting at planes",
144+
Latitude = 42,
145+
Longitude = 42,
146+
Location = "Empire State Building",
147+
Name = "King Kong",
148+
Image = "https://github.com/xamarin/Xamarin.Forms/blob/17881ec93d6b3fb0ee5e1a2be46d7eeadef23529/Xamarin.Forms.ControlGallery.Android/Resources/drawable/Fruits.jpg?raw=true"
149+
},
150+
new Monkey()
151+
{
152+
Details = "Monkeys aren't donkeys, Quit messing with my head!",
153+
Latitude = 42,
154+
Longitude = 42,
155+
Location = "The 90s",
156+
Name = "Donkey Kong",
157+
Image = "https://github.com/xamarin/Xamarin.Forms/blob/17881ec93d6b3fb0ee5e1a2be46d7eeadef23529/Xamarin.Forms.ControlGallery.Android/Resources/drawable/FlowerBuds.jpg?raw=true"
158+
},
159+
new Monkey()
160+
{
161+
Details = "Grape Ape, Grape Ape! Grape Ape, Grape Ape! Grape Ape, Grape Ape! Grape Ape, Grape Ape!",
162+
Latitude = 42,
163+
Longitude = 42,
164+
Location = "Sunday Mornings",
165+
Name = "Grape Ape",
166+
Image = "https://github.com/xamarin/Xamarin.Forms/blob/17881ec93d6b3fb0ee5e1a2be46d7eeadef23529/Xamarin.Forms.ControlGallery.Android/Resources/drawable/games.png?raw=true"
167+
},
168+
new Monkey()
169+
{
170+
Details = "Pretty but easily persuaded into doing others biddings",
171+
Latitude = 42,
172+
Longitude = 42,
173+
Location = "The Sky",
174+
Name = "Flying Monkey",
175+
Image = "https://github.com/xamarin/Xamarin.Forms/blob/17881ec93d6b3fb0ee5e1a2be46d7eeadef23529/Xamarin.Forms.ControlGallery.Android/Resources/drawable/gear.png?raw=true"
176+
},
177+
};
138178

139179
Monkeys.Clear();
140180
foreach (var monkey in monkeys)

Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/PerformanceGallery/PerformanceGallery.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ void NextButton_Clicked(object sender, EventArgs e)
192192
ViewModel.RunTest(_TestCases[_TestNumber++]);
193193
}
194194

195-
#if UITEST
195+
#if false && UITEST
196196

197197
double TopThreshold => 1 + Threshold;
198198
double BottomThreshold => 1 - Threshold;

Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/ShellBackButtonBehavior.cs

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ public class BackButtonPage : ContentPage
4848
{
4949
BackButtonBehavior behavior = new BackButtonBehavior();
5050
Entry _commandParameter;
51-
Label _commandResult = new Label() { AutomationId = CommandResultId };
51+
Label _commandResult = new Label()
52+
{
53+
AutomationId = CommandResultId,
54+
BackgroundColor = Color.LightBlue,
55+
Text = "Label"
56+
};
5257

5358
public BackButtonPage()
5459
{
@@ -224,13 +229,28 @@ public void CommandTest()
224229
RunningApp.EnterText(EntryCommandParameter, "parameter");
225230
ShowFlyout();
226231

227-
var commandResult = RunningApp.WaitForElement(CommandResultId)[0].ReadText();
232+
// API 19 workaround
233+
var commandResult = RunningApp.QueryUntilPresent(() =>
234+
{
235+
ShowFlyout();
236+
if (RunningApp.WaitForElement(CommandResultId)[0].ReadText() == "parameter")
237+
return RunningApp.WaitForElement(CommandResultId);
238+
239+
return null;
240+
})?.FirstOrDefault()?.ReadText();
228241

229242
Assert.AreEqual("parameter", commandResult);
230243
RunningApp.EnterText(EntryCommandParameter, "canexecutetest");
231244
RunningApp.Tap(ToggleCommandCanExecuteId);
232245

233-
commandResult = RunningApp.WaitForElement(CommandResultId)[0].ReadText();
246+
commandResult = RunningApp.QueryUntilPresent(() =>
247+
{
248+
if (RunningApp.WaitForElement(CommandResultId)[0].ReadText() == "parameter")
249+
return RunningApp.WaitForElement(CommandResultId);
250+
251+
return null;
252+
})?.FirstOrDefault()?.ReadText();
253+
234254
Assert.AreEqual("parameter", commandResult);
235255
}
236256

@@ -241,13 +261,22 @@ public void CommandWorksWhenItsTheOnlyThingSet()
241261
RunningApp.Tap(ToggleCommandId);
242262
RunningApp.EnterText(EntryCommandParameter, "parameter");
243263

264+
// API 19 workaround
265+
var commandResult = RunningApp.QueryUntilPresent(() =>
266+
{
267+
244268
#if __ANDROID__
245-
base.TapBackArrow();
269+
TapBackArrow();
246270
#else
247-
RunningApp.Tap("Page 0");
271+
RunningApp.Tap("Page 0");
248272
#endif
249273

250-
var commandResult = RunningApp.WaitForElement(CommandResultId)[0].ReadText();
274+
if (RunningApp.WaitForElement(CommandResultId)[0].ReadText() == "parameter")
275+
return RunningApp.WaitForElement(CommandResultId);
276+
277+
return null;
278+
})?.FirstOrDefault()?.ReadText();
279+
251280
Assert.AreEqual(commandResult, "parameter");
252281
}
253282

Xamarin.Forms.Platform.Android/Extensions/BrushExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,16 +187,16 @@ internal static void SetPaintGradient(this AView view, Brush brush)
187187
Shape = new RectShape()
188188
};
189189

190+
gradientStrokeDrawable.SetStroke(0, Color.Default.ToAndroid());
191+
190192
if (brush is SolidColorBrush solidColorBrush)
191193
{
192194
var color = solidColorBrush.Color.IsDefault ? Color.Default.ToAndroid() : solidColorBrush.Color.ToAndroid();
193195
gradientStrokeDrawable.SetColor(color);
194196
}
195197
else
196-
{
197-
gradientStrokeDrawable.SetStroke(0, Color.Default.ToAndroid());
198198
gradientStrokeDrawable.SetGradient(brush);
199-
}
199+
200200
view.Background?.Dispose();
201201
view.Background = gradientStrokeDrawable;
202202
}

Xamarin.Forms.Platform.WPF/Properties/AssemblyInfo.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,14 @@
7373
[assembly: Xamarin.Forms.Dependency(typeof(ResourcesProvider))]
7474
[assembly: Xamarin.Forms.Dependency(typeof(Deserializer))]
7575

76-
[assembly: AssemblyVersion("2.0.0.0")]
76+
[assembly: AssemblyVersion("2.0.0.0")]
77+
[assembly: AssemblyFileVersion(ThisAssembly.Git.BaseVersion.Major + "."
78+
+ ThisAssembly.Git.BaseVersion.Minor + "."
79+
+ ThisAssembly.Git.BaseVersion.Patch + "."
80+
+ ThisAssembly.Git.Commits)]
81+
[assembly: AssemblyInformationalVersion(ThisAssembly.Git.SemVer.Major + "."
82+
+ ThisAssembly.Git.SemVer.Minor + "."
83+
+ ThisAssembly.Git.SemVer.Patch
84+
+ ThisAssembly.Git.SemVer.DashLabel + "+"
85+
+ ThisAssembly.Git.Commits + "-sha."
86+
+ ThisAssembly.Git.Commit)]

azure-pipelines.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ resources:
2020
type: github
2121
name: xamarin/yaml-templates
2222
endpoint: xamarin
23+
ref: refs/heads/main # still defaults to master even though main is the main branch
2324

2425
trigger:
2526
branches:

build/steps/build-sign.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ parameters:
1212
steps:
1313
- checkout: none
1414
clean: true
15-
15+
1616
- template: sign-artifacts/steps/v1.yml@xamarin-templates
1717
parameters:
1818
targetFolder: $(Build.ArtifactStagingDirectory)/nuget/signed
@@ -21,6 +21,7 @@ steps:
2121
jenkinsJob: sign-from-vsts
2222
artifactHost: 'https://dl.internalx.com/vsts-devdiv'
2323
githubToken: "$(github--pat--xamarinreleasemanager)"
24+
CodeSignOverride: true
2425

2526
- task: PublishBuildArtifacts@1
2627
displayName: 'Publish Artifact: nuget signed'

0 commit comments

Comments
 (0)