@Override @OnClick({ R.id.ib_picture, R.id.ib_mention, R.id.ib_trend_software, R.id.ib_emoji_keyboard, R.id.iv_clear_img, R.id.tv_clear }) public void onClick(View v) { switch (v.getId()) { case R.id.ib_emoji_keyboard: if (keyboardFragment.isShow()) { keyboardFragment.hideEmojiKeyBoard(); keyboardFragment.showSoftKeyboard(mEtInput); } else { keyboardFragment.showEmojiKeyBoard(); keyboardFragment.hideSoftKeyboard(); } break; case R.id.ib_picture: handleSelectPicture(); break; case R.id.ib_mention: tryToShowMetionUser(); break; case R.id.ib_trend_software: insertTrendSoftware(); break; case R.id.iv_clear_img: mIvImage.setImageBitmap(null); mLyImage.setVisibility(View.GONE); imgFile = null; break; case R.id.tv_clear: handleClearWords(); break; default: break; } }
@Override public void initView() { // TODO Auto-generated method stub ButterKnife.inject(this); setActionBarTitle(R.string.team_new_active); mTvClear.setText(String.valueOf(MAX_TEXT_LENGTH)); mEtInput.addTextChangedListener( new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { // TODO Auto-generated method stub } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // TODO Auto-generated method stub } @Override public void afterTextChanged(Editable s) { updateSendMenu(); mTvClear.setText((MAX_TEXT_LENGTH - s.length()) + ""); } }); getSupportFragmentManager() .beginTransaction() .replace(R.id.emoji_keyboard_fragment, keyboardFragment) .commit(); keyboardFragment.setOnEmojiClickListener( new OnEmojiClickListener() { @Override public void onEmojiClick(Emojicon v) { InputHelper.input2OSC(mEtInput, v); } @Override public void onDeleteButtonClick(View v) { InputHelper.backspace(mEtInput); } }); }
@Override protected void onResume() { super.onResume(); keyboardFragment.hideEmojiKeyBoard(); }