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

Commit

Permalink
[Android] Fixed brush background issue scrolling ListView (#13402)
Browse files Browse the repository at this point in the history
* Fixed brush background issue scrolling ListView on Android

* Update Issue13392.xaml.cs

---------

Co-authored-by: Rachel Kang <rachelkang@microsoft.com>
Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com>
  • Loading branch information
3 people committed Nov 9, 2023
1 parent 6293975 commit 88b70ad
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 0 deletions.
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8" ?>
<local:TestContentPage
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"
Title="Test 13392" xmlns:local="using:Xamarin.Forms.Controls"
x:Class="Xamarin.Forms.Controls.Issues.Issue13392">
<StackLayout>
<Label
Padding="12"
BackgroundColor="Black"
TextColor="White"
Text="Scroll the ListView to the end, if all the cells have a gradient background test has passed."/>
<ListView
RowHeight="200">
<ListView.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Item 1</x:String>
<x:String>Item 2</x:String>
<x:String>Item 3</x:String>
<x:String>Item 4</x:String>
<x:String>Item 5</x:String>
<x:String>Item 6</x:String>
<x:String>Item 7</x:String>
<x:String>Item 8</x:String>
<x:String>Item 9</x:String>
<x:String>Item 10</x:String>
</x:Array>
</ListView.ItemsSource>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell Height="300">
<Frame Margin="10,7,7,0" CornerRadius="5" HasShadow="True">
<Frame.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="#0039AC" Offset="0.1"/>
<GradientStop Color="#004CDD" Offset="0.5"/>
<GradientStop Color="#3476FC" Offset="1.0"/>
</LinearGradientBrush>
</Frame.Background>
<Grid>
<Label
Text="{Binding}"
TextColor="White"
FontSize="Medium"
VerticalOptions="Center"
HorizontalOptions="Center" />
</Grid>
</Frame>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</local:TestContentPage>
@@ -0,0 +1,25 @@
using Xamarin.Forms.CustomAttributes;

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

namespace Xamarin.Forms.Controls.Issues
{
[Issue(IssueTracker.Github, 13392, "[Bug] Brush dissappear after scroll in ListView on Android", PlatformAffected.Android)]
public partial class Issue13392 : TestContentPage
{
public Issue13392()
{
#if APP
InitializeComponent();
#endif
}

protected override void Init()
{
}
}
}
Expand Up @@ -1806,6 +1806,7 @@
<Compile Include="$(MSBuildThisFileDirectory)ShellFlyoutBackground.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ShellFlyoutContentOffest.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ShellFlyoutContentWithZeroMargin.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue13392.xaml.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue13100.xaml.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue13337.xaml.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue13232.xaml.cs" />
Expand Down Expand Up @@ -2293,6 +2294,9 @@
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Issue13136.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Issue13392.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Issue13173.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
Expand Down
Expand Up @@ -191,6 +191,7 @@ protected virtual void OnElementChanged(ElementChangedEventArgs<Frame> e)
e.NewElement.PropertyChanged += OnElementPropertyChanged;
UpdateShadow();
UpdateBackgroundColor();
UpdateBackground();
UpdateCornerRadius();
UpdateBorderColor();
UpdateClippedToBounds();
Expand Down

0 comments on commit 88b70ad

Please sign in to comment.