update
This commit is contained in:
parent
ebeb276bb1
commit
be02488180
@ -163,6 +163,9 @@
|
||||
<activity
|
||||
android:name=".activity.MatchingActivity"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize"/>
|
||||
<activity
|
||||
android:name=".activity.EndCallActivity"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize"/>
|
||||
|
||||
|
||||
<activity
|
||||
|
@ -0,0 +1,94 @@
|
||||
package com.shayu.onetoone.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activity.AbsOTOActivity;
|
||||
import com.shayu.onetoone.bean.FollowBean;
|
||||
import com.shayu.onetoone.bean.UserBean;
|
||||
import com.shayu.onetoone.listener.OnDialogClickListener;
|
||||
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.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
@Route(path = RouteManager.ACTIVITY_END_CALL)
|
||||
public class EndCallActivity extends AbsOTOActivity {
|
||||
private RoundedImageView avatar;
|
||||
private TextView titleView;
|
||||
private TextView usernameView;
|
||||
private Button followButton;
|
||||
private Button callTimerButton;
|
||||
private Button cancelButton;
|
||||
private Button applyButton;
|
||||
private UserBean user;
|
||||
private String timer;
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.dialog_end_call;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main(Bundle savedInstanceState) {
|
||||
titleView = findViewById(R.id.title);
|
||||
usernameView = findViewById(R.id.username);
|
||||
followButton = findViewById(R.id.follow);
|
||||
callTimerButton = findViewById(R.id.call_timer);
|
||||
cancelButton = findViewById(R.id.cancel);
|
||||
applyButton = findViewById(R.id.apply);
|
||||
avatar = findViewById(R.id.avatar);
|
||||
|
||||
Bundle extras = getIntent().getExtras();
|
||||
|
||||
user = JSONObject.parseObject(extras.getString("user"), UserBean.class);
|
||||
timer = extras.getString("time");
|
||||
if (user == null || timer == null) {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
ImgLoader.display(mContext, user.getUser().getAvatar(), avatar);
|
||||
ImgLoader.displayBlur(mContext, user.getUser().getAvatar(), findViewById(R.id.bg), 45);
|
||||
usernameView.setText(user.getUser().getUserNicename());
|
||||
callTimerButton.setText(timer);
|
||||
if (user.getUser().isFollow()) {
|
||||
followButton.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
followButton.setOnClickListener(view -> {
|
||||
follow();
|
||||
});
|
||||
|
||||
cancelButton.setOnClickListener(v -> {
|
||||
RouteManager.forwardActivity(extras.getString("path"), extras);
|
||||
});
|
||||
applyButton.setOnClickListener(v -> {
|
||||
});
|
||||
findViewById(R.id.close).setOnClickListener(v -> finish());
|
||||
}
|
||||
|
||||
private void follow() {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.follow(user.getUser().getId() + "", new HttpCallback<FollowBean>() {
|
||||
@Override
|
||||
public void onSuccess(FollowBean data) {
|
||||
ToastUtil.show(WordUtil.getNewString(R.string.system_tip_success));
|
||||
followButton.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -76,7 +76,7 @@ public class HomeSearchActivity extends AbsOTOActivity {
|
||||
|
||||
searchBtn.setOnClickListener(v -> search(edit.getText().toString()));
|
||||
|
||||
edit.setText(getIntent().getBundleExtra("bundle").getString("search"));
|
||||
edit.setText(getIntent().getExtras().getString("search"));
|
||||
search(edit.getText().toString());
|
||||
refresh();
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ public class MatchingActivity extends AbsOTOActivity {
|
||||
}
|
||||
}).showDialog();
|
||||
});
|
||||
Bundle bundle = getIntent().getBundleExtra("bundle");
|
||||
Bundle bundle = getIntent().getExtras();
|
||||
if (bundle != null) {
|
||||
String data = bundle.getString("data");
|
||||
bundle.putInt("type",ChatActivity.CALL_CHAT_TYPE_MATCH);
|
||||
|
@ -25,6 +25,7 @@ import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.adapter.MsgChatMessageListAdapter;
|
||||
import com.shayu.onetoone.bean.FollowBean;
|
||||
import com.shayu.onetoone.bean.GiftBean;
|
||||
import com.shayu.onetoone.bean.MessageChatAuthContent;
|
||||
import com.shayu.onetoone.bean.MessageChatTipsContent;
|
||||
import com.shayu.onetoone.bean.MessageConsumeConfigBean;
|
||||
@ -46,6 +47,7 @@ import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.interfaces.ImageResultCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.ProcessImageUtil;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
@ -197,6 +199,16 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
assert mVoiceToggleBtn != null;
|
||||
audio = new MsgInputPanelForAudio(targetId, getActivity(), mRongExtension);
|
||||
giftPanel = new MsgInputPanelForGift(targetId, getActivity(), mRongExtension);
|
||||
giftPanel.setOnItemClickListener(new OnItemClickListener<GiftBean>() {
|
||||
@Override
|
||||
public void onItemClick(GiftBean bean, int position) {
|
||||
if(call.getTag()!=null){
|
||||
call.setTag(null);
|
||||
call.setImageResource(R.mipmap.ic_msg_call);
|
||||
video.setImageResource(R.mipmap.ic_msg_video);
|
||||
}
|
||||
}
|
||||
});
|
||||
mVoiceToggleBtn.setOnClickListener(view -> {
|
||||
audio.show();
|
||||
});
|
||||
@ -206,6 +218,9 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
});
|
||||
|
||||
video.setOnClickListener(v -> {
|
||||
if(call.getTag()!=null){
|
||||
return;
|
||||
}
|
||||
checkAuth(new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
@ -252,6 +267,9 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
});
|
||||
});
|
||||
call.setOnClickListener(v -> {
|
||||
if(call.getTag()!=null){
|
||||
return;
|
||||
}
|
||||
checkAuth(new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token,SendConsumeBean bean) {
|
||||
@ -526,7 +544,11 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
} else {
|
||||
sex.setImageResource(R.mipmap.ic_message_tab_woman);
|
||||
}
|
||||
|
||||
System.out.println("同性別:"+data.getUser().getSex()+"|"+IMLoginManager.get(mContext).getUserInfo().getSex());
|
||||
if(data.getUser().getSex()== IMLoginManager.get(mContext).getUserInfo().getSex()){
|
||||
call.setVisibility(View.GONE);
|
||||
video.setVisibility(View.GONE);
|
||||
}
|
||||
switch (Integer.parseInt(data.getUser().getOnline())) {
|
||||
case 0:
|
||||
status.setImageResource(R.mipmap.ic_message_msg_status_online);
|
||||
@ -540,6 +562,11 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
if (data.getUser().isFollow()) {
|
||||
follow.setVisibility(View.GONE);
|
||||
}
|
||||
if(data.getGiftNum()==0){
|
||||
call.setImageResource(R.mipmap.ic_msg_call_lock);
|
||||
video.setImageResource(R.mipmap.ic_msg_video_lock);
|
||||
call.setTag("true");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -66,7 +66,7 @@ public class CallAudioActivity extends AbsOTOActivity implements View.OnClickLis
|
||||
@Override
|
||||
protected void main(Bundle savedInstanceState) {
|
||||
|
||||
Bundle bundle = getIntent().getBundleExtra("bundle");
|
||||
Bundle bundle = getIntent().getExtras();
|
||||
if (bundle == null) {
|
||||
finish();
|
||||
return;
|
||||
@ -132,11 +132,14 @@ public class CallAudioActivity extends AbsOTOActivity implements View.OnClickLis
|
||||
|
||||
}
|
||||
|
||||
UserBean userData;
|
||||
|
||||
private void initTargetData() {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getTargetUserInfo(Integer.parseInt(targetId), new HttpCallback<UserBean>() {
|
||||
@Override
|
||||
public void onSuccess(UserBean data) {
|
||||
userData = data;
|
||||
userName.setText(data.getUser().getUserNicename());
|
||||
userInfo.setText(data.getUser().getSignature());
|
||||
ImgLoader.display(mContext, data.getUser().getAvatar(), avatar);
|
||||
@ -167,7 +170,8 @@ public class CallAudioActivity extends AbsOTOActivity implements View.OnClickLis
|
||||
.setTargetId(targetId)
|
||||
.showDialog();
|
||||
}
|
||||
private void follow(){
|
||||
|
||||
private void follow() {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.follow(targetId, new HttpCallback<FollowBean>() {
|
||||
@Override
|
||||
@ -185,7 +189,7 @@ public class CallAudioActivity extends AbsOTOActivity implements View.OnClickLis
|
||||
|
||||
private void showWindow(boolean toChatView) {
|
||||
ImageView icon = new ImageView(mContext);
|
||||
icon.setTag(getIntent().getBundleExtra("bundle"));
|
||||
icon.setTag(getIntent().getExtras());
|
||||
icon.setImageResource(io.rong.callkit.R.drawable.rc_voip_audio_answer_selector_new);
|
||||
icon.setLayoutParams(new ViewGroup.LayoutParams(DpUtil.dp2px(40), DpUtil.dp2px(40)));
|
||||
finish();
|
||||
@ -347,7 +351,7 @@ public class CallAudioActivity extends AbsOTOActivity implements View.OnClickLis
|
||||
showGift();
|
||||
} else if (id == R.id.close) {
|
||||
showWindow(false);
|
||||
}else if(id ==R.id.follow){
|
||||
} else if (id == R.id.follow) {
|
||||
follow();
|
||||
}
|
||||
}
|
||||
|
@ -1,21 +1,13 @@
|
||||
package com.shayu.onetoone.activity.message;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.SurfaceView;
|
||||
import android.view.TextureView;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
@ -23,6 +15,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.BasePopupView;
|
||||
import com.lzf.easyfloat.EasyFloat;
|
||||
@ -34,7 +27,6 @@ import com.shayu.onetoone.activity.AbsOTOActivity;
|
||||
import com.shayu.onetoone.bean.FollowBean;
|
||||
import com.shayu.onetoone.bean.UserBean;
|
||||
import com.shayu.onetoone.dialog.GiftDialog;
|
||||
import com.shayu.onetoone.dialog.MsgChatClickDialog;
|
||||
import com.shayu.onetoone.dialog.TipsTextDialog;
|
||||
import com.shayu.onetoone.listener.OnCallStatusListener;
|
||||
import com.shayu.onetoone.manager.CallClientManager;
|
||||
@ -49,14 +41,7 @@ import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
|
||||
import io.rong.calllib.CallUserProfile;
|
||||
import io.rong.calllib.IRongCallListener;
|
||||
import io.rong.calllib.RongCallClient;
|
||||
import io.rong.calllib.RongCallCommon;
|
||||
import io.rong.calllib.RongCallSession;
|
||||
import io.rong.calllib.StartIncomingPreviewCallback;
|
||||
|
||||
@Route(path = RouteManager.ACTIVITY_CALL_VIDEO)
|
||||
@ -103,7 +88,7 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
protected void main(Bundle savedInstanceState) {
|
||||
initView();
|
||||
|
||||
Bundle bundle = getIntent().getBundleExtra("bundle");
|
||||
Bundle bundle = getIntent().getExtras();
|
||||
if (bundle == null) {
|
||||
finish();
|
||||
return;
|
||||
@ -248,7 +233,7 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
}
|
||||
|
||||
private void showWindow(boolean toChatView) {
|
||||
CallClientManager.getManager().getRemoteVideo().setTag(getIntent().getBundleExtra("bundle"));
|
||||
CallClientManager.getManager().getRemoteVideo().setTag(getIntent().getExtras());
|
||||
myView.removeAllViews();
|
||||
targetView.removeAllViews();
|
||||
finish();
|
||||
@ -308,12 +293,15 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
}
|
||||
}
|
||||
|
||||
UserBean userData;
|
||||
|
||||
private void initTargetData() {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getTargetUserInfo(Integer.parseInt(targetId), new HttpCallback<UserBean>() {
|
||||
@Override
|
||||
public void onSuccess(UserBean data) {
|
||||
ImgLoader.display(mContext, data.getUser().getAvatar(), avatar);
|
||||
userData = data;
|
||||
if (data.getUser().isFollow()) {
|
||||
follow.setVisibility(View.GONE);
|
||||
} else {
|
||||
@ -404,6 +392,14 @@ public class CallVideoActivity extends AbsOTOActivity {
|
||||
|
||||
@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);
|
||||
finish();
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,7 @@ public class UserBean extends BaseModel {
|
||||
IMLoginModel user;
|
||||
UserInfo info;
|
||||
UserLevel level;
|
||||
int giftNum;
|
||||
|
||||
int status; //0 需要跳转到 编辑资料页面
|
||||
|
||||
@ -46,6 +47,14 @@ public class UserBean extends BaseModel {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public int getGiftNum() {
|
||||
return giftNum;
|
||||
}
|
||||
|
||||
public void setGiftNum(int giftNum) {
|
||||
this.giftNum = giftNum;
|
||||
}
|
||||
|
||||
public static class UserInfo {
|
||||
private int id;
|
||||
private String label_id;
|
||||
|
@ -38,6 +38,7 @@ public class RouteManager {
|
||||
|
||||
//达人认证入口
|
||||
public static final String ACTIVITY_AUTH_BLOGGER_INLET = "/activity/AuthBloggerInletActivity";
|
||||
public static final String ACTIVITY_END_CALL="/activity/EndCallActivity";
|
||||
|
||||
|
||||
/**
|
||||
@ -116,7 +117,7 @@ public class RouteManager {
|
||||
}
|
||||
|
||||
public static void forwardActivity(String path, Bundle bundle) {
|
||||
ARouter.getInstance().build(path).withBundle("bundle", bundle).navigation();
|
||||
ARouter.getInstance().build(path).with( bundle).navigation();
|
||||
}
|
||||
public static void forwardActivity(String path, Serializable serializable) {
|
||||
ARouter.getInstance().build(path).withSerializable("data", serializable).navigation();
|
||||
|
@ -155,7 +155,7 @@ public interface OneToOneApi {
|
||||
@GET("/api/public/?service=Friendappmoney.info")
|
||||
Observable<ResponseModel<PurseBean>> getPurseInfo();
|
||||
|
||||
@GET("/api/public/?service=User.setAttents")
|
||||
@GET("/api/public/?service=Friendappuser.follow")
|
||||
Observable<ResponseModel<List<FollowBean>>> follow(@Query("touid") String toUid);
|
||||
|
||||
/**
|
||||
|
@ -7,13 +7,24 @@ import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.MessageChatAuthContent;
|
||||
import com.shayu.onetoone.bean.SendConsumeBean;
|
||||
import com.shayu.onetoone.bean.UserBean;
|
||||
import com.shayu.onetoone.dialog.BottomListDialog;
|
||||
import com.shayu.onetoone.dialog.TipsDialog;
|
||||
import com.shayu.onetoone.listener.OnSendMessageListener;
|
||||
import com.shayu.onetoone.manager.CallClientManager;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.callkit.CallEndMessageItemProvider;
|
||||
@ -22,9 +33,14 @@ import io.rong.calllib.RongCallClient;
|
||||
import io.rong.calllib.RongCallCommon;
|
||||
import io.rong.calllib.RongCallSession;
|
||||
import io.rong.calllib.message.CallSTerminateMessage;
|
||||
import io.rong.imkit.IMCenter;
|
||||
import io.rong.imkit.model.UiMessage;
|
||||
import io.rong.imkit.widget.adapter.IViewProviderListener;
|
||||
import io.rong.imkit.widget.adapter.ViewHolder;
|
||||
import io.rong.imlib.IRongCallback;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.imlib.model.MessageContent;
|
||||
|
||||
public class OTOCallEndMessageItemProvider extends CallEndMessageItemProvider {
|
||||
@ -66,19 +82,35 @@ public class OTOCallEndMessageItemProvider extends CallEndMessageItemProvider {
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
RongCallCommon.CallMediaType mediaType = callSTerminateMessage.getMediaType();
|
||||
String action = null;
|
||||
Bundle bundle = new Bundle();
|
||||
if (mediaType.equals(RongCallCommon.CallMediaType.VIDEO)) {
|
||||
action = RouteManager.ACTIVITY_CALL_VIDEO;
|
||||
bundle.putString("model", CallClientManager.VIDEO_CALL);
|
||||
} else {
|
||||
action = RouteManager.ACTIVITY_CALL_AUDIO;
|
||||
bundle.putString("model", CallClientManager.AUDIO_CALL);
|
||||
}
|
||||
bundle.putString("targetId", uiMessage.getMessage().getTargetId());
|
||||
bundle.putString("callId", uiMessage.getMessage().getTargetId());
|
||||
RouteManager.forwardActivity(action, bundle);
|
||||
|
||||
|
||||
checkAuth(uiMessage.getMessage().getTargetId(), new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token, SendConsumeBean bean) {
|
||||
super.onSuccess(token, bean);
|
||||
RongCallCommon.CallMediaType mediaType = callSTerminateMessage.getMediaType();
|
||||
String action = null;
|
||||
Bundle bundle = new Bundle();
|
||||
if (mediaType.equals(RongCallCommon.CallMediaType.VIDEO)) {
|
||||
action = RouteManager.ACTIVITY_CALL_VIDEO;
|
||||
bundle.putString("model", CallClientManager.VIDEO_CALL);
|
||||
} else {
|
||||
action = RouteManager.ACTIVITY_CALL_AUDIO;
|
||||
bundle.putString("model", CallClientManager.AUDIO_CALL);
|
||||
}
|
||||
bundle.putString("targetId", uiMessage.getMessage().getTargetId());
|
||||
bundle.putString("callId", uiMessage.getMessage().getTargetId());
|
||||
RouteManager.forwardActivity(action, bundle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
sendAuthRequest(uiMessage.getMessage().getTargetId());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -97,4 +129,43 @@ public class OTOCallEndMessageItemProvider extends CallEndMessageItemProvider {
|
||||
return new SpannableString(context.getString(R.string.rc_voip_message_video));
|
||||
}
|
||||
}
|
||||
|
||||
private void checkAuth(String targetId, OnSendMessageListener listener) {
|
||||
OTONetManager.getInstance(null)
|
||||
.getTargetUserInfo(Integer.parseInt(targetId), new HttpCallback<UserBean>() {
|
||||
@Override
|
||||
public void onSuccess(UserBean data) {
|
||||
if (data.getInfo().getName_auth() == 1) {
|
||||
listener.onError(0, "");
|
||||
} else {
|
||||
listener.onSuccess("", null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
Log.e(TAG, "onError: " + error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void sendAuthRequest(String targetId) {
|
||||
MessageChatAuthContent content = MessageChatAuthContent.obtain("");
|
||||
IMCenter.getInstance().sendMessage(Message.obtain(targetId, Conversation.ConversationType.PRIVATE, content), null, null, new IRongCallback.ISendMessageCallback() {
|
||||
@Override
|
||||
public void onAttached(Message message) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(Message message) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Message message, RongIMClient.ErrorCode errorCode) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ import com.shayu.onetoone.widget.PagerConfig;
|
||||
import com.shayu.onetoone.widget.PagerGridLayoutManager;
|
||||
import com.shayu.onetoone.widget.PagerGridSnapHelper;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
@ -42,6 +43,7 @@ public class MsgInputPanelForGift extends AbsInputPanel {
|
||||
Button topUpBtn;
|
||||
Button sendBtn;
|
||||
String token;
|
||||
private OnItemClickListener<GiftBean> onItemClickListener;
|
||||
|
||||
public MsgInputPanelForGift(String targetId, FragmentActivity fragmentActivity, RongExtension mRongExtension) {
|
||||
super(targetId, fragmentActivity, mRongExtension, R.layout.view_message_input_gift);
|
||||
@ -52,6 +54,10 @@ public class MsgInputPanelForGift extends AbsInputPanel {
|
||||
return super.show();
|
||||
}
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener<GiftBean> onItemClickListener) {
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(View viewGroup) {
|
||||
gifList = viewGroup.findViewById(R.id.gift_list);
|
||||
@ -103,6 +109,9 @@ public class MsgInputPanelForGift extends AbsInputPanel {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Message message) {
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick(item,1);
|
||||
}
|
||||
iniPurse();
|
||||
SendMessageManager.onCallSuccess(token, new OnSendMessageListener() {
|
||||
@Override
|
||||
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="90dp" android:height="42dp">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:type="linear" android:useLevel="true" android:startColor="#ff7bd5f9" android:endColor="#ff5eb9fc" android:angle="172" />
|
||||
<corners android:topLeftRadius="24dp" android:topRightRadius="24dp" android:bottomLeftRadius="24dp" android:bottomRightRadius="24dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="125dp" android:height="26dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#66b6b6b6" />
|
||||
<corners android:topLeftRadius="30dp" android:topRightRadius="30dp" android:bottomLeftRadius="30dp" android:bottomRightRadius="30dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
141
OneToOne/src/main/res/layout/dialog_end_call.xml
Normal file
141
OneToOne/src/main/res/layout/dialog_end_call.xml
Normal file
@ -0,0 +1,141 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bg"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<ImageView
|
||||
android:id="@+id/close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="46dp"
|
||||
android:layout_marginEnd="17dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/ic_call_close" />
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_dialog_tip"
|
||||
android:minWidth="256dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginStart="36dp"
|
||||
android:layout_marginTop="21dp"
|
||||
android:layout_marginEnd="36dp">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/m_chu_xia"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/username"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="7dp"
|
||||
android:text="小柒"
|
||||
android:textColor="#333333"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/avatar"
|
||||
app:layout_constraintStart_toEndOf="@+id/avatar"
|
||||
app:layout_constraintTop_toTopOf="@+id/avatar" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/follow"
|
||||
android:layout_width="54dp"
|
||||
android:layout_height="23dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="@drawable/bg_message_msg_bar_follow"
|
||||
android:text="关注"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="10dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/avatar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/avatar"
|
||||
app:layout_constraintVertical_bias="0.529" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/call_timer"
|
||||
android:layout_width="125dp"
|
||||
android:layout_height="26dp"
|
||||
android:background="@drawable/bg_dialog_end_call_timer"
|
||||
android:text="通话时长:01:06"
|
||||
android:textColor="#4A4A4A"
|
||||
android:textSize="14dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="14dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:gravity="center"
|
||||
android:text="此次通话结束了快开启\n下一次通话吧"
|
||||
android:textColor="#000000"
|
||||
android:visibility="visible" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/cancel"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginEnd="36dp"
|
||||
android:background="@drawable/bg_dialog_end_call_cancel"
|
||||
android:text="再次通话"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/apply"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="38dp"
|
||||
android:background="@drawable/bg_dialog_tip_apply"
|
||||
android:text="去充值"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_msg_call_lock.png
Normal file
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_msg_call_lock.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.2 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_msg_video_lock.png
Normal file
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_msg_video_lock.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
Loading…
x
Reference in New Issue
Block a user