Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EmojiTextView renders Emoji semi-transparent

I'm implementing the new EmojiCompat into my app. Now I run into the following issue and don't know how to fix it:

The code below is rendered by the EmojiCompat, but the Emoji is rendered semi-transparent:

<android.support.text.emoji.widget.EmojiTextView
                            android:textAlignment="center"
                            android:text="😍"
                            android:textSize="100dp"
                            android:layout_gravity="center"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content" />

Screenshot of the rendered XML file on my device:

Rendered Emoji

The layout inspection says: alpha: 1.0


How can I fix the TextView to render it fully non-transparent?

Emoji compat version: com.android.support:support-emoji:27.1.+

like image 950
Sebastian Schneider Avatar asked Jun 13 '18 14:06

Sebastian Schneider


People also ask

How do I render emoji’s?

Emoji rendering is built in and handled automatically for you. Emoji’s are automatically replaced with images for consistent and clear rendering. This is enabled for you by default. Each image has an emoji class added to it on render. This makes it easy to tweak their display. Here is the default CSS we apply to all emoji.

How do I change the default display of my emojis?

Emoji’s are automatically replaced with images for consistent and clear rendering. This is enabled for you by default. Each image has an emoji class added to it on render. This makes it easy to tweak their display. Here is the default CSS we apply to all emoji. To make tweaks, adjust it and include it in your CSS to override the defaults.

Why are my emojis being replaced by images?

Emoji’s are automatically replaced with images for consistent and clear rendering. This is enabled for you by default. Each image has an emoji class added to it on render. This makes it easy to tweak their display.

When does the textview widget act as a textview?

When used on devices running API 18 or below, this widget acts as a regular TextView .


1 Answers

Because the default text color of my Theme was not pure black this is the fix:

mEmojiTextView.setTextColor(0xff000000); // set view textcolor to black

like image 96
Sebastian Schneider Avatar answered Sep 28 '22 09:09

Sebastian Schneider