1.添加巡乐会房间展示

This commit is contained in:
2025-09-25 16:13:51 +08:00
parent a0ecafbbd7
commit 59eeb1415b
37 changed files with 896 additions and 211 deletions

View File

@@ -255,6 +255,21 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
return userInd;
}
private boolean isChock(){
userInd userInfo = getUserInfo();
if (userInfo != null) {
if (userInfo.getIs_can_chat() == 0) {
Toast.makeText(getContext(), "充值不足"+userInfo.getCan_chat_money()+"元,您无法发送消息", Toast.LENGTH_LONG).show();
ARouter.getInstance().build("/modulevocal/RechargeActivity").navigation();
return false;
}
return true;
}
return false;
}
protected void init() {
mAudioInputSwitchButton.setOnClickListener(this);
mEmojiInputButton.setOnClickListener(this);
@@ -266,22 +281,12 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
public boolean onTouch(View view, MotionEvent motionEvent) {
if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
userInd userInfo = getUserInfo();
if (userInfo != null) {
if (userInfo.getIs_can_chat() == 0) {
Toast.makeText(getContext(), "充值不足"+userInfo.getCan_chat_money()+"元,您无法发送消息", Toast.LENGTH_LONG).show();
ARouter.getInstance().build("/modulevocal/RechargeActivity").navigation();
return false;
if (isChock()) {
if (presenter != null) {
presenter.scrollToNewestMessage();
}
showSoftInput();
}
if (presenter != null) {
presenter.scrollToNewestMessage();
}
showSoftInput();
}
return false;
}
@@ -696,65 +701,73 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
"onClick id:" + view.getId() + "|voice_input_switch:" + R.id.voice_input_switch + "|face_btn:" + R.id.face_btn + "|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 {
mCurrentState = STATE_SOFT_INPUT;
}
if (mCurrentState == STATE_VOICE_INPUT) {
mSendAudioButton.setVisibility(VISIBLE);
mTextInput.setVisibility(GONE);
mAudioInputSwitchButton.setImageResource(R.drawable.chat_input_keyboard);
hideInputMoreLayout();
hideSoftInput();
} else {
mAudioInputSwitchButton.setImageResource(R.drawable.action_audio_selector);
mSendAudioButton.setVisibility(GONE);
mTextInput.setVisibility(VISIBLE);
showSoftInput();
if (isChock()) {
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 {
mCurrentState = STATE_SOFT_INPUT;
}
if (mCurrentState == STATE_VOICE_INPUT) {
mSendAudioButton.setVisibility(VISIBLE);
mTextInput.setVisibility(GONE);
mAudioInputSwitchButton.setImageResource(R.drawable.chat_input_keyboard);
hideInputMoreLayout();
hideSoftInput();
} else {
mAudioInputSwitchButton.setImageResource(R.drawable.action_audio_selector);
mSendAudioButton.setVisibility(GONE);
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) {
((View.OnClickListener) mMoreInputEvent).onClick(view);
} else if (mMoreInputEvent instanceof BaseInputFragment) {
showCustomInputMoreFragment();
} else {
if (mCurrentState == STATE_ACTION_INPUT) {
if (isChock()) {
mAudioInputSwitchButton.setImageResource(R.drawable.action_audio_selector);
if (mCurrentState == STATE_VOICE_INPUT) {
mCurrentState = STATE_NONE_INPUT;
mInputMoreView.setVisibility(View.VISIBLE);
} else {
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);
}
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) {
if (isChock()) {
hideSoftInput();
if (mMoreInputEvent instanceof View.OnClickListener) {
((View.OnClickListener) mMoreInputEvent).onClick(view);
} else if (mMoreInputEvent instanceof BaseInputFragment) {
showCustomInputMoreFragment();
} else {
if (mCurrentState == STATE_ACTION_INPUT) {
mCurrentState = STATE_NONE_INPUT;
mInputMoreView.setVisibility(View.VISIBLE);
} else {
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);
}
}
}
} else if (view.getId() == R.id.send_btn) {
sendTextMessage();
if (isChock()) {
sendTextMessage();
}
}
}