修复测试反馈问题
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.shayu.onetoone.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
@@ -17,6 +18,8 @@ import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
@@ -31,6 +34,7 @@ public class EndCallActivity extends AbsOTOActivity {
|
||||
private Button applyButton;
|
||||
private UserBean user;
|
||||
private String timer;
|
||||
private final String TAG="EndCallActivity";
|
||||
|
||||
|
||||
@Override
|
||||
@@ -56,6 +60,9 @@ public class EndCallActivity extends AbsOTOActivity {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
if(StringUtil.isEmpty(timer)){
|
||||
timer=WordUtil.getNewString(R.string.call_time) + "00:00";
|
||||
}
|
||||
ImgLoader.display(mContext, user.getUser().getAvatar(), avatar);
|
||||
ImgLoader.displayBlur(mContext, user.getUser().getAvatar(), findViewById(R.id.bg), 85);
|
||||
usernameView.setText(user.getUser().getUserNicename());
|
||||
@@ -68,7 +75,24 @@ public class EndCallActivity extends AbsOTOActivity {
|
||||
});
|
||||
|
||||
cancelButton.setOnClickListener(v -> {
|
||||
RouteManager.forwardActivity(extras.getString("path"), extras);
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getTargetUserInfo(user.getUser().getId(), new HttpCallback<UserBean>() {
|
||||
@Override
|
||||
public void onSuccess(UserBean data) {
|
||||
if (data.getInfo().getName_auth() == 2) {
|
||||
RouteManager.forwardActivity(extras.getString("path"), extras);
|
||||
} else {
|
||||
ToastUtil.show(R.string.end_resume_call_not_auth);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
Log.e(TAG, "onError: " + error);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
applyButton.setOnClickListener(v -> {
|
||||
});
|
||||
|
||||
@@ -91,7 +91,7 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
View mInputPanel;
|
||||
View numLayout;
|
||||
EditText mEditText;
|
||||
ImageView img, call, video, gift,mEmojiToggleBtn;
|
||||
ImageView img, call, video, gift, mEmojiToggleBtn;
|
||||
ProcessImageUtil cameraUtil;
|
||||
String targetId;
|
||||
Conversation.ConversationType conversationType = Conversation.ConversationType.PRIVATE;
|
||||
@@ -129,7 +129,7 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
initBtn();
|
||||
initChat();
|
||||
initPriceBean();
|
||||
cameraUtil = new ProcessImageUtil(getActivity(), "${packageName}.fileprovider");
|
||||
cameraUtil = new ProcessImageUtil(getActivity(), mContext.getPackageName() + ".fileprovider");
|
||||
|
||||
mRongExtension.setVisibility(View.VISIBLE);
|
||||
// img.setOnClickListener(v -> cameraUtil.getImageByCamera());
|
||||
@@ -214,9 +214,9 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
field.setAccessible(true);
|
||||
mInputPanel = (View) field.get(mRongExtension.getInputPanel());
|
||||
assert mInputPanel != null;
|
||||
field=mRongExtension.getInputPanel().getClass().getDeclaredField("mExtensionViewModel");
|
||||
field = mRongExtension.getInputPanel().getClass().getDeclaredField("mExtensionViewModel");
|
||||
field.setAccessible(true);
|
||||
mExtensionViewModel= (RongExtensionViewModel) field.get(mRongExtension.getInputPanel());
|
||||
mExtensionViewModel = (RongExtensionViewModel) field.get(mRongExtension.getInputPanel());
|
||||
mSendBtn = mInputPanel.getRootView().findViewById(R.id.send_btn);
|
||||
img = mInputPanel.getRootView().findViewById(R.id.input_panel_image_btn);
|
||||
video = mInputPanel.getRootView().findViewById(R.id.input_panel_video_btn);
|
||||
@@ -250,11 +250,11 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
giftPanel.show();
|
||||
});
|
||||
mEmojiToggleBtn.setOnClickListener(v -> {
|
||||
if(mExtensionViewModel.getInputModeLiveData().getValue()==InputMode.TextInput){
|
||||
if (mExtensionViewModel.getInputModeLiveData().getValue() == InputMode.TextInput) {
|
||||
audio.hide();
|
||||
giftPanel.hide();
|
||||
mExtensionViewModel.getInputModeLiveData().setValue(InputMode.EmoticonMode);
|
||||
}else{
|
||||
} else {
|
||||
mExtensionViewModel.getInputModeLiveData().setValue(InputMode.TextInput);
|
||||
}
|
||||
});
|
||||
@@ -303,9 +303,9 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
if(status==1) {
|
||||
if (status == 1) {
|
||||
sendAuthRequest();
|
||||
}else if(!StringUtil.isEmpty(msg)){
|
||||
} else if (!StringUtil.isEmpty(msg)) {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
}
|
||||
@@ -354,9 +354,9 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
if(status==1) {
|
||||
if (status == 1) {
|
||||
sendAuthRequest();
|
||||
}else if(!StringUtil.isEmpty(msg)){
|
||||
} else if (!StringUtil.isEmpty(msg)) {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
}
|
||||
@@ -412,10 +412,12 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
public void onSuccess(UserBean data) {
|
||||
if (data.getInfo().getName_auth() == 2) {
|
||||
listener.onSuccess("", null);
|
||||
} else if(data.getInfo().getName_auth() == 3){
|
||||
} else if (data.getInfo().getName_auth() == 3) {
|
||||
listener.onError(data.getInfo().getName_auth(), "當前正在審核中,請耐心等待");
|
||||
}
|
||||
// listener.onSuccess("", null);
|
||||
AppManager.runDebugCode(()->{
|
||||
listener.onSuccess("", null);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -602,6 +604,11 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
video.setImageResource(R.mipmap.ic_msg_video_lock);
|
||||
call.setTag("true");
|
||||
}
|
||||
AppManager.runDebugCode(()->{
|
||||
call.setTag(null);
|
||||
call.setImageResource(R.mipmap.ic_msg_call);
|
||||
video.setImageResource(R.mipmap.ic_msg_video);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -691,9 +698,9 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
Uri uri;
|
||||
//判断安卓版本小于10
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
|
||||
uri= FileProvider.getUriForFile(mContext,mContext.getPackageName()+".fileprovider",new File(item.getPath()));
|
||||
}else{
|
||||
uri=Uri.parse(item.getPath());
|
||||
uri = FileProvider.getUriForFile(mContext, mContext.getPackageName() + ".fileprovider", new File(item.getPath()));
|
||||
} else {
|
||||
uri = Uri.parse(item.getPath());
|
||||
}
|
||||
ImageMessage imageMessage = ImageMessage.obtain(uri, sendOrigin);
|
||||
Message message = Message.obtain(targetId, conversationType, imageMessage);
|
||||
|
||||
@@ -12,6 +12,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -25,9 +26,12 @@ import com.shayu.onetoone.event.MessageMsgBusEvent;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.yanzhenjie.recyclerview.OnItemMenuClickListener;
|
||||
import com.yanzhenjie.recyclerview.OnItemMenuStateListener;
|
||||
import com.yanzhenjie.recyclerview.SwipeMenu;
|
||||
import com.yanzhenjie.recyclerview.SwipeMenuBridge;
|
||||
import com.yanzhenjie.recyclerview.SwipeMenuCreator;
|
||||
import com.yanzhenjie.recyclerview.SwipeMenuItem;
|
||||
import com.yanzhenjie.recyclerview.SwipeMenuLayout;
|
||||
import com.yanzhenjie.recyclerview.SwipeMenuView;
|
||||
import com.yanzhenjie.recyclerview.SwipeRecyclerView;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
@@ -108,16 +112,17 @@ public class MsgMessageFragment extends BaseFragment implements BaseAdapter.OnIt
|
||||
}
|
||||
|
||||
private class SwipeRunnable {
|
||||
private int menuPosition;
|
||||
private SwipeMenuBridge bridge;
|
||||
private int adapterPosition;
|
||||
|
||||
public SwipeRunnable(int menuPosition, int adapterPosition) {
|
||||
this.menuPosition = menuPosition;
|
||||
public SwipeRunnable(SwipeMenuBridge bridge, int adapterPosition) {
|
||||
this.bridge = bridge;
|
||||
this.adapterPosition = adapterPosition;
|
||||
}
|
||||
}
|
||||
|
||||
private SwipeRunnable swipeRunnable = null;
|
||||
SwipeMenuCreator creator;
|
||||
|
||||
@Override
|
||||
public void initView(View itemView) {
|
||||
@@ -127,14 +132,16 @@ public class MsgMessageFragment extends BaseFragment implements BaseAdapter.OnIt
|
||||
mAdapter = new MsgMessageRecyclerViewAdapter(mList);
|
||||
list = new ArrayList<>();
|
||||
mList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
mList.setSwipeMenuCreator(initSwipeMenuCreator());
|
||||
creator = initSwipeMenuCreator();
|
||||
mList.setSwipeMenuCreator(creator);
|
||||
mList.setHasFixedSize(true);
|
||||
mList.setAutoMarginEnabled(true);
|
||||
mList.setOnItemMenuClickListener(new OnItemMenuClickListener() {
|
||||
@Override
|
||||
public void onItemClick(SwipeMenuBridge menuBridge, int adapterPosition) {
|
||||
swipeRunnable = new SwipeRunnable(menuBridge.getPosition(), adapterPosition);
|
||||
swipeRunnable = new SwipeRunnable(menuBridge, adapterPosition);
|
||||
menuBridge.closeMenu();
|
||||
|
||||
}
|
||||
});
|
||||
mList.setOnItemMenuStateListener(new OnItemMenuStateListener() {
|
||||
@@ -144,11 +151,9 @@ public class MsgMessageFragment extends BaseFragment implements BaseAdapter.OnIt
|
||||
if (menuState == CLOSED && swipeRunnable != null) {
|
||||
mHandler.postDelayed(() -> {
|
||||
BaseUiConversation conversation = mAdapter.getData().get(swipeRunnable.adapterPosition);
|
||||
if (swipeRunnable.menuPosition == 0) {
|
||||
if (swipeRunnable.bridge.getPosition() == 0) {
|
||||
topItem(conversation, swipeRunnable.adapterPosition);
|
||||
top.setText(R.string.untop);
|
||||
} else {
|
||||
top.setText(R.string.top);
|
||||
removeItem(conversation, swipeRunnable.adapterPosition);
|
||||
}
|
||||
swipeRunnable = null;
|
||||
@@ -353,6 +358,7 @@ public class MsgMessageFragment extends BaseFragment implements BaseAdapter.OnIt
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
initSystemNotice();
|
||||
updateUserInfo();
|
||||
if (this.mConversationListViewModel != null) {
|
||||
mConversationListViewModel.getConversationList(false, true, 0L);
|
||||
this.mConversationListViewModel.clearAllNotification();
|
||||
@@ -504,15 +510,17 @@ public class MsgMessageFragment extends BaseFragment implements BaseAdapter.OnIt
|
||||
return false;
|
||||
}
|
||||
|
||||
SwipeMenuItem top=null;
|
||||
SwipeMenuItem del=null;
|
||||
private SwipeMenuCreator initSwipeMenuCreator() {
|
||||
SwipeMenuCreator creator = (leftMenu, rightMenu, position) -> {
|
||||
top = new SwipeMenuItem(getContext());
|
||||
del = new SwipeMenuItem(getContext());
|
||||
SwipeMenuItem top = new SwipeMenuItem(getContext());
|
||||
SwipeMenuItem del = new SwipeMenuItem(getContext());
|
||||
top.setBackgroundColor(Color.parseColor("#D9D9D9"));
|
||||
del.setBackgroundColor(Color.parseColor("#FE5268"));
|
||||
top.setText(R.string.top);
|
||||
if(mAdapter.getItem(position).mCore.isTop()) {
|
||||
top.setText(R.string.untop);
|
||||
}else{
|
||||
top.setText(R.string.top);
|
||||
}
|
||||
del.setText(R.string.delete);
|
||||
top.setHeight(ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
top.setWidth(DpUtil.dp2px(71));
|
||||
@@ -521,7 +529,6 @@ public class MsgMessageFragment extends BaseFragment implements BaseAdapter.OnIt
|
||||
|
||||
rightMenu.addMenuItem(top);
|
||||
rightMenu.addMenuItem(del);
|
||||
|
||||
};
|
||||
return creator;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class CompleteActivity extends AbsOTOActivity {
|
||||
}
|
||||
|
||||
private void initCamera() {
|
||||
cameraUtil = new ProcessImageUtil(this, "${packageName}.fileprovider");
|
||||
cameraUtil = new ProcessImageUtil(this, getPackageName()+".fileprovider");
|
||||
cameraUtil.setImageResultCallback(new ImageResultCallback() {
|
||||
@Override
|
||||
public void beforeCamera() {
|
||||
|
||||
@@ -124,8 +124,8 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
});
|
||||
}
|
||||
initButton(buttonView);
|
||||
if (!StringUtil.isEmpty(callId)) {
|
||||
CallClientManager.getManager().callVideo(callId);
|
||||
if (!StringUtil.isEmpty(targetId)) {
|
||||
CallClientManager.getManager().callVideo(targetId);
|
||||
initWaitView();
|
||||
}
|
||||
}
|
||||
@@ -259,7 +259,7 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
|
||||
private void accept() {
|
||||
callLayout.setVisibility(View.GONE);
|
||||
CallClientManager.getManager().acceptCall(targetId);
|
||||
CallClientManager.getManager().acceptCall(callId);
|
||||
}
|
||||
|
||||
private void closeCamera() {
|
||||
@@ -464,17 +464,19 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
targetView.addView(CallClientManager.getManager().getLocalVideo());
|
||||
myView.addView(buttonView);
|
||||
}
|
||||
|
||||
//
|
||||
@Override
|
||||
public void onCallEnd() {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("model", CallClientManager.VIDEO_CALL);
|
||||
bundle.putString("targetId", targetId);
|
||||
bundle.putString("callId", targetId);
|
||||
bundle.putString("user", JSONObject.toJSONString(userData));
|
||||
bundle.putString("time", callTime.getText().toString());
|
||||
bundle.putString("path", RouteManager.ACTIVITY_CALL_VIDEO);
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_END_CALL, bundle);
|
||||
if(model.equals(CallClientManager.AUDIO_CALL) ||model.equals(CallClientManager.VIDEO_CALL)) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("model", CallClientManager.VIDEO_CALL);
|
||||
bundle.putString("targetId", targetId);
|
||||
bundle.putString("callId", callId);
|
||||
bundle.putString("user", JSONObject.toJSONString(userData));
|
||||
bundle.putString("time", callTime.getText().toString());
|
||||
bundle.putString("path", RouteManager.ACTIVITY_CALL_VIDEO);
|
||||
RouteManager.forwardActivity(RouteManager.ACTIVITY_END_CALL, bundle);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ public class MsgMoreGreetConfigActivity extends AbsOTOActivity {
|
||||
});
|
||||
apply.setOnClickListener(v -> {
|
||||
adapter.notifyDataSetChanged();
|
||||
new Handler(Looper.getMainLooper()).postDelayed(this::save,100);
|
||||
new Handler(Looper.getMainLooper()).postDelayed(this::save, 100);
|
||||
});
|
||||
cancel.setOnClickListener(v -> clearGreet());
|
||||
recyclerView.setOnClickListener(v -> adapter.notifyDataSetChanged());
|
||||
@@ -143,6 +143,8 @@ public class MsgMoreGreetConfigActivity extends AbsOTOActivity {
|
||||
}
|
||||
|
||||
private void clearGreet() {
|
||||
adapter.clear();
|
||||
((ImageView)findViewById(R.id.imageView5)).setImageResource(R.mipmap.ic_msg_more_config_add_image);
|
||||
OTONetManager.getInstance(mContext)
|
||||
.cleanMoreGreetConfig(new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
@@ -152,7 +154,7 @@ public class MsgMoreGreetConfigActivity extends AbsOTOActivity {
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
// ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -191,12 +193,12 @@ public class MsgMoreGreetConfigActivity extends AbsOTOActivity {
|
||||
.getMessageMoreGreetConfig(new HttpCallback<List<GreetBean>>() {
|
||||
@Override
|
||||
public void onSuccess(List<GreetBean> data) {
|
||||
List<GreetBean> list=new ArrayList<>();
|
||||
List<GreetBean> list = new ArrayList<>();
|
||||
for (GreetBean item : data) {
|
||||
if(item.getType()==0){
|
||||
if (item.getType() == 0) {
|
||||
list.add(item);
|
||||
}else if(item.getType()==2){
|
||||
ImgLoader.display(mContext,item.getContent(), (ImageView) findViewById(R.id.imageView5));
|
||||
} else if (item.getType() == 2) {
|
||||
ImgLoader.display(mContext, item.getContent(), (ImageView) findViewById(R.id.imageView5));
|
||||
}
|
||||
}
|
||||
adapter.setList(list);
|
||||
|
||||
@@ -149,7 +149,7 @@ public class AuthActivity extends AbsActivity {
|
||||
}
|
||||
|
||||
private void initCamera() {
|
||||
cameraUtil = new ProcessImageUtil(this, "${packageName}.fileprovider");
|
||||
cameraUtil = new ProcessImageUtil(this, getPackageName()+".fileprovider");
|
||||
cameraUtil.setImageResultCallback(new ImageResultCallback() {
|
||||
@Override
|
||||
public void beforeCamera() {
|
||||
|
||||
@@ -172,7 +172,7 @@ public class AuthBloggerActivity extends AbsActivity {
|
||||
};
|
||||
|
||||
private void initCamera() {
|
||||
cameraUtil = new ProcessImageUtil(this, "${packageName}.fileprovider");
|
||||
cameraUtil = new ProcessImageUtil(this, getPackageName()+".fileprovider");
|
||||
cameraUtil.setImageResultCallback(new ImageResultCallback() {
|
||||
@Override
|
||||
public void beforeCamera() {
|
||||
|
||||
@@ -138,7 +138,7 @@ public class EditProfileActivity extends AbsActivity {
|
||||
}
|
||||
|
||||
private void initCamera() {
|
||||
cameraUtil = new ProcessImageUtil(this, "${packageName}.fileprovider");
|
||||
cameraUtil = new ProcessImageUtil(this, getPackageName()+".fileprovider");
|
||||
cameraUtil.setImageResultCallback(new ImageResultCallback() {
|
||||
@Override
|
||||
public void beforeCamera() {
|
||||
|
||||
Reference in New Issue
Block a user