Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Display sticker description on row message click #2121

Merged
merged 2 commits into from
Mar 30, 2018
Merged

Conversation

Tyuoli
Copy link
Contributor

@Tyuoli Tyuoli commented Mar 29, 2018

@Tyuoli Tyuoli requested a review from manuroe March 29, 2018 14:04
@Tyuoli
Copy link
Contributor Author

Tyuoli commented Mar 29, 2018

stickers3
stickers2
stickers1

@@ -1873,6 +1876,13 @@ private void manageSelectionMode(final View contentView, final Event event, fina
tsTextView.setVisibility(View.VISIBLE);
}

StickerMessage stickerMessage = JsonUtils.toStickerMessage(event.getContent());
Copy link
Member

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you have msgType

Copy link
Contributor Author

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);
Copy link
Member

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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" />
Copy link
Contributor

@ylecollen ylecollen Mar 30, 2018

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.

Copy link
Contributor Author

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.

@Tyuoli
Copy link
Contributor Author

Tyuoli commented Mar 30, 2018

Sticker display in dark theme

sticker_dark_theme

Sticker display in black theme

sticker_black_theme

@Tyuoli Tyuoli merged commit bc03d09 into develop Mar 30, 2018
@Tyuoli Tyuoli deleted the sticker_description branch March 30, 2018 08:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants