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

Commit

Permalink
Merge branch '5.0.0' into fix-11795
Browse files Browse the repository at this point in the history
  • Loading branch information
jsuarezruiz committed Jan 21, 2021
2 parents 5d84978 + b0ec436 commit 40d6bfd
Show file tree
Hide file tree
Showing 62 changed files with 2,197 additions and 445 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/backport-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Backport Trigger

on:
issue_comment:
types: [created]

jobs:
launchBackportBuild:
runs-on: ubuntu-latest
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '@vs-mobiletools-engineering-service2 backport')

steps:
- uses: xamarin/backport-bot-action@v1.0
with:
pull_request_url: ${{ github.event.issue.pull_request.url }}
comment_body: ${{ github.event.comment.body }}
comment_author: ${{ github.actor }}
github_repository: ${{ github.repository }}
ado_organization: ${{ secrets.ADO_PROJECTCOLLECTION }}
ado_project: ${{ secrets.ADO_PROJECT }}
backport_pipeline_id: ${{ secrets.BACKPORT_PIPELINEID }}
ado_build_pat: ${{ secrets.ADO_BUILDPAT }}
github_account_pat: ${{ secrets.SERVICEACCOUNT_PAT }}
22 changes: 22 additions & 0 deletions .github/workflows/rebase-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Rebase Trigger

on:
issue_comment:
types: [created]

jobs:
launchBackportBuild:
runs-on: ubuntu-latest
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '@vs-mobiletools-engineering-service2 rebase')

