-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Introduction View #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
FreakyAli
wants to merge
4
commits into
master
Choose a base branch
from
r1-gh/feat/onboarding-ui
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,4 +9,4 @@ public enum CoachmarkAnimationStyle | |
| Spotlight, | ||
| Arrow, | ||
| Morph | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
Maui.FreakyUXKit/Maui.FreakyUXKit/IntroView/FreakyIntroStep.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| using System.Windows.Input; | ||
| using Microsoft.Maui.Controls.Shapes; | ||
| namespace Maui.FreakyUXKit; | ||
|
|
||
| public class FreakyIntroStep | ||
| { | ||
| public string TitleText { get; set; } | ||
| public FormattedString TitleFormattedText { get; set; } | ||
| public string SubTitleText { get; set; } | ||
| public FormattedString SubtitleFormattedText { get; set; } | ||
| public ImageSource ImageSource { get; set; } | ||
| public Style ImageStyle { get; set; } | ||
| public Style TitleLabelStyle { get; set; } | ||
| public Style SubtitleLabelStyle { get; set; } | ||
| public string LeftButtonText { get; set; } | ||
| public ICommand LeftButtonCommand { get; set; } | ||
| public bool IsLeftButtonVisible { get; set; } | ||
| public string CenterButtonText { get; set; } | ||
| public ICommand CenterButtonCommand { get; set; } | ||
| public bool IsCenterButtonVisible { get; set; } | ||
| public string RightButtonText { get; set; } | ||
| public ICommand RightButtonCommand { get; set; } | ||
| public bool IsRightButtonVisible { get; set; } | ||
| public Brush BottomBackground { get; set; } = Colors.Transparent; | ||
| public Brush ImageBackground { get; set; } = Colors.Transparent; | ||
| public Brush Background { get; set; } = Brush.Transparent; | ||
| public Color BackgroundAnimationColor { get; set; } = Colors.Transparent; | ||
| public IShape BottomStrokeShape { get; set; } = new RoundRectangle() { CornerRadius = new CornerRadius(30, 30, 0, 0) }; | ||
| } | ||
112 changes: 112 additions & 0 deletions
112
Maui.FreakyUXKit/Maui.FreakyUXKit/IntroView/FreakyIntroView.xaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| <?xml version="1.0" encoding="utf-8" ?> | ||
| <ContentView | ||
| x:Class="Maui.FreakyUXKit.FreakyIntroView" | ||
| xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
| xmlns:local="clr-namespace:Maui.FreakyUXKit" | ||
| xmlns:skia="clr-namespace:SkiaSharp.Views.Maui.Controls;assembly=SkiaSharp.Views.Maui.Controls" | ||
| x:Name="this"> | ||
| <AbsoluteLayout> | ||
| <skia:SKCanvasView | ||
| x:Name="canvasView" | ||
| AbsoluteLayout.LayoutBounds="0, 0, 1, 1" | ||
| AbsoluteLayout.LayoutFlags="All" | ||
| IgnorePixelScaling="true" | ||
| InputTransparent="True" | ||
| PaintSurface="OnPaintSurface" /> | ||
| <CarouselView | ||
| Grid.Row="0" | ||
| AbsoluteLayout.LayoutBounds="0, 0, 1, 1" | ||
| AbsoluteLayout.LayoutFlags="All" | ||
| BackgroundColor="Transparent" | ||
| HorizontalScrollBarVisibility="Never" | ||
| IndicatorView="indicatorView" | ||
| IsScrollAnimated="{Binding IsScrollAnimated, Source={x:Reference this}, x:DataType=local:FreakyIntroView}" | ||
| IsSwipeEnabled="{Binding IsSwipeEnabled, Source={x:Reference this}, x:DataType=local:FreakyIntroView}" | ||
| ItemsSource="{Binding ItemsSource, Source={x:Reference this}, x:DataType=local:FreakyIntroView}" | ||
| ItemsUpdatingScrollMode="KeepLastItemInView" | ||
| Loop="False" | ||
| Position="{Binding Position, Source={x:Reference this}, x:DataType=local:FreakyIntroView}" | ||
| PositionChanged="CarouselView_PositionChanged" | ||
| VerticalScrollBarVisibility="Never"> | ||
| <CarouselView.ItemsLayout> | ||
| <LinearItemsLayout | ||
| Orientation="Horizontal" | ||
| SnapPointsAlignment="Start" | ||
| SnapPointsType="MandatorySingle" /> | ||
| </CarouselView.ItemsLayout> | ||
| <CarouselView.ItemTemplate> | ||
| <DataTemplate x:DataType="local:FreakyIntroStep"> | ||
| <Grid Background="{Binding Background}" RowDefinitions="3*, 2*"> | ||
| <Image | ||
| Grid.Row="0" | ||
| Margin="10" | ||
| Background="{Binding ImageBackground}" | ||
| Source="{Binding ImageSource}" | ||
| Style="{Binding ImageStyle}" /> | ||
| <Border | ||
| Grid.Row="1" | ||
| Padding="10" | ||
| Background="{Binding BottomBackground}" | ||
| StrokeShape="{Binding BottomStrokeShape}" | ||
| StrokeThickness="0"> | ||
| <Grid RowDefinitions="*,Auto"> | ||
| <VerticalStackLayout Grid.Row="0" Spacing="10"> | ||
| <Label | ||
| FontSize="Large" | ||
| FormattedText="{Binding TitleFormattedText}" | ||
| HorizontalTextAlignment="Center" | ||
| Style="{Binding TitleLabelStyle}" | ||
| Text="{Binding TitleText}" /> | ||
| <Label | ||
| FontSize="Medium" | ||
| FormattedText="{Binding SubtitleFormattedText}" | ||
| HorizontalTextAlignment="Center" | ||
| Style="{Binding SubtitleLabelStyle}" | ||
| Text="{Binding SubTitleText}" /> | ||
| </VerticalStackLayout> | ||
| <FlexLayout | ||
| Grid.Row="1" | ||
| AlignItems="Center" | ||
| Direction="{Binding ButtonsDirection, Source={x:Reference this}, x:DataType=local:FreakyIntroView}" | ||
| HeightRequest="50" | ||
| JustifyContent="SpaceBetween" | ||
| Wrap="NoWrap"> | ||
| <Button | ||
| Margin="5,0" | ||
| Command="{Binding LeftButtonCommand}" | ||
| FlexLayout.Grow="1" | ||
| IsVisible="{Binding IsLeftButtonVisible}" | ||
| Text="{Binding LeftButtonText}" /> | ||
| <Button | ||
| Margin="5,0" | ||
| Command="{Binding CenterButtonCommand}" | ||
| FlexLayout.Grow="1" | ||
| IsVisible="{Binding IsCenterButtonVisible}" | ||
| Text="{Binding CenterButtonText}" /> | ||
| <Button | ||
| Margin="5,0" | ||
| Command="{Binding RightButtonCommand}" | ||
| FlexLayout.Grow="1" | ||
| IsVisible="{Binding IsRightButtonVisible}" | ||
| Text="{Binding RightButtonText}" /> | ||
| </FlexLayout> | ||
| </Grid> | ||
|
|
||
| </Border> | ||
| </Grid> | ||
| </DataTemplate> | ||
| </CarouselView.ItemTemplate> | ||
| </CarouselView> | ||
| <IndicatorView | ||
| x:Name="indicatorView" | ||
| AbsoluteLayout.LayoutBounds="0.5,0.85,AutoSize,AutoSize" | ||
| AbsoluteLayout.LayoutFlags="PositionProportional" | ||
| HideSingle="True" | ||
| IndicatorColor="{Binding IndicatorColor, Source={x:Reference this}, x:DataType=local:FreakyIntroView}" | ||
| IndicatorSize="{Binding IndicatorSize, Source={x:Reference this}, x:DataType=local:FreakyIntroView}" | ||
| IndicatorsShape="{Binding IndicatorsShape, Source={x:Reference this}, x:DataType=local:FreakyIntroView}" | ||
| MaximumVisible="{Binding IndicatorMaximumVisible, Source={x:Reference this}, x:DataType=local:FreakyIntroView}" | ||
| SelectedIndicatorColor="{Binding SelectedIndicatorColor, Source={x:Reference this}, x:DataType=local:FreakyIntroView}" /> | ||
| </AbsoluteLayout> | ||
| </ContentView> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Initialize boolean properties with default values
Boolean properties should be initialized to ensure predictable behavior, especially for visibility properties.
Also applies to: 20-20, 23-23
🤖 Prompt for AI Agents