-
Notifications
You must be signed in to change notification settings - Fork 169
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
Add custom TextBadge() component #459
Conversation
This allows to customize the shape. I also changed the color of the text to OnTertiary to avoid contrast issues.
Maybe it's just me, but the text looks a little lower inside the flair. |
I think this is the default behaviour for fonts, they are "optically" centered so that when there is a longer capital letter it looks fine. In my screenshots it is all lower case so maybe that's why. But I will check with the padding as maybe I made a mistake or should adjust some things |
If you want to fix your checks run |
Thanks! Mark this as "ready to review" when you're ready. |
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.
There are also two other badges, use the find in files
and search for Badge(
@@ -34,14 +39,19 @@ fun PersonName( | |||
val style = MaterialTheme.typography.bodyMedium | |||
|
|||
if (isPostCreator) { | |||
Badge( | |||
containerColor = MaterialTheme.colorScheme.tertiary, | |||
Box( |
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.
Might as well externalize this to its own composable, we'll probably have more uses for it later on. Put it in one of the files (or a new one), in ui/common/...
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.
I will do just that, thanks!
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.
@dessalines Hey, I didnt change the other Badge() since it looks like they are being used as their intended use case, which is to show a number for like notifications. And I am not sure if this badge should be affected by the corner radius changes since they are very small and I don't think there would be a way to make them slightly squared off but still looking nice, I feel the radius would make it look off-circley, kind of like a broken circle.
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.
Mmmk that's fine.
Add default values and add padding values
name = "op_comment_badge_radius", | ||
defaultValue = DEFAULT_OP_COMMENT_BADGE_RADIUS.toString(), | ||
) | ||
val opCommentBadgeRadius: Int |
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 way overkill, no need for any custom setting here. Lets just have this be a sane default. Literally every tiny thing could be tweaked, from icon sizes, to spacing of every little thing. This one doesn't need it.
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.
If no custom settings are needed then I guess its ready for review/merge !
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.
ugh, just noticed the conflict
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.
LGTM
btw @twizmwazin does it let you click the enable auto-merge button? Whoever is the 2nd reviewer should feel free to do that. |
This PR is not done yet, I want to make it so that it is possible to edit the value in the app settings.
Change the radius value in the settingsAddresses #92