-
Notifications
You must be signed in to change notification settings - Fork 27
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
chore: Use InfoBadge for TabBarItem badge support #1142
Open
morning4coffe-dev
wants to merge
12
commits into
unoplatform:main
Choose a base branch
from
morning4coffe-dev:dev/doti/add-infobadge-tabbaritem
base: main
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 3 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
fbdfb56
chore: Use InfoBadge for TabBarItem badge support
morning4coffe-dev f6636f4
chore: Implement BadgeVisibility and BadgeValue with WinUI InfoBadge
morning4coffe-dev c70012a
chore: Adjust placement of InfoBadge
morning4coffe-dev a7b9e3b
docs: Add `InfoBadge` option to docs
morning4coffe-dev 1f472f0
chore: Note deprecated properties
morning4coffe-dev 45eb8bc
chore: Add Deprecated attribute
morning4coffe-dev 849d233
chore: Add missing System using
morning4coffe-dev c857c1a
Merge branch 'main' into dev/doti/add-infobadge-tabbaritem
morning4coffe-dev cf18db6
chore: Comment out Obsolete
morning4coffe-dev 6e6e74c
chore: Minor InfoBadge adjustments
morning4coffe-dev d030058
docs: Adjust TabBarItem badge
morning4coffe-dev c83ea0f
Merge branch 'main' into dev/doti/add-infobadge-tabbaritem
morning4coffe-dev 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 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 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
72 changes: 72 additions & 0 deletions
72
src/library/Uno.Toolkit.Material/Styles/Controls/v2/InfoBadge.xaml
This file contains 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,72 @@ | ||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls" | ||
mc:Ignorable="d"> | ||
|
||
<!-- InfoBadge BottomTabBarItem Resources and Styles --> | ||
|
||
<!-- Common --> | ||
<StaticResource x:Key="MaterialInfoBadgeBottomTabBarItemBackground" | ||
ResourceKey="ErrorBrush" /> | ||
<StaticResource x:Key="MaterialInfoBadgeBottomTabBarItemForeground" | ||
ResourceKey="OnErrorBrush" /> | ||
|
||
<!-- Small InfoBadge--> | ||
<x:Double x:Key="MaterialSmallInfoBadgeBottomTabBarItemHeight">6</x:Double> | ||
<x:Double x:Key="MaterialSmallInfoBadgeBottomTabBarItemWidth">6</x:Double> | ||
<Thickness x:Key="MaterialSmallInfoBadgeBottomTabBarItemMargin">0,4,20,0</Thickness> | ||
|
||
|
||
<!-- Large InfoBadge--> | ||
<x:Double x:Key="MaterialLargeInfoBadgeBottomTabBarItemHeight">16</x:Double> | ||
<Thickness x:Key="MaterialLargeInfoBadgeBottomTabBarItemMargin">32,4,0,0</Thickness> | ||
<CornerRadius x:Key="MaterialLargeInfoBadgeBottomTabBarItemCornerRadius">8</CornerRadius> | ||
Comment on lines
+11
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These need to be inside of ThemeDictionaries to be able to be overridden via lightweight styling |
||
|
||
<Style x:Key="MaterialSmallInfoBadgeBottomTabBarItemStyle" | ||
TargetType="muxc:InfoBadge"> | ||
<Setter Property="Background" | ||
Value="{ThemeResource MaterialInfoBadgeBottomTabBarItemBackground}" /> | ||
<Setter Property="HorizontalAlignment" | ||
Value="Right" /> | ||
<Setter Property="VerticalAlignment" | ||
Value="Top" /> | ||
<Setter Property="Height" | ||
Value="{ThemeResource MaterialSmallInfoBadgeBottomTabBarItemHeight}" /> | ||
<Setter Property="Width" | ||
Value="{ThemeResource MaterialSmallInfoBadgeBottomTabBarItemWidth}" /> | ||
<Setter Property="Margin" | ||
Value="{ThemeResource MaterialSmallInfoBadgeBottomTabBarItemMargin}" /> | ||
</Style> | ||
|
||
<Style x:Key="MaterialLargeInfoBadgeBottomTabBarItemStyle" | ||
TargetType="muxc:InfoBadge"> | ||
<Setter Property="Background" | ||
Value="{ThemeResource MaterialInfoBadgeBottomTabBarItemBackground}" /> | ||
<Setter Property="Foreground" | ||
Value="{ThemeResource MaterialInfoBadgeBottomTabBarItemForeground}" /> | ||
<Setter Property="HorizontalAlignment" | ||
Value="Left" /> | ||
<Setter Property="VerticalAlignment" | ||
Value="Top" /> | ||
<Setter Property="VerticalContentAlignment" | ||
Value="Center" /> | ||
<Setter Property="Height" | ||
Value="{ThemeResource MaterialLargeInfoBadgeBottomTabBarItemHeight}" /> | ||
<Setter Property="Margin" | ||
Value="{ThemeResource MaterialLargeInfoBadgeBottomTabBarItemMargin}" /> | ||
<Setter Property="CornerRadius" | ||
Value="{ThemeResource MaterialLargeInfoBadgeBottomTabBarItemCornerRadius}" /> | ||
<!-- Label ExtraSmall --> | ||
<Setter Property="FontFamily" | ||
Value="{StaticResource MaterialLabelSmallFontFamily}" /> | ||
<Setter Property="FontWeight" | ||
Value="{StaticResource MaterialLabelSmallFontWeight}" /> | ||
<Setter Property="FontSize" | ||
Value="{StaticResource MaterialLabelSmallFontSize}" /> | ||
<Setter Property="CharacterSpacing" | ||
Value="{StaticResource MaterialLabelSmallCharacterSpacing}" /> | ||
</Style> | ||
|
||
</ResourceDictionary> |
This file contains 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
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.
Do we have an issue to track in Toolkit to do this for the next major version bump?
Do we have docs written in the migration section for this deprecation or recommendation to use InfoBadge explicitly?
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.
Thanks @kazo0, I will take a look 👍