How to enable Grommet sidebar menu within split on mobile - grommet

Hi I'm new to Grommet and development in general. I'm having some trouble with displaying a mobile menu.
When a screen hits a certain size the split view shows only the right side of the screen, giving you no access to the menu.
<App centered={false}>
<Split separator={true} flex='right' fixed={true} colorIndex='brand'>
<Sidebar colorIndex='brand' responsive={true}>
<Header pad='small' justify='between'>
<Title> brand </Title>
</Header>
<Box flex='grow' justify='start'>
<Menu primary={true}>
<Anchor key="home" path="/app" label="Home" />
</Menu>
</Box>
</Sidebar>
<Box>
{this.props.children}
</Box>
</Split>
</App>
From what I can tell you just need a title in a header on the right side that is set to responsive={true}. This will display your heading if your device is a mobile.
<div>
<Header pad='small' justify='between' responsive={true}>
<Title> brand </Title>
</Header>
<Cards />
</div>
This doesn't seem to work. The header displays the whole time. What I ideally want is to display the header from the sidebar.
Can anyone please help me achieve this?

Related

Setting size of editor for chat UI in .NET MAUI app

In my .NET MAUI app, I'm implementing chat feature and want to make sure that the Editor and Button are perfectly located at the bottom of the screen.
I created a Grid for the controls to produce this layout
The problem I'm having is with the Editor width because if I get it to look right on Android, it's not perfect on iOS and vice versa.
Here's how I approached it:
<Grid
RowDefinitions="50"
ColumnDefinitions="*,50"
RowSpacing="0"
ColumnSpacing="5"
HorizontalOptions="StartAndExpand"
Margin="5,5,5,5">
<Editor
Grid.Column="0" />
<Button
Grid.Column="1" />
</Grid>
Other than entering some arbitrary number for WidthRequest for the Editor, how do I set the width for it so that it always takes up all the available space and look like it in the picture?
After setting HorizontalOptions="FillAndExpand" as Jason suggested like below, it looks right on Android and iOS.
<Grid
RowDefinitions="50"
ColumnDefinitions="*,50"
RowSpacing="0"
ColumnSpacing="5"
HorizontalOptions="FillAndExpand"
Margin="5">
<Editor
Grid.Column="0" />
<Button
Grid.Column="1" />
</Grid>

How can I add an extra label/slide button to a FlyoutItem in MAUI?

I encountered an UI issue when developing an app using MAUI flyoutItem. According to the official doc, it looks like I can only define the flyoutItem appearance by setting two columns(https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/shell/flyout?view=net-maui-7.0): one bind to FlyoutIcon and the other bind to Title.
What if I want to add a third item such as a label for identity/status or a slide button to enable/disable? I expect sth look like this:
[column 0]FlyoutIcon [column 1]Label1 [column 2]Label2/Slide Button
Can you please also show me some sample code for the solution?
Best and Regards
I tried to modify the Grid to add a third column and addition Label but seems not working.
<Shell ...>
...
<Shell.ItemTemplate>
<DataTemplate>
<Grid ColumnDefinitions="0.2*,0.4*,0.4*">
<Image Source="{Binding FlyoutIcon}"
Margin="5"
HeightRequest="45" />
<Label Grid.Column="1"
Text="{Binding Title}"
FontAttributes="Italic"
VerticalTextAlignment="Center" />
<Label Grid.Column="2"
Text="{Binding Text}"
FontAttributes="Italic"
VerticalTextAlignment="End" />
</Grid>
</DataTemplate>
</Shell.ItemTemplate>
</Shell>
Er, guys. Looks like using Menu Item instead of FlyoutItem will resolve the issue.

Change Hamburger Menu Icon in .NET MAUI app

How can I change the hamburger menu icon in a .NET MAUI app?
I've updated the style of all my icons and I want to change the hamburger menu icon to a custom PNG.
I tried the following in Styles.xaml but that doesn't seem to be the correct property to edit.
<Style TargetType="FlyoutPage">
<Setter Property="IconImageSource" Value="custom_menu_icon.png" />
</Style>
Solution for FlyoutPage
The Flyout of the FlyoutPage is of type ContentPage and thus the icon should be set there instead:
<ContentPage
IconImageSource="custom_menu_icon.png" />
</ContentPage>
You can also define it in the Styles.xaml and assign the style to the page:
<Style TargetType="ContentPage" x:Key="FlyoutStyle">
<Setter Property="IconImageSource" Value="custom_menu_icon.png" />
</Style>
<ContentPage
Style="{StaticResource FlyoutStyle}" />
</ContentPage>
See also: https://learn.microsoft.com/dotnet/maui/user-interface/pages/flyoutpage?view=net-maui-7.0#create-a-flyoutpage
This assumes that you're using the FlyoutPage and not Shell.
Solution for Shell
In case you're using Shell, you can define the style as follows:
<Style TargetType="Shell" ApplyToDerivedTypes="True">
<!-- skipping existing setters here -->
<Setter Property="Shell.FlyoutIcon" Value="custom_menu_icon.png" />
</Style>
See more: https://learn.microsoft.com/dotnet/maui/fundamentals/shell/flyout?view=net-maui-7.0#flyout-icon

ControlTemplate Content Not Resizing

I am trying to achieve a templated view on my pages which displays a standard header and footer where my content goes in the middle. To achieve this I decided to use a ControlTemplate and reference this on each page.
In my resource dictionary I have the following:
<ControlTemplate x:Key="MoneyTemplate">
<Grid
VerticalOptions="FillAndExpand"
BackgroundColor="{DynamicResource BackgroundColor}"
Padding="25">
<Grid.RowDefinitions>
<RowDefinition Height="100" />
<RowDefinition Height="*" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Image
Grid.Row="0"
Source="buddy.png" />
<tabView:SfTabView
Grid.Row="1"
VerticalOptions="CenterAndExpand"
TabBarPlacement="Bottom">
<tabView:SfTabItem Header="Overview" TextColor="Black">
<ContentPresenter />
</tabView:SfTabItem>
<tabView:SfTabItem Header="Scheduler">
<Label Text="Hello world" />
</tabView:SfTabItem>
</tabView:SfTabView>
<Label
Grid.Row="2"
Text="Hello" />
</Grid>
</ControlTemplate>
And on my pages I implement with:
<ContentView
VerticalOptions="Fill"
ControlTemplate="{StaticResource MoneyTemplate}">PAGE CONTENT GOES HERE</ContentView>
When I implement this in a Windows application and resize my window the control does not update, however if I stop using a ControlTemplate and paste this xaml directly into the page everything renders correctly.
I realise that MAUI is still in preview but I'm unsure of whether the problem is the way I've written the template and whether my understanding is off or whether this is a bug within MAUI.

what is the structure of the xml file (tags) of the wiki pages-articles dump file

i thought that the wiki dump XML file TAGS will be like
<page>
<title> </title>
<content> </content>
</page>
<page>
<title> </title>
<content> </content>
</page>
in addition to other tags.
i managed to find the page and title tags, but i still can not find where the main article is, in body tag, or content tag, or article tag, any help
The main article will be inside tag <page>,then<revision> and inside them search for <text>