Пример #1
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_main);
   setupPopupDelegate();
   if (savedInstanceState != null) {
     mPopupDelegate.restoreState(savedInstanceState);
   }
   setupSendButton();
 }
Пример #2
0
  private void setupPopupDelegate() {
    final ImageView emojiButton = (ImageView) findViewById(R.id.emoji_btn);
    mPopupDelegate.attach(findViewById(R.id.root_view));
    mPopupDelegate.setInputEditText((EditText) findViewById(R.id.emojicon_edit_text));
    mPopupDelegate.setShowHideListener(
        new EmojiconPopupDelegate.PopupShownListener() {
          @Override
          public void onPopupShown() {
            emojiButton.setImageResource(R.drawable.ic_action_keyboard);
          }

          @Override
          public void onPopupHidden() {
            emojiButton.setImageResource(R.drawable.smiley);
          }
        });
    emojiButton.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            mPopupDelegate.toggle();
          }
        });
  }