|
|
@@ -104,14 +104,6 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
|
|
|
protected ImageView mAudioInputSwitchButton;
|
|
|
protected boolean mAudioInputDisable;
|
|
|
|
|
|
- /**
|
|
|
- * 表情按钮
|
|
|
- *
|
|
|
- * emoji button
|
|
|
- */
|
|
|
- protected ImageView mEmojiInputButton;
|
|
|
- protected boolean mEmojiInputDisable;
|
|
|
-
|
|
|
/**
|
|
|
* 更多按钮
|
|
|
*
|
|
|
@@ -212,7 +204,6 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
|
|
|
mInputMoreView = findViewById(R.id.more_groups);
|
|
|
mSendAudioButton = findViewById(R.id.chat_voice_input);
|
|
|
mAudioInputSwitchButton = findViewById(R.id.voice_input_switch);
|
|
|
- mEmojiInputButton = findViewById(R.id.face_btn);
|
|
|
mMoreInputButton = findViewById(R.id.more_btn);
|
|
|
mSendTextButton = findViewById(R.id.send_btn);
|
|
|
mTextInput = findViewById(R.id.chat_message_input);
|
|
|
@@ -223,22 +214,6 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
|
|
|
quoteTv = quotePreviewBar.findViewById(R.id.reply_text);
|
|
|
quoteCloseBtn = quotePreviewBar.findViewById(R.id.reply_close_btn);
|
|
|
|
|
|
- int iconSize = getResources().getDimensionPixelSize(R.dimen.chat_input_icon_size);
|
|
|
- ViewGroup.LayoutParams layoutParams = mEmojiInputButton.getLayoutParams();
|
|
|
- layoutParams.width = iconSize;
|
|
|
- layoutParams.height = iconSize;
|
|
|
- mEmojiInputButton.setLayoutParams(layoutParams);
|
|
|
-
|
|
|
- layoutParams = mAudioInputSwitchButton.getLayoutParams();
|
|
|
- layoutParams.width = iconSize;
|
|
|
- layoutParams.height = iconSize;
|
|
|
- mAudioInputSwitchButton.setLayoutParams(layoutParams);
|
|
|
-
|
|
|
- layoutParams = mMoreInputButton.getLayoutParams();
|
|
|
- layoutParams.width = iconSize;
|
|
|
- layoutParams.height = iconSize;
|
|
|
- mMoreInputButton.setLayoutParams(layoutParams);
|
|
|
-
|
|
|
mIsSending = false;
|
|
|
|
|
|
init();
|
|
|
@@ -247,7 +222,6 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
|
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
|
protected void init() {
|
|
|
mAudioInputSwitchButton.setOnClickListener(this);
|
|
|
- mEmojiInputButton.setOnClickListener(this);
|
|
|
mMoreInputButton.setOnClickListener(this);
|
|
|
mSendTextButton.setOnClickListener(this);
|
|
|
mTextInput.addTextChangedListener(this);
|
|
|
@@ -816,13 +790,12 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
|
TUIChatLog.i(TAG,
|
|
|
- "onClick id:" + view.getId() + "|voice_input_switch:" + R.id.voice_input_switch + "|face_btn:" + R.id.face_btn + "|more_btn:" + R.id.more_btn
|
|
|
+ "onClick id:" + view.getId() + "|voice_input_switch:" + R.id.voice_input_switch + "|more_btn:" + R.id.more_btn
|
|
|
+ "|send_btn:" + R.id.send_btn + "|mCurrentState:" + mCurrentState + "|mSendEnable:" + mSendEnable + "|mMoreInputEvent:" + mMoreInputEvent);
|
|
|
if (view.getId() == R.id.voice_input_switch) {
|
|
|
if (mCurrentState == STATE_FACE_INPUT || mCurrentState == STATE_ACTION_INPUT) {
|
|
|
mCurrentState = STATE_VOICE_INPUT;
|
|
|
mInputMoreView.setVisibility(View.GONE);
|
|
|
- mEmojiInputButton.setImageResource(R.drawable.action_face_selector);
|
|
|
} else if (mCurrentState == STATE_SOFT_INPUT) {
|
|
|
mCurrentState = STATE_VOICE_INPUT;
|
|
|
} else {
|
|
|
@@ -840,23 +813,6 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
|
|
|
mTextInput.setVisibility(VISIBLE);
|
|
|
showSoftInput();
|
|
|
}
|
|
|
- } else if (view.getId() == R.id.face_btn) {
|
|
|
- mAudioInputSwitchButton.setImageResource(R.drawable.action_audio_selector);
|
|
|
- if (mCurrentState == STATE_VOICE_INPUT) {
|
|
|
- mCurrentState = STATE_NONE_INPUT;
|
|
|
- mSendAudioButton.setVisibility(GONE);
|
|
|
- mTextInput.setVisibility(VISIBLE);
|
|
|
- }
|
|
|
- if (mCurrentState == STATE_FACE_INPUT) {
|
|
|
- mCurrentState = STATE_SOFT_INPUT;
|
|
|
- mEmojiInputButton.setImageResource(R.drawable.action_face_selector);
|
|
|
- mTextInput.setVisibility(VISIBLE);
|
|
|
- showSoftInput();
|
|
|
- } else {
|
|
|
- mCurrentState = STATE_FACE_INPUT;
|
|
|
- mEmojiInputButton.setImageResource(R.drawable.chat_input_keyboard);
|
|
|
- showFaceViewGroup();
|
|
|
- }
|
|
|
} else if (view.getId() == R.id.more_btn) {
|
|
|
hideSoftInput();
|
|
|
if (mMoreInputEvent instanceof View.OnClickListener) {
|
|
|
@@ -871,7 +827,6 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
|
|
|
showInputMoreLayout();
|
|
|
mCurrentState = STATE_ACTION_INPUT;
|
|
|
mAudioInputSwitchButton.setImageResource(R.drawable.action_audio_selector);
|
|
|
- mEmojiInputButton.setImageResource(R.drawable.action_face_selector);
|
|
|
mSendAudioButton.setVisibility(GONE);
|
|
|
mTextInput.setVisibility(VISIBLE);
|
|
|
}
|
|
|
@@ -925,7 +880,6 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
|
|
|
public void run() {
|
|
|
hideInputMoreLayout();
|
|
|
mAudioInputSwitchButton.setImageResource(R.drawable.action_audio_selector);
|
|
|
- mEmojiInputButton.setImageResource(R.drawable.chat_input_face);
|
|
|
mSendAudioButton.setVisibility(GONE);
|
|
|
mTextInput.setVisibility(VISIBLE);
|
|
|
mTextInput.requestFocus();
|
|
|
@@ -967,7 +921,6 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
|
|
|
hideSoftInput();
|
|
|
mCurrentState = STATE_SOFT_INPUT;
|
|
|
hideInputMoreLayout();
|
|
|
- mEmojiInputButton.setImageResource(R.drawable.action_face_selector);
|
|
|
mAudioInputSwitchButton.setImageResource(R.drawable.action_audio_selector);
|
|
|
mSendAudioButton.setVisibility(GONE);
|
|
|
mTextInput.setVisibility(VISIBLE);
|
|
|
@@ -1366,15 +1319,6 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void disableEmojiInput(boolean disable) {
|
|
|
- mEmojiInputDisable = disable;
|
|
|
- if (disable) {
|
|
|
- mEmojiInputButton.setVisibility(GONE);
|
|
|
- } else {
|
|
|
- mEmojiInputButton.setVisibility(VISIBLE);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
public void disableMoreInput(boolean disable) {
|
|
|
mMoreInputDisable = disable;
|
|
|
if (disable) {
|
|
|
@@ -1481,13 +1425,6 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- protected void showEmojiInputButton(int visibility) {
|
|
|
- if (mEmojiInputDisable) {
|
|
|
- return;
|
|
|
- }
|
|
|
- mEmojiInputButton.setVisibility(visibility);
|
|
|
- }
|
|
|
-
|
|
|
public void clearCustomActionList() {
|
|
|
mInputMoreCustomActionList.clear();
|
|
|
}
|