dotnet-podcasts icon indicating copy to clipboard operation
dotnet-podcasts copied to clipboard

Feature/use flex layout listen later and listen together

Open migueBarrera opened this issue 2 years ago • 12 comments

Hello James. I am trying to use Flex layout. I have two issues. 1: The scroll is not working, am I doing something wrong? 2: Is it possible to group with FlexLayout? I tried one option but it doesn't calculate the height correctly (it's commented in the code).

migueBarrera avatar Apr 25 '22 12:04 migueBarrera

Hmmm... that looks correct. I will try to pull it down and look. @pureween @redth are you able to look at this? Who owns flexlayout? @davidortinau you are a pro at flexlayout...

@migueBarrera do you have some screenshots?

jamesmontemagno avatar Apr 25 '22 15:04 jamesmontemagno

Apparently, the flexlayout wraps fine, but...

Issues 1: If I use a flexlayout inside a scrollview, the scroll does not work. image image

Issues 2: For grouping, I am not sure if it is possible or if it is an error in calculating the height. image

migueBarrera avatar Apr 25 '22 16:04 migueBarrera

I am thinking it would be 2 different flexlayouts..

<ScrollView>
  <StackLayout>
    <Label Text=""/>
    <FlexLayout>
    </FlexLayout>
    <Label Text=""/>
    <FlexLayout>
    </FlexLayout>
  </StackLayout>
</ScrollView>

jamesmontemagno avatar Apr 27 '22 20:04 jamesmontemagno

Hi james. I have tried your proposal but not work fine. I use a VerticalStackLayout but this is the result: On Android: Screenshot 2022-04-29 at 10 49 39

OnMacos: Screenshot 2022-04-29 at 10 59 05

migueBarrera avatar Apr 29 '22 08:04 migueBarrera

CLA assistant check
All CLA requirements met.

ghost avatar Apr 29 '22 09:04 ghost

I'll pull down the branch and look today :)

jamesmontemagno avatar Apr 29 '22 16:04 jamesmontemagno

Ohhh thank you so much! I've updated the branch with the latest changes right now!

migueBarrera avatar Apr 29 '22 17:04 migueBarrera

@migueBarrera we should maybe try the community toolkit -> https://docs.microsoft.com/en-us/dotnet/communitytoolkit/maui/

They have a UniformedItemLayout https://github.com/CommunityToolkit/Maui/blob/main/samples/CommunityToolkit.Maui.Sample/Pages/Layouts/UniformItemsLayoutPage.xaml

jamesmontemagno avatar Apr 29 '22 18:04 jamesmontemagno

@jamesmontemagno I have tried the toolkit's control UniformItemsLayout. A simple implementation, like this:

        <ScrollView>
            <toolkit:UniformItemsLayout
                MaxColumns="2"
                Margin="10,50,10,0"
                BindableLayout.ItemsSource="{Binding WhatsNewList}">
                <BindableLayout.ItemTemplate>
                    <DataTemplate>
                        <BoxView Color="Red" HeightRequest="150" WidthRequest="150" Margin="4"/>
                    </DataTemplate>
                </BindableLayout.ItemTemplate>
            </toolkit:UniformItemsLayout >
        </ScrollView>

I have the same problem as with FlexLayout => Scroll does not work.

migueBarrera avatar May 03 '22 12:05 migueBarrera

Hmmm @brminnick thoughts?

jamesmontemagno avatar May 04 '22 21:05 jamesmontemagno

https://github.com/dotnet/maui/issues/6881

migueBarrera avatar May 06 '22 12:05 migueBarrera

@migueBarrera is this still an issue? does it need to be re-based?

jamesmontemagno avatar Jun 15 '22 22:06 jamesmontemagno