-
Notifications
You must be signed in to change notification settings - Fork 338
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
[First - PlatformSpecific] NavigationBar for Android #1678
Conversation
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.
A couple of comments that could be helpful for anyone who wants to implement some Platform-Specific in the future.
|
||
internal static partial void RemapForControls() | ||
{ | ||
PageHandler.Mapper.Add(ColorProperty.PropertyName, MapNavigationColorProperty); |
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.
Think this as the PropertyChanged
for the BindableProperty
, and this will be attached to the Page
, but keep in mind that should be attached to the control that we'll implement the feature
|
||
namespace CommunityToolkit.Maui.PlatformConfiguration.AndroidSpecific; | ||
|
||
static partial class NavigationBar |
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.
As you will see I created this as partial class, one to hold the properties that should be visible for all platforms, and the implementation, which can be visible just for the platform-specific, in this case android
.
/// <summary> | ||
/// Provides platform-specific configuration properties for the Android navigation bar. | ||
/// </summary> | ||
public static partial class NavigationBar |
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.
This is the property class, where we hold everything that should be visible for all platforms
internal static partial void RemapForControls(); | ||
|
||
#if !ANDROID | ||
internal static partial void RemapForControls() | ||
{ | ||
|
||
} | ||
#endif |
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.
use this pattern here, so when we call this method on AppBuilderExtensions
we don't need to use the #if <Platform>
, so we do the mess just in one place.
src/CommunityToolkit.Maui.Core/Extensions/WindowExtensions.android.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Maui/PlatformConfiguration/AndroidSpecific/NavigationBar.Impl.android.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Vladislav Antonyuk <33021114+VladislavAntonyuk@users.noreply.github.com>
Thank you for another great piece of work @pictos! |
Oops guess we still needed the documentation of course |
I'll jump on that tonight |
Thank you! Let me know if you can do it, else I will! |
@jfversluis you should find a docs PR waiting for your review :) |
Description of Change
This PR implements our first platform-specific feature. It's a move on from the approach taken on #1665.
Documentation will be created after the PR review.
Linked Issues
PR Checklist
approved
(bug) orChampioned
(feature/proposal)main
at time of PRAdditional information
Screenbits.2024-02-05_013419.mp4