Xamarin.forms: [Android] XF3.5 ListView with PullToRefresh enabled gestures conflict

Created on 15 Feb 2019  路  13Comments  路  Source: xamarin/Xamarin.Forms

Description

The ListView with PullToRefresh Enabled in Xamarin.Forms 3.5 can't capture the pull-to-refresh gesture in non-data areas.

tim 20190215161503

The SwipeRefreshLayout only capture that gesture in the area with pink TextCells, but the blank area fails.

Steps to Reproduce

  1. Enable pull to refresh
  2. Add some data
  3. Try pull on the areas

Expected Behavior

Refreshing is activated on all areas of ListView

Actual Behavior

Blank area can't activate Refresh

Basic Information

  • Version with issue: 3.5.0.129452
  • Last known good version: 3.4.0.1029999
  • IDE: Visual Studio 2017
  • Platform Target Frameworks:

    • Android: 9.0

  • Android Support Library Version: 28.0.1
  • Nuget Packages: 3.5.0.129452
  • Affected Devices: Xiaomi Mi Note 3 as I tested only

Reproduction Link

listview blocker 3 regression Android bug

All 13 comments

Create an Xamarin.Android (XAML UI) project App1, with

MainPage.xaml

<?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:local="clr-namespace:App1"
             Title="wtf"
             x:Class="App1.MainPage">
    <ListView x:Name="MyListView"
              IsPullToRefreshEnabled="True"
              IsRefreshing="{Binding IsBusy, Mode=OneWay}"
              ItemsSource="{Binding Sources}"
              BackgroundColor="Transparent"
              RefreshCommand="{Binding Command}">
        <ListView.ItemTemplate>
            <DataTemplate>
                <TextCell Text="{Binding Val}" />
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>
</ContentPage>

MainPage.xaml.cs

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Xamarin.Forms;

namespace App1
{
    public class SrcItem
    {
        public string Val { get; set; }
    }

    public partial class MainPage : ContentPage
    {
        public ObservableCollection<SrcItem> Sources { get; }
        public ICommand Command { get; }

        public MainPage()
        {
            InitializeComponent();
            Sources = new ObservableCollection<SrcItem>();
            Command = new Command(AddData);
            Sources.Add(new SrcItem { Val = "gstql!! - " + Sources.Count });
            MyListView.BindingContext = this;
        }

        private void AddData()
        {
            IsBusy = true;
            Sources.Add(new SrcItem { Val = "gstql!! - " + Sources.Count });
            IsBusy = false;
        }
    }
}

In version 3.5.0.169047, this problem remained.

The pull-to-refresh got broken in 3.5.0.129452 and still broken 3.5.0.169047.
I can confirm it has been working in 3.4.0.1029999.

How the situation with a bug is? In progress or in backlog?

I would also be interested in an update on this bug. Thanks!

Interested aswell. Thanks!

Also not fixed in 3.6

And also not fixed in 4.0

Is this fix released? Does it also work when the list view is completely empty?

@ddobrev no, from what I can see it doesn't look to be in any releases yet.

Due to the date of merge, it should be part of XF from 4.0.0.497661

Any news about this? I update to the latest XF version and it still occurs.
If my list view is empty, there is no way to pull to refresh

I had this problem on Android in 4.0.0.497661. Updated to 4.0.0.707238 and the problem was no longer there. Never had a problem with iOS. Can't say anything about any other platforms.

Was this page helpful?
0 / 5 - 0 ratings