unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
8.94k stars 724 forks source link

[Android] `CalendarDatePicker` within `MenuFlyoutItem` doesn't work #8416

Open pkar70 opened 2 years ago

pkar70 commented 2 years ago

Current behavior

CalendarDatePicker is not displayed.

Expected behavior

CalendarDatePicker should appear.

How to reproduce it (as minimally and precisely as possible)

Within XAML:

    <not_win:Grid Grid.Row="2" Name="uiAndroBottom" Margin="0,10,0,0">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="120" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <TextBlock Text=" " Name="tbDzien" Margin="10,0,0,0" VerticalAlignment="Center" />
        <StackPanel Orientation="Horizontal" Grid.Column="1">

            <AppBarSeparator Name="uiBarSeparat1"/>
            <AppBarButton x:Uid="resDay" Label="Kalendarz" Icon="Calendar" Name="uiKalend">
                <AppBarButton.Flyout>
                    <Flyout >
                        <CalendarDatePicker Name="uiDay" DateChanged="uiDay_Changed"/>
                    </Flyout>
                </AppBarButton.Flyout>
            </AppBarButton>
            <AppBarSeparator Name="uiBarSeparat2"/>
            <AppBarButton Label="..." x:Name="uiAndroSec">
                <AppBarButton.Flyout>
                    <MenuFlyout>
                        <MenuFlyoutItem x:Uid="resDayM" Text="Kalendarz" Name="uiKalendSec">
                            <Flyout >
                                <CalendarDatePicker Name="uiDaySec" DateChanged="uiDay_Changed"/>
                            </Flyout>
                        </MenuFlyoutItem>
                    </MenuFlyout>
                </AppBarButton.Flyout>
                </AppBarButton>
        </StackPanel>
    </not_win:Grid>

uiDay is correctly presented, but when I click on uiDaySec, nothing happens.

Workaround

None known.

Works on UWP/WinUI

Yes

Environment

Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia

NuGet package version(s)

Uno.UI 4.1.9

Affected platforms

Android

IDE

Visual Studio 2022

IDE version

17.0.5

Relevant plugins

No response

Anything else we need to know?

No response

jeromelaban commented 2 years ago

Thanks. Can you provide the device logs or any exception that may be raised when opening the popup?

pkar70 commented 2 years ago

Nope. Because my tablet is physically broken, and emulator from Visual Studio doesn't work. I run this app within BlueStacks emulator, and I don't know how to connect VStudio debugger to app within it. But current version of app is here: https://github.com/pkar70/Anniversaries

GitHub
GitHub - pkar70/Anniversaries
Contribute to pkar70/Anniversaries development by creating an account on GitHub.
jeromelaban commented 2 years ago

Thanks. Logs are important to troubleshoot the issue, otherwise, try making a small repro sample to show the issue and attach it here.

pkar70 commented 2 years ago

Repro is given - no code is required, only XAML. Remove DateChanged attribute, and compile with empty xaml.cs file,

francoistanguay commented 2 years ago

FYI, CalendarDatePicker is not currently supported on mobile, you need to use the DatePicker that maps to the native picker on mobile by default. We're planning to support it properly in the future but hasnt been prioritized.

pkar70 commented 2 years ago

But DatePicker looks differently than CalendarDatePicker... Some time ago, there was no CalendarDatePicker in Uno; I created PR with this, but this PR was never merged.

jeromelaban commented 2 years ago

But DatePicker looks differently than CalendarDatePicker... Some time ago, there was no CalendarDatePicker in Uno; I created PR with this, but this PR was never merged.

Indeed the PR was not merged because it was implementing the native view for CalendarDatePicker, something we did not want to implement because of the porting of the original source.