-
-
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
Add support text view style assertions bold and italic #59
Add support text view style assertions bold and italic #59
Conversation
private val isItalic: Boolean? = null | ||
) : BoundedMatcher<View, TextView>(TextView::class.java) { | ||
override fun describeTo(description: Description) { | ||
description.appendText("Text style doesn't match") |
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.
Just add a bit more for this reporting
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.
Yeah, will append similar information
|
||
override fun matchesSafely(item: TextView): Boolean { | ||
var compareResult = true | ||
if (isBold != null) { |
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.
val boldCheck = isBolt?.let { item.typeface.isBold == it} ?: true
c49467f
to
ebe5316
Compare
@hongwei-bai I terribly sorry, but I think will be better to have two separates With this approach we will have single responsibility + avoiding Boolean in constructor |
sure np @Vacxe. tbh I was swinging betweens the two. will make the changes. Thanks! 👍 |
ebe5316
to
46ad1c4
Compare
46ad1c4
to
8d9de25
Compare
Hi @Vacxe , feel typeface match might be quite strict sometimes(has to match style and weight too), maybe add this one as well for a few simple scenarios?