Browse Source

more emojis

pull/45/head
Thodoris1999 6 years ago
parent
commit
d7645a4498
  1. 24
      app/src/main/java/gr/thmmy/mthmmy/utils/EmojiKeyboard.java
  2. 13
      app/src/main/java/gr/thmmy/mthmmy/utils/ImageKeyboardAdapter.java
  3. BIN
      app/src/main/res/drawable/cheesy.gif
  4. BIN
      app/src/main/res/drawable/cool.gif
  5. BIN
      app/src/main/res/drawable/cry.gif
  6. BIN
      app/src/main/res/drawable/embarrassed.gif
  7. BIN
      app/src/main/res/drawable/grin.gif
  8. BIN
      app/src/main/res/drawable/huh.gif
  9. BIN
      app/src/main/res/drawable/kiss.gif
  10. BIN
      app/src/main/res/drawable/lipsrsealed.gif
  11. BIN
      app/src/main/res/drawable/rolleyes.gif
  12. BIN
      app/src/main/res/drawable/sad.gif
  13. BIN
      app/src/main/res/drawable/shocked.gif
  14. BIN
      app/src/main/res/drawable/smiley.gif
  15. BIN
      app/src/main/res/drawable/tongue.gif
  16. BIN
      app/src/main/res/drawable/undecided.gif
  17. BIN
      app/src/main/res/drawable/wink.gif

24
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) { public void init(Context context, AttributeSet attrs) {
LayoutInflater.from(context).inflate(R.layout.emoji_keyboard, this, true); 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"); emojis.append(R.drawable.heart, "<3");
// this was twice in the original page for some reason, with another alias "locked" // this was twice in the original page for some reason, with another alias "locked"
emojis.append(R.drawable.locked, "^lock^"); emojis.append(R.drawable.locked, "^lock^");
@ -56,7 +73,6 @@ public class EmojiKeyboard extends LinearLayout {
// the next two are the same thing? // the next two are the same thing?
emojis.append(R.drawable.angry4, ":angry4:"); emojis.append(R.drawable.angry4, ":angry4:");
emojis.append(R.drawable.angry_hot, "^angryhot^"); emojis.append(R.drawable.angry_hot, "^angryhot^");
emojis.append(R.drawable.angry, "^angry^");
emojis.append(R.drawable.foyska, "^fouska^"); emojis.append(R.drawable.foyska, "^fouska^");
emojis.append(R.drawable.e10_7_3e, "^sfinaki^"); emojis.append(R.drawable.e10_7_3e, "^sfinaki^");
emojis.append(R.drawable.bang_head, "^banghead^"); emojis.append(R.drawable.bang_head, "^banghead^");
@ -176,8 +192,8 @@ public class EmojiKeyboard extends LinearLayout {
this.inputConnection = inputConnection; this.inputConnection = inputConnection;
} }
public int[] getEmojiArray() { public Integer[] getEmojiArray() {
int[] emojiArray = new int[emojis.size()]; Integer[] emojiArray = new Integer[emojis.size()];
for (int i = 0; i < emojiArray.length; i++) { for (int i = 0; i < emojiArray.length; i++) {
emojiArray[i] = emojis.keyAt(i); emojiArray[i] = emojis.keyAt(i);
} }

13
app/src/main/java/gr/thmmy/mthmmy/utils/ImageKeyboardAdapter.java

@ -1,19 +1,27 @@
package gr.thmmy.mthmmy.utils; package gr.thmmy.mthmmy.utils;
import android.content.Context; import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.BaseAdapter; import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView; import android.widget.ImageView;
import java.util.Arrays;
public class ImageKeyboardAdapter extends BaseAdapter { public class ImageKeyboardAdapter extends BaseAdapter {
private Context context; 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.context = context;
this.emojiIds = emojiIds; this.emojiIds = emojiIds;
// sort images by width
Arrays.sort(this.emojiIds, (img1, img2) ->
context.getResources().getDrawable(img1).getIntrinsicWidth() -
context.getResources().getDrawable(img2).getIntrinsicWidth());
} }
@Override @Override
@ -38,6 +46,7 @@ public class ImageKeyboardAdapter extends BaseAdapter {
emoji = new ImageView(context); emoji = new ImageView(context);
emoji.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); emoji.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
emoji.setScaleType(ImageView.ScaleType.CENTER_CROP); emoji.setScaleType(ImageView.ScaleType.CENTER_CROP);
emoji.setPadding(8, 8, 8, 8); emoji.setPadding(8, 8, 8, 8);
} else { } else {
emoji = (ImageView) convertView; emoji = (ImageView) convertView;

BIN
app/src/main/res/drawable/cheesy.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 811 B

BIN
app/src/main/res/drawable/cool.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
app/src/main/res/drawable/cry.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
app/src/main/res/drawable/embarrassed.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
app/src/main/res/drawable/grin.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
app/src/main/res/drawable/huh.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 741 B

BIN
app/src/main/res/drawable/kiss.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 B

BIN
app/src/main/res/drawable/lipsrsealed.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

BIN
app/src/main/res/drawable/rolleyes.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
app/src/main/res/drawable/sad.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 B

BIN
app/src/main/res/drawable/shocked.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
app/src/main/res/drawable/smiley.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 B

BIN
app/src/main/res/drawable/tongue.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 B

BIN
app/src/main/res/drawable/undecided.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 B

BIN
app/src/main/res/drawable/wink.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 944 B

Loading…
Cancel
Save