Android Keyboard with Emoji

前端 未结 4 1810
悲哀的现实
悲哀的现实 2020-12-03 01:25

So I want to have a keyboard in my app that has emoji just like Whatsapp or Hangouts. How can I do that? I want to leave my key keyboard as it is I just want to add tabs to

相关标签:
4条回答
  • 2020-12-03 01:56

    As @dbar pointed out, the answer is:

    android:inputType="textShortMessage"
    

    But in my case, I was already using textMultiLine, so I had to use the both of them together:

    android:inputType="textMultiLine|textShortMessage"
    

    Looks like this:

    I'm not sure about the Exact android version, but this should work only on Android 4.1 and above

    0 讨论(0)
  • 2020-12-03 02:00

    Finally the answer was:

    android:inputType="textShortMessage"
    

    The new line key becomes a key to take out the emoji keyboard. The only quibble is the 'new line' key from the keyboard disappears with this configuration (before you could long press to choose between emoji/new line but now it's only emoji).

    0 讨论(0)
  • 2020-12-03 02:15

    There is no functionality to add tabs to any generic keyboard. Certain keyboards may support it, but it isn't a common feature. You could write your own fully custom keyboard, but that's a lot of work and will piss off many users.

    Also, I'm not sure what you mean about by like in hangouts. I use hangouts- it doesn't do anything odd with my keyboard. It stays as Swype, there's no special emoji tab. It may be a feature of your favorite keyboard based on the input type (I assume both use input type textShortMessage). But it isn't a generic feature.

    0 讨论(0)
  • 2020-12-03 02:20

    In Google Hangout, the emoji button is not on the keyboard (at least on my phone which is already using a third party keyboard), it's inside of the TextEdit box, and so it's part of the application itself (Gabe, I'm talking about the latest Google Hangout on top of KitKat with emoji support, all the current screenshots I found of Google Hangout do not show what I'm seeing on my phone, so this must be a very recent feature).

    This is actually pretty easy to do, placing an ImageButton to the right of a TextView inside a RelativeLayout (the RelativeLayout which is made to look like a TextView with a custom background).

    Then, it's just a matter of hiding the keyboard when clicking on that ImageButton and replacing it with a panel full of emojis when that happens (like in this open source emoji android keyboard, which is under a creative commons non-commercial license).

    0 讨论(0)
提交回复
热议问题