steps:
- uses: xamarin/rebase-bot-action@v1.0
with:
pull_request_url: ${{ github.event.issue.pull_request.url }}
comment_author: ${{ github.actor }}
github_repository: ${{ github.repository }}
ado_organization: ${{ secrets.ADO_PROJECTCOLLECTION }}
ado_project: ${{ secrets.ADO_PROJECT }}
rebase_pipeline_id: 13926
ado_build_pat: ${{ secrets.ADO_BUILDPAT }}
github_account_pat: ${{ secrets.SERVICEACCOUNT_PAT }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
using System.Collections.Generic;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Shapes;

#if UITEST
using Xamarin.Forms.Core.UITests;
using Xamarin.UITest;
using NUnit.Framework;
#endif

namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.Shape)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 11924, "[Bug] Shapes not loading in Xamarin ShellContent Tab once it is navigated back from other Tab",
PlatformAffected.All)]
public class Issue11924 : TestShell
{
const string Test1 = "Test 1";
const string Test2 = "Test 2";

public Issue11924()
{

}

protected override void Init()
{
AddBottomTab(CreatePage1(Test1), Test1);
AddBottomTab(CreatePage2(Test2), Test2);

static ContentPage CreatePage1(string title)
{
var layout = new StackLayout();

var instructions = new Label
{
Padding = 12,
BackgroundColor = Color.Black,
TextColor = Color.White,
Text = "Navigate to the second Tab"
};

var ellipse = new Ellipse
{
HorizontalOptions = LayoutOptions.Start,
HeightRequest = 50,
WidthRequest = 100,
Fill = Brush.Red
};

layout.Children.Add(instructions);
layout.Children.Add(ellipse);

return new ContentPage
{
Title = title,
Content = layout
};
}

static ContentPage CreatePage2(string title)
{
var layout = new StackLayout();

var instructions = new Label
{
Padding = 12,
BackgroundColor = Color.Black,
TextColor = Color.White,
Text = "Navigate back to the first tab, and verify if the Ellipse is rendering or not."
};

layout.Children.Add(instructions);

return new ContentPage
{
Title = title,
Content = layout
};
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8" ?>
<controls:TestContentPage
xmlns:controls="clr-namespace:Xamarin.Forms.Controls"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Class="Xamarin.Forms.Controls.Issues.Issue12521"
Title="Issue 12521">
<StackLayout>
<Label
Padding="12"
BackgroundColor="Black"
TextColor="White"
Text="Scroll the list up and down. If the shapes not disappear, the test has passed."/>
<ListView
SelectionMode="None"
SeparatorColor="Transparent"
BackgroundColor="Transparent"
HasUnevenRows="True">
<ListView.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>1</x:String>
<x:String>2</x:String>
<x:String>3</x:String>
<x:String>4</x:String>
<x:String>5</x:String>
<x:String>6</x:String>
<x:String>7</x:String>
<x:String>8</x:String>
<x:String>9</x:String>
<x:String>10</x:String>
<x:String>11</x:String>
<x:String>12</x:String>
<x:String>13</x:String>
<x:String>14</x:String>
<x:String>15</x:String>
<x:String>16</x:String>
<x:String>17</x:String>
<x:String>18</x:String>
<x:String>19</x:String>
<x:String>20</x:String>
</x:Array>
</ListView.ItemsSource>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<!-- Bug -->
<Frame>
<Path
Aspect="Uniform"
Data="M79.832501,980.76073L94.683501,965.90873 102.8065,974.03373 106.00049,946.36273 78.328501,949.55573 86.453501,957.67873 71.600501,972.53073C54.154501,959.13273 28.988501,960.40073 13.021501,976.36773 -4.34050019999999,993.73073 -4.34050019999999,1021.9787 13.021501,1039.3407 30.382501,1056.7027 58.632501,1056.7027 75.994501,1039.3407 91.959501,1023.3737 93.230501,998.20573 79.832501,980.76073z M21.251501,1031.1087C8.42850079999999,1018.2867 8.42750079999999,997.42273 21.251501,984.59773 34.073501,971.77573 54.938501,971.77573 67.762501,984.59773 80.585501,997.42273 80.585501,1018.2867 67.762501,1031.1087 54.938501,1043.9317 34.074501,1043.9317 21.251501,1031.1087z"
Fill="Black"
HeightRequest="24"
HorizontalOptions="Start"
VerticalOptions="Start"
WidthRequest="24" />
</Frame>
<!-- Non bug -->
<!--
<Grid>
<Path
Aspect="Uniform"
Data="M79.832501,980.76073L94.683501,965.90873 102.8065,974.03373 106.00049,946.36273 78.328501,949.55573 86.453501,957.67873 71.600501,972.53073C54.154501,959.13273 28.988501,960.40073 13.021501,976.36773 -4.34050019999999,993.73073 -4.34050019999999,1021.9787 13.021501,1039.3407 30.382501,1056.7027 58.632501,1056.7027 75.994501,1039.3407 91.959501,1023.3737 93.230501,998.20573 79.832501,980.76073z M21.251501,1031.1087C8.42850079999999,1018.2867 8.42750079999999,997.42273 21.251501,984.59773 34.073501,971.77573 54.938501,971.77573 67.762501,984.59773 80.585501,997.42273 80.585501,1018.2867 67.762501,1031.1087 54.938501,1043.9317 34.074501,1043.9317 21.251501,1031.1087z"
Fill="Black"
HeightRequest="24"
HorizontalOptions="Start"
VerticalOptions="Start"
WidthRequest="24" />
</Grid>
-->
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</controls:TestContentPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Xaml;

#if UITEST
using Xamarin.UITest;
using Xamarin.UITest.Queries;
using NUnit.Framework;
using Xamarin.Forms.Core.UITests;
#endif

namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.Shape)]
#endif
#if APP
[XamlCompilation(XamlCompilationOptions.Compile)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 12521, "[Bug][iOS] Shapes disappear in a Frame in a ListView when scrolled",
PlatformAffected.iOS)]
public partial class Issue12521 : TestContentPage
{
public Issue12521()
{
#if APP
InitializeComponent();
#endif
}

protected override void Init()
{

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>

<controls:TestContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:controls="clr-namespace:Xamarin.Forms.Controls"
x:Class="Xamarin.Forms.Controls.Issues.Issue12848"
Title="Issue 12848">
<StackLayout>
<Label
Padding="12"
BackgroundColor="Black"
TextColor="White"
Text="Swipe the CarouselView to select the item numbered 2. Then, tap the Hide Button to hide the Carousel and the Show Button to show the Carousel again. If the position of the Carousel is the same as before hiding, the test has passed."/>
<CarouselView
AutomationId="TestCarouselView"
x:Name="carousel"
HorizontalOptions="Center"
ItemsSource="{Binding}">
<CarouselView.ItemTemplate>
<DataTemplate>
<Label
Text="{Binding}"
FontSize="96"
HorizontalTextAlignment="Center"/>
</DataTemplate>
</CarouselView.ItemTemplate>
</CarouselView>
<Label
AutomationId="CarouselPosition"
Text="{Binding Source={x:Reference carousel}, Path=Position}"
HorizontalOptions="Center"/>
<Button
AutomationId="HideButton"
Text="Hide CarouselView"
Clicked="OnHideButtonClicked"/>
<Button
AutomationId="ShowButton"
Text="Show CarouselView"
Clicked="OnShowButtonClicked"/>
</StackLayout>
</controls:TestContentPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

#if UITEST
using Xamarin.Forms.Core.UITests;
using NUnit.Framework;
#endif

namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 12848, "[Bug] CarouselView position resets when visibility toggled",
PlatformAffected.Android)]
public partial class Issue12848 : TestContentPage
{
protected override void Init()
{
#if APP
InitializeComponent();

BindingContext = new List<int> { 1, 2, 3 };
#endif
}

#if APP
void OnShowButtonClicked(object sender, EventArgs e)
{
carousel.IsVisible = true;
}

void OnHideButtonClicked(object sender, EventArgs e)
{
carousel.IsVisible = false;
}
#endif

#if UITEST
[Test]
public void Issue12848Test()
{
RunningApp.WaitForElement("TestCarouselView");
RunningApp.SwipeRightToLeft();
Assert.AreEqual(1, int.Parse(RunningApp.Query(q => q.Marked("CarouselPosition"))[0].Text));
RunningApp.Tap("HideButton");
RunningApp.Tap("ShowButton");
Assert.AreEqual(1, int.Parse(RunningApp.Query(q => q.Marked("CarouselPosition"))[0].Text));
RunningApp.Screenshot("Test passed");
}
#endif
}
}
Loading

0 comments on commit 40d6bfd

Please sign in to comment.