Code example for PopupWindow

Methods: dismissisShowing

0
 
  private void setEmojiInputListener(View emojiInput) {
    emojiInput.setOnClickListener(new OnClickListener() {
      @Override 
      public void onClick(View v) {
        if (popupWindow.isShowing()) {
          popupWindow.dismiss();
        } 
      } 
    }); 
  } 
 
  private void setEmojiButtonListener(View emojiButton) {
    emojiButton.setOnClickListener(new OnClickListener() {
      @Override 
      public void onClick(View v) {
        if (popupWindow.isShowing()) {
          popupWindow.dismiss();
        } else { 
          popupWindow.setHeight(menuHeight);
          popupWindow.showAtLocation(parentLayout, Gravity.BOTTOM, 0, 0);