diff --git a/app/src/main/java/gr/thmmy/mthmmy/utils/EmojiKeyboard.java b/app/src/main/java/gr/thmmy/mthmmy/utils/EmojiKeyboard.java index 193ed928..fecee5c5 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/utils/EmojiKeyboard.java +++ b/app/src/main/java/gr/thmmy/mthmmy/utils/EmojiKeyboard.java @@ -36,7 +36,24 @@ public class EmojiKeyboard extends LinearLayout { public void init(Context context, AttributeSet attrs) { LayoutInflater.from(context).inflate(R.layout.emoji_keyboard, this, true); - // add space before emoji + emojis.append(R.drawable.smiley, ":)"); + emojis.append(R.drawable.wink, ";)"); + emojis.append(R.drawable.cheesy, ":D"); + emojis.append(R.drawable.grin, ";D"); + // second alias: ^angry^ + emojis.append(R.drawable.angry, ">:("); + emojis.append(R.drawable.sad, ":("); + emojis.append(R.drawable.shocked, ":o"); + emojis.append(R.drawable.cool, "8))"); + emojis.append(R.drawable.huh, ":???:"); + emojis.append(R.drawable.rolleyes, "::)"); + emojis.append(R.drawable.tongue, ":P"); + emojis.append(R.drawable.embarrassed, ":-["); + emojis.append(R.drawable.lipsrsealed, ":-X"); + emojis.append(R.drawable.undecided, ":-\\\\"); + emojis.append(R.drawable.kiss, ":-*"); + emojis.append(R.drawable.cry, ":'("); + emojis.append(R.drawable.heart, "<3"); // this was twice in the original page for some reason, with another alias "locked" emojis.append(R.drawable.locked, "^lock^"); @@ -56,7 +73,6 @@ public class EmojiKeyboard extends LinearLayout { // the next two are the same thing? emojis.append(R.drawable.angry4, ":angry4:"); emojis.append(R.drawable.angry_hot, "^angryhot^"); - emojis.append(R.drawable.angry, "^angry^"); emojis.append(R.drawable.foyska, "^fouska^"); emojis.append(R.drawable.e10_7_3e, "^sfinaki^"); emojis.append(R.drawable.bang_head, "^banghead^"); @@ -176,8 +192,8 @@ public class EmojiKeyboard extends LinearLayout { this.inputConnection = inputConnection; } - public int[] getEmojiArray() { - int[] emojiArray = new int[emojis.size()]; + public Integer[] getEmojiArray() { + Integer[] emojiArray = new Integer[emojis.size()]; for (int i = 0; i < emojiArray.length; i++) { emojiArray[i] = emojis.keyAt(i); } diff --git a/app/src/main/java/gr/thmmy/mthmmy/utils/ImageKeyboardAdapter.java b/app/src/main/java/gr/thmmy/mthmmy/utils/ImageKeyboardAdapter.java index a4ed3e05..c175994c 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/utils/ImageKeyboardAdapter.java +++ b/app/src/main/java/gr/thmmy/mthmmy/utils/ImageKeyboardAdapter.java @@ -1,19 +1,27 @@ package gr.thmmy.mthmmy.utils; import android.content.Context; +import android.graphics.drawable.Drawable; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; +import android.widget.GridView; import android.widget.ImageView; +import java.util.Arrays; + public class ImageKeyboardAdapter extends BaseAdapter { private Context context; - private int[] emojiIds; + private Integer[] emojiIds; - public ImageKeyboardAdapter(Context context, int[] emojiIds) { + public ImageKeyboardAdapter(Context context, Integer[] emojiIds) { this.context = context; this.emojiIds = emojiIds; + // sort images by width + Arrays.sort(this.emojiIds, (img1, img2) -> + context.getResources().getDrawable(img1).getIntrinsicWidth() - + context.getResources().getDrawable(img2).getIntrinsicWidth()); } @Override @@ -38,6 +46,7 @@ public class ImageKeyboardAdapter extends BaseAdapter { emoji = new ImageView(context); emoji.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); emoji.setScaleType(ImageView.ScaleType.CENTER_CROP); + emoji.setPadding(8, 8, 8, 8); } else { emoji = (ImageView) convertView; diff --git a/app/src/main/res/drawable/cheesy.gif b/app/src/main/res/drawable/cheesy.gif new file mode 100644 index 00000000..2bb06e66 Binary files /dev/null and b/app/src/main/res/drawable/cheesy.gif differ diff --git a/app/src/main/res/drawable/cool.gif b/app/src/main/res/drawable/cool.gif new file mode 100644 index 00000000..a3855f45 Binary files /dev/null and b/app/src/main/res/drawable/cool.gif differ diff --git a/app/src/main/res/drawable/cry.gif b/app/src/main/res/drawable/cry.gif new file mode 100644 index 00000000..a8e604db Binary files /dev/null and b/app/src/main/res/drawable/cry.gif differ diff --git a/app/src/main/res/drawable/embarrassed.gif b/app/src/main/res/drawable/embarrassed.gif new file mode 100644 index 00000000..73de9f23 Binary files /dev/null and b/app/src/main/res/drawable/embarrassed.gif differ diff --git a/app/src/main/res/drawable/grin.gif b/app/src/main/res/drawable/grin.gif new file mode 100644 index 00000000..b931bef7 Binary files /dev/null and b/app/src/main/res/drawable/grin.gif differ diff --git a/app/src/main/res/drawable/huh.gif b/app/src/main/res/drawable/huh.gif new file mode 100644 index 00000000..24ba230d Binary files /dev/null and b/app/src/main/res/drawable/huh.gif differ diff --git a/app/src/main/res/drawable/kiss.gif b/app/src/main/res/drawable/kiss.gif new file mode 100644 index 00000000..790ff9be Binary files /dev/null and b/app/src/main/res/drawable/kiss.gif differ diff --git a/app/src/main/res/drawable/lipsrsealed.gif b/app/src/main/res/drawable/lipsrsealed.gif new file mode 100644 index 00000000..612d9cb7 Binary files /dev/null and b/app/src/main/res/drawable/lipsrsealed.gif differ diff --git a/app/src/main/res/drawable/rolleyes.gif b/app/src/main/res/drawable/rolleyes.gif new file mode 100644 index 00000000..ad8636d8 Binary files /dev/null and b/app/src/main/res/drawable/rolleyes.gif differ diff --git a/app/src/main/res/drawable/sad.gif b/app/src/main/res/drawable/sad.gif new file mode 100644 index 00000000..b5d863a4 Binary files /dev/null and b/app/src/main/res/drawable/sad.gif differ diff --git a/app/src/main/res/drawable/shocked.gif b/app/src/main/res/drawable/shocked.gif new file mode 100644 index 00000000..2bf31b8b Binary files /dev/null and b/app/src/main/res/drawable/shocked.gif differ diff --git a/app/src/main/res/drawable/smiley.gif b/app/src/main/res/drawable/smiley.gif new file mode 100644 index 00000000..464a2c10 Binary files /dev/null and b/app/src/main/res/drawable/smiley.gif differ diff --git a/app/src/main/res/drawable/tongue.gif b/app/src/main/res/drawable/tongue.gif new file mode 100644 index 00000000..4d4ff793 Binary files /dev/null and b/app/src/main/res/drawable/tongue.gif differ diff --git a/app/src/main/res/drawable/undecided.gif b/app/src/main/res/drawable/undecided.gif new file mode 100644 index 00000000..64a56eaf Binary files /dev/null and b/app/src/main/res/drawable/undecided.gif differ diff --git a/app/src/main/res/drawable/wink.gif b/app/src/main/res/drawable/wink.gif new file mode 100644 index 00000000..1022bce7 Binary files /dev/null and b/app/src/main/res/drawable/wink.gif differ