-
Notifications
You must be signed in to change notification settings - Fork 394
Display sticker description on row message click #2121
Conversation
@@ -1873,6 +1876,13 @@ private void manageSelectionMode(final View contentView, final Event event, fina | |||
tsTextView.setVisibility(View.VISIBLE); | |||
} | |||
|
|||
StickerMessage stickerMessage = JsonUtils.toStickerMessage(event.getContent()); |
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.
Should be done after having checked Event.EVENT_TYPE_STICKER.
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 have msgType
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.
It's not a msgType from server but a new one in local to hack json parsing. It was created in order to obtain a StickerMessage even if it's an event type.
It allows us to have a StickerMessage that inherits from ImageMessage. However, you can not use the msgType to do the checks.
@@ -1320,8 +1320,11 @@ private View getImageVideoView(int type, final int position, View convertView, V | |||
|
|||
|
|||
if (null != message) { | |||
mHelper.hideStickerDescription(convertView); |
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.
Could we hide it by default in the xml layout?
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 code is needed because of recycled views but you're right, it should be hidden by default.
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 agree to hide the description of the sticker by default in the xml.
However, I have to keep the hideStickerDescription method when calling the image view, otherwise it remains displayed after the click. I therefore lose the behavior where the description appears when the message row is selected and disappears when it is deselected (via the booleans : isInSelectionMode & isSelected).
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> | ||
<corners android:radius="10dp" /> | ||
<solid android:color="@color/list_divider_color_light" /> |
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.
did you check with theme update ? ie black / dark theme ?
I assume you did not : list_divider_color_light is a light theme color.
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.
Thanks to point that. I will check.
element-hq/riot-meta#146