-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat: add iconBackground support to backButton on iOS and Android #8160
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
base: master
Are you sure you want to change the base?
Conversation
|
@markdevocht, should I merge master already? |
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.
Hey thanks @adids1221!
Could you add a visual of some sort describing what you need?
Also, please be sure to add at least one visual (e2e) test to cover this use case 🙏🏻
@markdevocht @gosha212 let's discuss whether this is the right approach (=API) once we understand the use case better
|
@markdevocht thank you for the help! The issue solved by adding the if statment in |
markdevocht
left a comment
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.
Also I saw @d4vidi left a comment in his review about finding another way of doing it.
ios/RNNIconDrawer.mm
Outdated
| UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); | ||
| UIGraphicsEndImageContext(); | ||
|
|
||
| if (color && color != UIColor.clearColor) { |
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.
you can remove the color != UIColor.clearColor
| os: '15.5', | ||
| type: 'iPhone 16', | ||
| os: '18.2', | ||
| }, |
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 your change? if so, make sure to update all the snapshots from the snapshot tests. BUT I don't think you should update this.
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.
Reverted to your config.
Description
Adds
iconBackgroundproperty support tobackButtonoptions, matching the functionality available forrightButtonsandleftButtons.This enables circular and rounded background shapes behind the back button icon, consistent with regular button styling.
Changes:
iconBackground?: IconBackgroundOptions;toOptionsTopBarBackButtonTypeScript interfaceiconBackgroundinBackButtonclass, apply viaButtonPresenter.applyNavigationIcon()iconBackgroundproperty toRNNBackButtonOptions, parse and merge, render usingRNNIconDrawerTechnical Details:
IconBackgroundDrawableinfrastructure viaapplyIconBackgroundDrawable()methodRNNIconDrawerdirectly (simpler approach, no need for full icon creator system), added one more case.color,disabledColor,cornerRadius,width,heightpropertiesChangelog
BackButton - Added
iconBackgroundproperty support. Back button icons can now display circular or rounded backgrounds matching the styling of regular navigation buttons.Additional info
MADS-4884