机器人自动发言
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.views.RobotMessageViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RobotMessageAdapter extends RecyclerView.Adapter {
|
||||
private List<LiveAiRobotBean.Message> messageList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View robotMessageView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_robot_message, parent, false);
|
||||
return new RobotMessageViewHolder(robotMessageView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
RobotMessageViewHolder messageViewHolder = (RobotMessageViewHolder) holder;
|
||||
messageViewHolder.setData(messageList.get(position), position + 1);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return messageList.size();
|
||||
}
|
||||
|
||||
|
||||
public void setDataAll(List<LiveAiRobotBean.Message> messages) {
|
||||
messageList.clear();
|
||||
messageList.addAll(messages);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
// 删除数据
|
||||
public void removeData(int position) {
|
||||
messageList.remove(position);
|
||||
//删除动画
|
||||
notifyItemRemoved(position);
|
||||
}
|
||||
}
|
||||
@@ -15,9 +15,9 @@ public class LiveAiRobotBean extends BaseModel {
|
||||
@SerializedName("ai_time")
|
||||
private int time;
|
||||
@SerializedName("ai_sayhi")
|
||||
private String autoSeyHiNumber;// 自动打招呼已配置数量
|
||||
private int autoSeyHiNumber;// 自动打招呼已配置数量
|
||||
@SerializedName("ai_gz")
|
||||
private String autoRequestFollowNumber;//自动求关注已配置数量
|
||||
private int autoRequestFollowNumber;//自动求关注已配置数量
|
||||
|
||||
public LiveAiRobotBean() {
|
||||
}
|
||||
@@ -46,19 +46,19 @@ public class LiveAiRobotBean extends BaseModel {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public String getAutoSeyHiNumber() {
|
||||
public int getAutoSeyHiNumber() {
|
||||
return autoSeyHiNumber;
|
||||
}
|
||||
|
||||
public void setAutoSeyHiNumber(String autoSeyHiNumber) {
|
||||
public void setAutoSeyHiNumber(int autoSeyHiNumber) {
|
||||
this.autoSeyHiNumber = autoSeyHiNumber;
|
||||
}
|
||||
|
||||
public String getAutoRequestFollowNumber() {
|
||||
public int getAutoRequestFollowNumber() {
|
||||
return autoRequestFollowNumber;
|
||||
}
|
||||
|
||||
public void setAutoRequestFollowNumber(String autoRequestFollowNumber) {
|
||||
public void setAutoRequestFollowNumber(int autoRequestFollowNumber) {
|
||||
this.autoRequestFollowNumber = autoRequestFollowNumber;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class LiveRobotMessageEvent extends BaseModel {
|
||||
private int index = -1;
|
||||
|
||||
public int getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public LiveRobotMessageEvent setIndex(int index) {
|
||||
this.index = index;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -505,7 +505,7 @@ public interface PDLiveApi {
|
||||
* 机器人添加话术
|
||||
*/
|
||||
@GET("/api/public/?service=Live.addAiAutomaticSpeech")
|
||||
Observable<ResponseModel<HttpCallbackModel>> addAiAutomaticSpeech(
|
||||
Observable<ResponseModel<List<String>>> addAiAutomaticSpeech(
|
||||
@Query("type") String type,
|
||||
@Query("content") String content
|
||||
);
|
||||
@@ -514,7 +514,7 @@ public interface PDLiveApi {
|
||||
* 机器人删除话术
|
||||
*/
|
||||
@GET("/api/public/?service=Live.delAiAutomaticSpeech ")
|
||||
Observable<ResponseModel<HttpCallbackModel>> delAiAutomaticSpeech(
|
||||
Observable<ResponseModel<List<String>>> delAiAutomaticSpeech(
|
||||
@Query("type") String type,
|
||||
@Query("id") String id
|
||||
);
|
||||
@@ -523,7 +523,7 @@ public interface PDLiveApi {
|
||||
* 机器人修改话术
|
||||
*/
|
||||
@GET("/api/public/?service=Live.updateAiAutomaticSpeech ")
|
||||
Observable<ResponseModel<HttpCallbackModel>> updateAiAutomaticSpeech(
|
||||
Observable<ResponseModel<List<String>>> updateAiAutomaticSpeech(
|
||||
@Query("type") String type,
|
||||
@Query("id") String id,
|
||||
@Query("content") String content
|
||||
|
||||
@@ -903,6 +903,7 @@ public class LiveNetManager {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getAnchorAiState()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(responseModel.getData().getInfo());
|
||||
@@ -921,6 +922,7 @@ public class LiveNetManager {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.setAnchorAiState(status)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(null);
|
||||
@@ -941,6 +943,7 @@ public class LiveNetManager {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.setAnchorAiState(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(null);
|
||||
@@ -959,6 +962,7 @@ public class LiveNetManager {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getAiAutomaticSpeech(type + "")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(responseModel.getData().getInfo());
|
||||
@@ -977,6 +981,7 @@ public class LiveNetManager {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.addAiAutomaticSpeech(type + "", content)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg()));
|
||||
@@ -995,6 +1000,7 @@ public class LiveNetManager {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.updateAiAutomaticSpeech(type + "", id + "", content)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg()));
|
||||
@@ -1013,6 +1019,7 @@ public class LiveNetManager {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.delAiAutomaticSpeech(type + "", id + "")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(responseModel -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(new HttpCallbackModel(responseModel.getData().getCode(), responseModel.getData().getMsg()));
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.animator.PopupAnimator;
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
/**
|
||||
* 输入弹窗
|
||||
*/
|
||||
public class InputCustomPopup extends CenterPopupView {
|
||||
private String message = "";
|
||||
|
||||
public InputCustomPopup(@NonNull Context context, String message) {
|
||||
super(context);
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public InputCustomPopup(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
// 返回自定义弹窗的布局
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.input_custom_popup;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
EditText content = findViewById(R.id.content);
|
||||
content.setText(message);
|
||||
findViewById(R.id.btn_cancel).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dismiss(); // 关闭弹窗
|
||||
}
|
||||
});
|
||||
findViewById(R.id.btn_confirm).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
String textContent = content.getText().toString();
|
||||
if (TextUtils.isEmpty(textContent)) {
|
||||
ToastUtil.show("输入内容不可为空");
|
||||
return;
|
||||
}
|
||||
if (listener != null) {
|
||||
listener.onConfirm(textContent);
|
||||
}
|
||||
dismiss(); // 关闭弹窗
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 设置最大宽度,看需要而定,
|
||||
@Override
|
||||
protected int getMaxWidth() {
|
||||
return super.getMaxWidth();
|
||||
}
|
||||
|
||||
// 设置最大高度,看需要而定
|
||||
@Override
|
||||
protected int getMaxHeight() {
|
||||
return super.getMaxHeight();
|
||||
}
|
||||
|
||||
// 设置自定义动画器,看需要而定
|
||||
@Override
|
||||
protected PopupAnimator getPopupAnimator() {
|
||||
return super.getPopupAnimator();
|
||||
}
|
||||
|
||||
public interface InputCustomListener {
|
||||
void onConfirm(String text);
|
||||
}
|
||||
|
||||
private InputCustomListener listener;
|
||||
|
||||
public InputCustomPopup setListener(InputCustomListener listener) {
|
||||
this.listener = listener;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.RobotMessageAdapter;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.event.LiveRobotMessageEvent;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class LiveRobotMessageCustomPopup extends BottomPopupView {
|
||||
private static String TAG = "AI机器人";
|
||||
private RecyclerView robotMessages;
|
||||
private RobotMessageAdapter robotMessageAdapter;
|
||||
|
||||
private EditText robotNameSetting;
|
||||
private TextView robotTime;
|
||||
private String robotTimeString = "";
|
||||
|
||||
public LiveRobotMessageCustomPopup(@NonNull Context context, String robotTime) {
|
||||
super(context);
|
||||
this.robotTimeString = robotTime;
|
||||
}
|
||||
|
||||
public LiveRobotMessageCustomPopup(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
// 返回自定义弹窗的布局
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.dialog_live_robot_message;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
Bus.getOn(this);
|
||||
initView();
|
||||
initDate();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onLiveRobotMessageEvent(LiveRobotMessageEvent event) {
|
||||
if (event.getIndex() > 0) {
|
||||
robotMessageAdapter.removeData(event.getIndex());
|
||||
} else {
|
||||
initDate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
Bus.getOff(this);
|
||||
}
|
||||
|
||||
|
||||
private void initView() {
|
||||
robotMessages = (RecyclerView) findViewById(R.id.robot_messages);
|
||||
robotNameSetting = findViewById(R.id.robot_name_setting);
|
||||
robotTime = findViewById(R.id.robot_time);
|
||||
robotMessageAdapter = new RobotMessageAdapter();
|
||||
robotMessages.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
robotMessages.setAdapter(robotMessageAdapter);
|
||||
robotTime.setText(robotTimeString);
|
||||
findViewById(R.id.bt_cancel).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
robotTime.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
robotTime.setVisibility(GONE);
|
||||
robotNameSetting.setVisibility(VISIBLE);
|
||||
robotNameSetting.setText(robotTime.getText().toString());
|
||||
//输入框,获取焦点 不然无法弹出键盘
|
||||
robotNameSetting.requestFocus();
|
||||
//键盘输入法管理器
|
||||
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
imm.showSoftInput(robotNameSetting, 0);
|
||||
}
|
||||
});
|
||||
robotNameSetting.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||
@Override
|
||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||
if (actionId == EditorInfo.IME_ACTION_DONE) {
|
||||
// 修改助手名字
|
||||
LiveNetManager.get(getContext())
|
||||
.setAiRobotDate("ai_time", robotNameSetting.getText().toString(), new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
robotNameSetting.setVisibility(GONE);
|
||||
robotTime.setVisibility(VISIBLE);
|
||||
robotTime.setText(robotNameSetting.getText().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
//添加消息语
|
||||
findViewById(R.id.robot_add_content).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
new XPopup.Builder(getContext())
|
||||
.asCustom(new InputCustomPopup(getContext()).setListener(new InputCustomPopup.InputCustomListener() {
|
||||
@Override
|
||||
public void onConfirm(String text) {
|
||||
//添加消息语
|
||||
LiveNetManager.get(getContext())
|
||||
.addAiRobotBody(LiveAiRobotBean.Message.TYPE_FOLLOW, text, new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
initDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initDate() {
|
||||
|
||||
LiveNetManager.get(getContext())
|
||||
.getAiRobotBody(LiveAiRobotBean.Message.TYPE_FOLLOW, new HttpCallback<List<LiveAiRobotBean.Message>>() {
|
||||
@Override
|
||||
public void onSuccess(List<LiveAiRobotBean.Message> data) {
|
||||
Log.i(TAG, "onSuccess: " + data.size());
|
||||
for (LiveAiRobotBean.Message message : data) {
|
||||
Log.i(TAG, "onSuccess: message=" + message.toString());
|
||||
}
|
||||
robotMessageAdapter.setDataAll(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.BasePopupView;
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.lxj.xpopup.interfaces.XPopupCallback;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class LiveRobotSettingCustomPopup extends BottomPopupView implements View.OnClickListener {
|
||||
private static String TAG = "AI机器人";
|
||||
private EditText robotNameSetting;
|
||||
private AppCompatTextView automaticGreetingNumber, automaticMessageNumber;
|
||||
private TextView robotNameText;
|
||||
private String time = "";
|
||||
|
||||
public LiveRobotSettingCustomPopup(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
// 返回自定义弹窗的布局
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.dialog_live_robot_setting;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
intiView();
|
||||
initDate();
|
||||
}
|
||||
|
||||
private void intiView() {
|
||||
robotNameSetting = findViewById(R.id.robot_name_setting);
|
||||
robotNameText = findViewById(R.id.robot_name_text);
|
||||
automaticGreetingNumber = findViewById(R.id.automatic_greeting_number);
|
||||
automaticMessageNumber = findViewById(R.id.automatic_message_number);
|
||||
findViewById(R.id.automatic_message_sending).setOnClickListener(this);
|
||||
robotNameText.setOnClickListener(this);
|
||||
robotNameSetting.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||
@Override
|
||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||
if (actionId == EditorInfo.IME_ACTION_DONE) {
|
||||
// 修改助手名字
|
||||
LiveNetManager.get(getContext())
|
||||
.setAiRobotDate("ai_name", robotNameSetting.getText().toString(), new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
robotNameSetting.setVisibility(GONE);
|
||||
robotNameText.setVisibility(VISIBLE);
|
||||
robotNameText.setText(robotNameSetting.getText().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int viewID = v.getId();
|
||||
if (viewID == R.id.automatic_message_sending) {
|
||||
new XPopup.Builder(getContext())
|
||||
.setPopupCallback(new XPopupCallback() {
|
||||
@Override
|
||||
public void onCreated(BasePopupView popupView) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeShow(BasePopupView popupView) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShow(BasePopupView popupView) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(BasePopupView popupView) {
|
||||
initDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeDismiss(BasePopupView popupView) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBackPressed(BasePopupView popupView) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKeyBoardStateChanged(BasePopupView popupView, int height) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDrag(BasePopupView popupView, int value, float percent, boolean upOrLeft) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickOutside(BasePopupView popupView) {
|
||||
|
||||
}
|
||||
})
|
||||
.asCustom(new LiveRobotMessageCustomPopup(getContext(), time))
|
||||
.show();
|
||||
} else if (viewID == R.id.robot_name_text) {
|
||||
robotNameText.setVisibility(GONE);
|
||||
robotNameSetting.setVisibility(VISIBLE);
|
||||
robotNameSetting.setText(robotNameText.getText().toString());
|
||||
//输入框,获取焦点 不然无法弹出键盘
|
||||
robotNameSetting.requestFocus();
|
||||
//键盘输入法管理器
|
||||
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
imm.showSoftInput(robotNameSetting, 0);
|
||||
}
|
||||
}
|
||||
|
||||
private void initDate() {
|
||||
LiveNetManager.get(getContext())
|
||||
.getAiRobotStatus(new com.yunbao.common.http.base.HttpCallback<LiveAiRobotBean>() {
|
||||
@Override
|
||||
public void onSuccess(LiveAiRobotBean data) {
|
||||
robotNameText.setText(data.getName());
|
||||
automaticGreetingNumber.setText(String.valueOf(data.getAutoSeyHiNumber()));
|
||||
automaticMessageNumber.setText(String.valueOf(data.getAutoRequestFollowNumber()));
|
||||
time = String.valueOf(data.getTime());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
|
||||
initListType1();
|
||||
initListType2();
|
||||
}
|
||||
|
||||
|
||||
private void initListType1() {
|
||||
LiveNetManager.get(getContext())
|
||||
.getAiRobotBody(LiveAiRobotBean.Message.TYPE_SAY_HI, new HttpCallback<List<LiveAiRobotBean.Message>>() {
|
||||
@Override
|
||||
public void onSuccess(List<LiveAiRobotBean.Message> data) {
|
||||
Log.i(TAG, "onSuccess 自动打招呼 : " + data.size());
|
||||
for (LiveAiRobotBean.Message message : data) {
|
||||
Log.i(TAG, "onSuccess: message=" + message.toString());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initListType2() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.LiveAiRobotBean;
|
||||
import com.yunbao.common.event.LiveRobotMessageEvent;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
|
||||
public class RobotMessageViewHolder extends RecyclerView.ViewHolder {
|
||||
private TextView serialNumber, messageText;
|
||||
private ImageView btnDelete;
|
||||
|
||||
public RobotMessageViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
serialNumber = itemView.findViewById(R.id.serial_number);
|
||||
messageText = itemView.findViewById(R.id.message_text);
|
||||
btnDelete = itemView.findViewById(R.id.btn_delete);
|
||||
}
|
||||
|
||||
public void setData(LiveAiRobotBean.Message message, int index) {
|
||||
serialNumber.setText(String.valueOf(index));
|
||||
messageText.setText(message.getContent());
|
||||
btnDelete.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
LiveNetManager.get(itemView.getContext())
|
||||
.delAiRobotBody(LiveAiRobotBean.Message.TYPE_FOLLOW, message.getId(), new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
Bus.get().post(new LiveRobotMessageEvent().setIndex(index - 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
messageText.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
new XPopup.Builder(itemView.getContext())
|
||||
.asCustom(new InputCustomPopup(itemView.getContext(), message.getContent()).setListener(new InputCustomPopup.InputCustomListener() {
|
||||
@Override
|
||||
public void onConfirm(String text) {
|
||||
LiveNetManager.get(itemView.getContext())
|
||||
.updateAiRobotBody(LiveAiRobotBean.Message.TYPE_FOLLOW, message.getId(), text, new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
Bus.get().post(new LiveRobotMessageEvent());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
9
common/src/main/res/drawable/background_81c16d.xml
Normal file
9
common/src/main/res/drawable/background_81c16d.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="11.67dp" />
|
||||
<solid android:color="#81C16D" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
9
common/src/main/res/drawable/bg_prank_coin.xml
Normal file
9
common/src/main/res/drawable/bg_prank_coin.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="96dp" android:height="27dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#ff181d29" />
|
||||
<corners android:topLeftRadius="8dp" android:topRightRadius="8dp" android:bottomLeftRadius="8dp" android:bottomRightRadius="8dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
174
common/src/main/res/layout/dialog_live_robot_message.xml
Normal file
174
common/src/main/res/layout/dialog_live_robot_message.xml
Normal file
@@ -0,0 +1,174 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="400dp"
|
||||
android:background="#000002">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/line1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bt_cancel"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="5.33dp"
|
||||
android:layout_marginTop="7.76dp"
|
||||
android:layout_marginBottom="6.33dp"
|
||||
android:src="@mipmap/icon_back" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="6.67dp"
|
||||
android:text="@string/automatic_message_sending"
|
||||
android:textColor="#CCCCCC"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/robot_add_content"
|
||||
android:layout_width="67.67dp"
|
||||
android:layout_height="23.33dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="11dp"
|
||||
android:background="@drawable/background_81c16d"
|
||||
android:gravity="center"
|
||||
android:text="@string/robot_add_content"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="10sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/line2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/line1"
|
||||
android:layout_marginStart="10.33dp"
|
||||
android:layout_marginEnd="10.67dp"
|
||||
android:background="@drawable/bg_prank_coin"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="8.67dp"
|
||||
android:paddingBottom="7.67dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="26dp"
|
||||
android:layout_height="26dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="13.67dp"
|
||||
android:src="@mipmap/icon_tip" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="8.33dp"
|
||||
android:text="@string/robot_add_content_hint1"
|
||||
android:textColor="#CCCCCC"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="8.33dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/robot_add_content_hint2"
|
||||
android:textColor="#CCCCCC"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/robot_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/line2"
|
||||
android:layout_marginTop="11dp"
|
||||
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:text="@string/robot_automatic_speech_interval"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="3.67dp"
|
||||
android:text="@string/robot_minimum_interval"
|
||||
android:textColor="#B3B3B3"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/robot_time"
|
||||
android:layout_width="96dp"
|
||||
android:layout_height="27dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:background="@drawable/bg_prank_coin"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/robot_name_setting"
|
||||
android:layout_width="96dp"
|
||||
android:layout_height="27dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:background="@drawable/bg_prank_coin"
|
||||
android:gravity="center"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="number"
|
||||
android:maxLines="1"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/robot_messages"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/robot_name" />
|
||||
</RelativeLayout>
|
||||
264
common/src/main/res/layout/dialog_live_robot_setting.xml
Normal file
264
common/src/main/res/layout/dialog_live_robot_setting.xml
Normal file
@@ -0,0 +1,264 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#000"
|
||||
android:paddingBottom="23dp">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:text="@string/speech_robot_setup"
|
||||
android:textColor="#CCCCCC"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/robot_status"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/textView6"
|
||||
android:layout_marginTop="18dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/robot_switch"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="46dp"
|
||||
android:layout_height="23dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
app:srcCompat="@mipmap/special_icon_off" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/robot_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/robot_status"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:text="@string/robot_name_setting"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="3.67dp"
|
||||
android:text="@string/word_limit"
|
||||
android:textColor="#B3B3B3"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<EditText
|
||||
android:id="@+id/robot_name_setting"
|
||||
android:layout_width="96dp"
|
||||
android:layout_height="27dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:background="@drawable/bg_prank_coin"
|
||||
android:gravity="center"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/robot_name_text"
|
||||
android:layout_width="96dp"
|
||||
android:layout_height="27dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:background="@drawable/bg_prank_coin"
|
||||
android:gravity="center"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="12sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/robot_say_hello"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/robot_name"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:text="@string/automatic_greeting_setting"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="3.67dp"
|
||||
android:text="@string/configured_items"
|
||||
android:textColor="#B3B3B3"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/automatic_greeting_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4.67dp"
|
||||
android:layout_marginTop="3.67dp"
|
||||
android:textColor="#00B8EB"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="96dp"
|
||||
android:layout_height="27dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:background="@drawable/bg_robot_shape"
|
||||
android:gravity="center"
|
||||
android:text="@string/robot_go_setting"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="12sp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/robot_message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/robot_say_hello"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:text="@string/automatic_message_sending"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="3.67dp"
|
||||
android:text="@string/configured_items"
|
||||
android:textColor="#B3B3B3"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/automatic_message_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4.67dp"
|
||||
android:layout_marginTop="3.67dp"
|
||||
android:textColor="#00B8EB"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/automatic_message_sending"
|
||||
android:layout_width="96dp"
|
||||
android:layout_height="27dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:background="@drawable/bg_robot_shape"
|
||||
android:gravity="center"
|
||||
android:text="@string/robot_go_setting"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="12sp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/robot_message"
|
||||
android:layout_marginStart="10.33dp"
|
||||
android:layout_marginTop="29dp"
|
||||
android:layout_marginEnd="10.67dp"
|
||||
android:background="@drawable/bg_prank_coin"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="8.67dp"
|
||||
android:paddingBottom="7.67dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="13.67dp"
|
||||
android:src="@mipmap/icon_tip" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="8.33dp"
|
||||
android:text="@string/robot_hint"
|
||||
android:textColor="#CCCCCC"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
69
common/src/main/res/layout/input_custom_popup.xml
Normal file
69
common/src/main/res/layout/input_custom_popup.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_dialog"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/dialog_tip"
|
||||
android:textColor="#161616"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@drawable/bg_dialog_input"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginBottom="23dp"
|
||||
android:gravity="center">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_cancel"
|
||||
android:layout_width="87dp"
|
||||
android:layout_height="33dp"
|
||||
android:layout_marginRight="7dp"
|
||||
android:background="@mipmap/tipbox_btn_gray"
|
||||
android:gravity="center"
|
||||
android:text="@string/cancel"
|
||||
android:textColor="#B1B1B1"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_confirm"
|
||||
|
||||
android:layout_width="87dp"
|
||||
android:layout_height="33dp"
|
||||
android:layout_marginLeft="7dp"
|
||||
android:background="@mipmap/tipbox_btn_orange"
|
||||
android:gravity="center"
|
||||
android:text="@string/confirm"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
43
common/src/main/res/layout/view_robot_message.xml
Normal file
43
common/src/main/res/layout/view_robot_message.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_prank_coin">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/serial_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="13dp"
|
||||
android:text="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="19dp"
|
||||
android:text="测试文字"
|
||||
android:textColor="#80CEF2"
|
||||
android:textSize="13sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_delete"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="9dp"
|
||||
android:layout_marginEnd="10.67dp"
|
||||
android:src="@mipmap/icon_close" />
|
||||
</LinearLayout>
|
||||
BIN
common/src/main/res/mipmap-xxhdpi/icon_close.png
Normal file
BIN
common/src/main/res/mipmap-xxhdpi/icon_close.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
Reference in New Issue
Block a user