Search code examples
androidtextviewemoji

Android: Apply skin tone to emoji in TextView


I am trying to set a fixed text on a TextView. The text contains an emoji. Here's what I have so far:

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Welcome to Earth &#128075;" />

The TextView above returns the text below:

Welcome to Earth 👋

I want the emoji to have a dark skin tone. Basically, I want the text to look like this:

Welcome to Earth 👋🏾

Is there a prefix or suffix I can add to the emoji's unicode to change the skin tone?
If not, how do I go about this?


Solution

  • I found a couple of skin-tone codes here. All I had to do was to append them to my emoji unicode. Here's an illustration:

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Welcome to Earth &#128075;&#127998;" />
    

    This returns:

    Welcome to Earth 👋🏾