I'm trying to implement emojis in a way that I automatically replace things like ":)" with their emoji equivalent. And I'm not really sure how to do that, I found a table of emoji UTF codes, but I'm not sure on how I'm supposed to programmatically put them into a EditText :/
inputField=(EditText)temp.findViewById(R.id.inputField);
inputField.addTextChangedListener(new TextWatcher() {
boolean justChanged=false;
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if(justChanged) {
justChanged=false;
return;
}
Log.d(s.toString(), s.toString());
if(s.toString().contains(":)")) {
justChanged=true;
inputField.setText(s.toString().replace(":)", "UTF CODE HERE?"));
}
}
@Override
public void afterTextChanged(Editable s) {
}
});