1:修改BUG
This commit is contained in:
@@ -2,6 +2,7 @@ package com.tencent.qcloud.tuikit.tuichat.classicui.widget.input;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
@@ -19,10 +20,13 @@ import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
@@ -50,6 +54,7 @@ import com.tencent.qcloud.tuikit.tuichat.bean.InputMoreItem;
|
||||
import com.tencent.qcloud.tuikit.tuichat.bean.ReplyPreviewBean;
|
||||
import com.tencent.qcloud.tuikit.tuichat.bean.message.FileMessageBean;
|
||||
import com.tencent.qcloud.tuikit.tuichat.classicui.interfaces.IChatLayout;
|
||||
import com.tencent.qcloud.tuikit.tuichat.classicui.page.TUIBaseChatFragment;
|
||||
import com.tencent.qcloud.tuikit.tuichat.classicui.widget.input.inputmore.InputMoreFragment;
|
||||
import com.tencent.qcloud.tuikit.tuichat.component.album.AlbumPicker;
|
||||
import com.tencent.qcloud.tuikit.tuichat.component.album.VideoRecorder;
|
||||
@@ -219,6 +224,37 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
|
||||
init();
|
||||
}
|
||||
|
||||
public class userInd{
|
||||
private int is_can_chat;//是否可以私聊,1:可以,0:不可以
|
||||
private int can_chat_money;//需要充值的金额
|
||||
|
||||
public int getIs_can_chat() {
|
||||
return is_can_chat;
|
||||
}
|
||||
|
||||
public void setIs_can_chat(int is_can_chat) {
|
||||
this.is_can_chat = is_can_chat;
|
||||
}
|
||||
|
||||
public int getCan_chat_money() {
|
||||
return can_chat_money;
|
||||
}
|
||||
|
||||
public void setCan_chat_money(int can_chat_money) {
|
||||
this.can_chat_money = can_chat_money;
|
||||
}
|
||||
}
|
||||
private userInd getUserInfo(){
|
||||
SharedPreferences sp = getContext().getSharedPreferences("Vespa", Context.MODE_PRIVATE);
|
||||
String s= sp.getString("userInfo","");
|
||||
if (TextUtils.isEmpty(s)){
|
||||
return null;
|
||||
}
|
||||
Gson Gson = new Gson();
|
||||
userInd userInd =Gson.fromJson(s, userInd.class);
|
||||
return userInd;
|
||||
|
||||
}
|
||||
protected void init() {
|
||||
mAudioInputSwitchButton.setOnClickListener(this);
|
||||
mEmojiInputButton.setOnClickListener(this);
|
||||
@@ -229,6 +265,19 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
|
||||
@Override
|
||||
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 (presenter != null) {
|
||||
presenter.scrollToNewestMessage();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user