-
Notifications
You must be signed in to change notification settings - Fork 758
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
Update shields to match web #4338
Conversation
Can you add a file for the changelog please? |
Yes, I am waiting for some inputs (potential copy change), and also why web removes the white border on dark mode (a bit annoying cause we are reusing the same component for shields on android) |
e15e07a
to
11747fb
Compare
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 a small remark on the impl, else LGTM
@@ -35,10 +35,23 @@ abstract class BottomSheetVerificationBigImageItem : VectorEpoxyModel<BottomShee | |||
|
|||
override fun bind(holder: Holder) { | |||
super.bind(holder) | |||
holder.image.render(roomEncryptionTrustLevel) | |||
when (roomEncryptionTrustLevel) { |
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 would prefer to keep the old code and add a optional parameter in the ShieldImageView
fun render(..., noBorder: Boolean = false)
to use alternative image in the case the parameter is true.
Can you do that please?
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.
done
<im.vector.app.core.ui.views.ShieldImageView xmlns:android="http://schemas.android.com/apk/res/android" | ||
<ImageView xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:contentDescription="@string/trusted" |
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.
android:contentDescription
-> tools:contentDescription
Also please format the file.
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.
done
@@ -1,5 +1,8 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<im.vector.app.core.ui.views.ShieldImageView xmlns:android="http://schemas.android.com/apk/res/android" | |||
<ImageView xmlns:android="http://schemas.android.com/apk/res/android" |
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.
So you can revert the change on this line too
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.
done
e861314
to
78bdef4
Compare
@@ -35,7 +35,7 @@ abstract class BottomSheetVerificationBigImageItem : VectorEpoxyModel<BottomShee | |||
|
|||
override fun bind(holder: Holder) { | |||
super.bind(holder) | |||
holder.image.render(roomEncryptionTrustLevel) | |||
holder.image.render(roomEncryptionTrustLevel, borderLess = true) |
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.
nice!
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, I've double check all the vector drawables, and everything is fine
Is there a plan to have this as a config? |
isVisible = roomEncryptionTrustLevel != null | ||
|
||
when (roomEncryptionTrustLevel) { | ||
RoomEncryptionTrustLevel.Default -> { | ||
contentDescription = context.getString(R.string.a11y_trust_level_default) | ||
setImageResource(R.drawable.ic_shield_black) | ||
setImageResource( |
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.
@chagai95 updating these to use setAttributeTintedImageResource and then supplying a theme colour will allow customisations
Updated shield drawable to match those on wed (see https://www.figma.com/file/X4XTH9iS2KGJ2wFKDqkyed/Compound?node-id=1373%3A13)
Fixes element-hq/element-meta#52
There is still a difference though, the icons have a white border, but looks like on web they don't (see verification conclusion in dark theme on web)