如何在库中添加我自己的表情符号我有png格式的图标来实现为表情符号

时间:2019-10-17 09:09:15

标签: java android emoji

我已经实现了表情符号键盘库,它显示的是库中的表情符号,请帮助我添加自己的png文件,因为库中的表情符号需要一个专业人士来帮助我,这是代码: 我想在png格式的表情符号键盘中添加自己的表情符号。

import hani.momanii.supernova_emoji_library.Actions.EmojIconActions;
import hani.momanii.supernova_emoji_library.Helper.EmojiconEditText;
import hani.momanii.supernova_emoji_library.Helper.EmojiconTextView;

import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {
CheckBox mCheckbox;
EmojiconEditText emojiconEditText ,emojiconEditText2;
EmojiconTextView textView ;
ImageView emojibotton ;
View rootview ;
ImageView Submitbutton;
EmojIconActions emojiicon;
@Override
 protected void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.activity_main);
     rootview=findViewById(R.id.rootview);
     emojibotton=(ImageView)findViewById(R.id.emoji_btn);
     Submitbutton=(ImageView)findViewById(R.id.btnsubmit);
     mCheckbox=(CheckBox) findViewById(R.id.user_default);
     emojiconEditText=(EmojiconEditText)findViewById(R.id.emoji_edittext);
     emojiconEditText2=(EmojiconEditText)findViewById(R.id.emoji_edittext2);
     textView=(EmojiconTextView)findViewById(R.id.textview);
     emojiicon=new EmojIconActions(this,rootview,emojiconEditText,emojibotton);
     emojiicon.ShowEmojIcon();
     emojiicon.setKeyboardListener(new EmojIconActions.KeyboardListener() {
         @Override
         public void onKeyboardOpen() {
             Toast.makeText(MainActivity.this,"keyboard opened",Toast.LENGTH_SHORT).show();
         }

         @Override
         public void onKeyboardClose() {
             Toast.makeText(MainActivity.this,"keyboard closed",Toast.LENGTH_SHORT).show();
         }
     });
     mCheckbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
         @Override
         public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
             emojiicon.setUseSystemEmoji(isChecked);
             textView.setUseSystemDefault(isChecked);
         }
     });
emojiicon.addEmojiconEditTextList(emojiconEditText2);
Submitbutton.setOnClickListener(new View.OnClickListener() {
 @Override
 public void onClick(View v) {
     String newtext =emojiconEditText.getText().toString();
     textView.setText(newtext);

 }
});

 }
}  ```  

0 个答案:

没有答案