@Override protected void onStart() { super.onStart(); System.out.println("aaaa onStart"); if (isOpenComment) { // 判断跟帖输入框是否打开 Log.d("aa", "onStart aaaa:" + mInputBar.getCurrentSelectedTabId()); if (mInputBar.getCurrentSelectedTabId() != CommonInputBar.TAB_KEYBOARD) { // 隐藏输入法 Log.d("aa", "onStart aaaa隐藏输入法"); InputMethodUtils.hideSoftInput(mContext, mEditContent); // mListView.requestFocus(); } } }
@Override public boolean dispatchKeyEvent(KeyEvent event) { if (mInputBar != null && mInputBar.getCurrentSelectedTabId() == CommonInputBar.TAB_KEYBOARD) { if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) { mInputBar.hideCommonInputBar(); } } return super.dispatchKeyEvent(event); }
@Override protected void onStop() { // TODO Auto-generated method stub super.onStop(); if (isOpenComment) { if (mInputBar != null && mInputBar.getCurrentSelectedTabId() == CommonInputBar.TAB_KEYBOARD) { mInputBar.hideCommonInputBar(); } } }
@Override public void onClick(View v) { int id = v.getId(); if (id == R.id.rl_post_detail_love) { // TODO点赞 if (!NetUtil.hasNet()) { return; } if (mPraise_done != -1) { if (PraiseTask.mPraiseMap.get(mMainId) == null) { PraiseTask.mPraiseMap.put(mMainId, 1); new PraiseTask(new PraiseEventBean(mMainId, mPraise_num, mPraise_done)).execute(); } else { // 操作请求中,不要频繁点击 GlobalToast.showToast(R.string.common_donnot_touchme, 0); } } } else if (id == R.id.rl_post_detail_comment) { // 评论 // TODO弹出输入框 switchMode(); } else if (id == R.id.rl_input) { switchMode(); } else if (id == R.id.btn_send) { mInputBar.cancelRecord(); // 发表跟帖 Boolean enable = (Boolean) v.getTag(); if (mEditContent == null || enable == null || !enable) { return; } else { String temp = mEditContent.getText().toString().replaceAll(" ", ""); temp = temp.replaceAll("\n", ""); if (temp.length() == 0) { GlobalToast.showToast(R.string.post_content_empty_hit, 0); return; } } new FollowTask(mMainId, mInputBar).execute(); // new SumitTopicTask(mMainPostId, mInputBar).execute(); // BUG #56254 建议:【47984】【论坛】发布跟帖-网络不可用时,提示失败信息,再点击评论按钮,之前输入的评论还保存 // clearEditText(mEditContent); switchMode(); } else if (id == R.id.et_input) { // 点击输入框 // fix BUG #57668 建议:【论坛】发表跟帖时,输入框操作会跳动影响使用体验,建议优化 if (mInputBar.getCurrentSelectedTabId() != CommonInputBar.TAB_KEYBOARD) { // mInputBar.setTabSelect(CommonInputBar.TAB_KEYBOARD); mInputBar.showCommonInputBar(); } // mInputBar.showCommonInputBar(); } else if (id == R.id.btn_more) { // 点击查看更多跟帖 // GlobalToast.showToast("全部跟帖", 0); UIHelper.showAllFollowActivity(mContext, mMainId, mFollow_num); } else if (id == R.id.rl_input_textonly) { switchTestOnlyMode(); } else if (id == R.id.btn_send_text) { String text = mEditText.getText().toString(); Boolean enable = (Boolean) v.getTag(); if (text == null || enable == null || !enable) { return; } if (!TextUtils.isEmpty(text)) { if (replyType == 1) { // 评论跟帖 ReplyFollowInfo info = new ReplyFollowInfo(mReplyFollowInfo.tid, text); new MyReplyFollowTask(info).execute(); } else if (replyType == 2) { // 回复评论 ReplyComment replyComment = new ReplyComment(mReplyInfo.oid, mReplyInfo.rid, mReplyInfo.user.uid, text); new MyReplyCommentTask(replyComment).execute(); } clearEditText(mEditText); } switchTestOnlyMode(); } else if (id == R.id.et_input_text) { if (mEditText.isFocused()) { // // ToastUtils.hideSoftInput(mContext, mEditText); // mListView.requestFocus(); } else { InputMethodUtils.showSoftInputMethod(mContext, mEditText); mEditText.requestFocus(); } } }