Adding an MR control in the Header of a ListView does not establish AndroidGestureHandler
I tried adding an MR gesture view n the header of a ListView on Android, none of the Gesture commands work.
public ListViewXaml()
{
InitializeComponent();
ListView = new ListView();
ListView.Header = new MR.Gestures.Button(){Text = "Hi", TappedCommand = new Command(() => Console.WriteLine("HIIIIIIII")) };
}
It seems that in this case AndroidGestureHandler.AddInstance is not called as the commands of the Button are not added to the header of a ListView
Found the problem here. MAUI does not call ConnectHandler in this case.
Now I also instantiate the AndroidGestureHandler in DispatchTouchEvent if it's not there yet.
Fixed in Android, I'll check the other platforms too...
Thanks! Should we create an issue on MAUI repo on the ConnectHandler not being initialized? Seems a bit scary that the header will not run the expected Handler.
I debugged some more. ConnectHandler is called, but the Loaded event is never raised. I filed an issue for MAUI.
However, the gestures still don't work in the header. I do not know why yet, but I found a similar issue in MAUI