update
@ -12,6 +12,7 @@ import com.shayu.onetoone.activity.fragments.message.ChatMessageFragment;
|
||||
import com.shayu.onetoone.activity.message.ChatActivity;
|
||||
import com.shayu.onetoone.bean.MessageChatTipsContent;
|
||||
import com.shayu.onetoone.provider.CustomConversationProvider;
|
||||
import com.shayu.onetoone.provider.MessageChatReceiveGiftItemProvider;
|
||||
import com.shayu.onetoone.provider.MessageChatTipsItemProvider;
|
||||
import com.shayu.onetoone.utils.NeverCrashUtils;
|
||||
import com.yunbao.common.BuildConfig;
|
||||
@ -81,6 +82,7 @@ public class AppContext extends CommonAppContext {
|
||||
|
||||
RongConfigCenter.conversationConfig().addMessageProvider(new InstructorSendRewardProvider(getApplicationContext()));
|
||||
RongConfigCenter.conversationConfig().addMessageProvider(new MessageChatTipsItemProvider(getApplicationContext()));
|
||||
RongConfigCenter.conversationConfig().addMessageProvider(new MessageChatReceiveGiftItemProvider(getApplicationContext()));
|
||||
|
||||
String appKey = "pvxdm17jpd3hr";
|
||||
boolean enablePush = true;
|
||||
|
@ -32,7 +32,7 @@ public class HotFragment extends BaseFragment {
|
||||
public void initView(View itemView) {
|
||||
recyclerView = itemView.findViewById(R.id.recyclerView);
|
||||
mRefreshLayout = itemView.findViewById(R.id.swipeRefreshLayout);
|
||||
adapter=new HomeHotListAdapter(getContext());
|
||||
adapter = new HomeHotListAdapter(getContext());
|
||||
recyclerView.setAdapter(adapter);
|
||||
mRefreshLayout.setNestedScrollingEnabled(false);
|
||||
mRefreshLayout.setRefreshHeader(new RongRefreshHeader(this.getContext()));
|
||||
@ -47,19 +47,24 @@ public class HotFragment extends BaseFragment {
|
||||
onConversationListLoadMore();
|
||||
}
|
||||
});
|
||||
initData();
|
||||
}
|
||||
|
||||
private void onConversationListLoadMore() {
|
||||
mRefreshLayout.finishLoadMore();
|
||||
}
|
||||
|
||||
private void onConversationListRefresh(RefreshLayout refreshLayout) {
|
||||
|
||||
initData();
|
||||
refreshLayout.finishRefresh();
|
||||
}
|
||||
private void initData(){
|
||||
|
||||
private void initData() {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getHomeHot(new HttpCallback<List<HomeItemBean>>() {
|
||||
@Override
|
||||
public void onSuccess(List<HomeItemBean> data) {
|
||||
|
||||
adapter.setList(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -68,6 +73,7 @@ public class HotFragment extends BaseFragment {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public View createView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_hot, container, false);
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.shayu.onetoone.activity.fragments.message;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
@ -23,7 +24,12 @@ import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.MessageChatTipsContent;
|
||||
import com.shayu.onetoone.bean.UserBean;
|
||||
import com.shayu.onetoone.dialog.GiftDialog;
|
||||
import com.shayu.onetoone.dialog.TipsDialog;
|
||||
import com.shayu.onetoone.listener.OnDialogClickListener;
|
||||
import com.shayu.onetoone.listener.OnSendMessageListener;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.SendMessageManager;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
@ -48,6 +54,7 @@ import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.message.ImageMessage;
|
||||
import io.rong.message.TextMessage;
|
||||
|
||||
/**
|
||||
* 融云聊天UI
|
||||
@ -55,11 +62,12 @@ import io.rong.message.ImageMessage;
|
||||
public class ChatMessageFragment extends AbsConversationFragment {
|
||||
Button mSendBtn;
|
||||
View mInputPanel;
|
||||
EditText mEditText;
|
||||
ImageView img, call, video, gift;
|
||||
ProcessImageUtil cameraUtil;
|
||||
String targetId;
|
||||
Conversation.ConversationType conversationType = Conversation.ConversationType.PRIVATE;
|
||||
View audioLayout;
|
||||
ViewGroup audioLayout;
|
||||
ImageView btnAudio;
|
||||
ImageView btnText;
|
||||
ImageView btnClose;
|
||||
@ -75,6 +83,7 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
ImageView status;
|
||||
Button follow;
|
||||
|
||||
private String token;
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
@ -83,7 +92,7 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
initChat();
|
||||
targetId = getActivity().getIntent().getStringExtra("targetId");
|
||||
cameraUtil = new ProcessImageUtil(getActivity(), "com.shayu.onetoone.fileprovider");
|
||||
mSendBtn.setOnClickListener(v -> sendText());
|
||||
|
||||
mRongExtension.setVisibility(View.VISIBLE);
|
||||
img.setOnClickListener(v -> cameraUtil.getImageByCamera());
|
||||
initCamera();
|
||||
@ -104,12 +113,43 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
}
|
||||
});
|
||||
});
|
||||
mSendBtn.setOnClickListener(v -> {
|
||||
System.out.println("点击");
|
||||
SendMessageManager.sendMessageForText(targetId, mEditText.getText().toString(), new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token) {
|
||||
super.onSuccess(token);
|
||||
ChatMessageFragment.this.token = token;
|
||||
sendText();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
if (status == OnSendMessageListener.STATUS_NOT_PRICE) {
|
||||
new TipsDialog(mContext)
|
||||
.setTitle("餘額不足")
|
||||
.setContent(String.format("文字聊天每條續消耗%s鑽,您可通過充值獲取更多鑽石,以便繼續聊天", msg))
|
||||
.setOnDialogClickListener(new OnDialogClickListener() {
|
||||
|
||||
@Override
|
||||
public void onApply(Dialog dialog) {
|
||||
super.onApply(dialog);
|
||||
}
|
||||
}).showDialog();
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
updateMyInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getLayoutView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.rc_conversation_fragment,container,false);
|
||||
return inflater.inflate(R.layout.rc_conversation_fragment, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -148,21 +188,51 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
assert mVoiceToggleBtn != null;
|
||||
|
||||
mVoiceToggleBtn.setOnClickListener(v -> {
|
||||
changeAudioLayout();
|
||||
SendMessageManager.sendMessageForAudio(targetId, new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onSuccess(String token) {
|
||||
super.onSuccess(token);
|
||||
ChatMessageFragment.this.token = token;
|
||||
changeAudioLayout();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
if (status == OnSendMessageListener.STATUS_NOT_PRICE) {
|
||||
new TipsDialog(mContext)
|
||||
.setTitle("餘額不足")
|
||||
.setContent(String.format("聊天每條續消耗%s鑽,您可通過充值獲取更多鑽石,以便繼續聊天", msg))
|
||||
.setOnDialogClickListener(new OnDialogClickListener() {
|
||||
|
||||
@Override
|
||||
public void onApply(Dialog dialog) {
|
||||
super.onApply(dialog);
|
||||
}
|
||||
}).showDialog();
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
img = mInputPanel.findViewById(R.id.input_panel_image_btn);
|
||||
video = mInputPanel.findViewById(R.id.input_panel_video_btn);
|
||||
call = mInputPanel.findViewById(R.id.input_panel_call_btn);
|
||||
gift = mInputPanel.findViewById(R.id.input_panel_gift_btn);
|
||||
audioLayout = mInputPanel.findViewById(R.id.audio_layout);
|
||||
btnAudio = mInputPanel.findViewById(R.id.audio_btn);
|
||||
btnText = mInputPanel.findViewById(R.id.text_btn);
|
||||
btnClose = mInputPanel.findViewById(R.id.close_btn);
|
||||
audioLayout.addView(LayoutInflater.from(mContext).inflate(R.layout.view_message_input_audio, (ViewGroup) mInputPanel,false));
|
||||
btnAudio = audioLayout.findViewById(R.id.audio_btn);
|
||||
btnText = audioLayout.findViewById(R.id.text_btn);
|
||||
btnClose = audioLayout.findViewById(R.id.close_btn);
|
||||
mEditText = audioLayout.findViewById(R.id.edit_btn);
|
||||
|
||||
btnText.setOnClickListener(v -> changeAudioLayout());
|
||||
btnClose.setOnClickListener(v -> changeAudioLayout());
|
||||
|
||||
btnAudio.setOnTouchListener(new View.OnTouchListener() {
|
||||
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
float mOffsetLimit = 70.0F * v.getContext().getResources().getDisplayMetrics().density;
|
||||
@ -194,8 +264,14 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
|
||||
|
||||
} else if (event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_CANCEL) {
|
||||
|
||||
AudioRecordManager.getInstance().stopRecord();
|
||||
SendMessageManager.onCallSuccess(token, new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (mRongExtension.getConversationIdentifier().getType().equals(Conversation.ConversationType.PRIVATE)) {
|
||||
@ -206,7 +282,9 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
gift.setOnClickListener(v -> {
|
||||
new GiftDialog(mContext).showDialog();
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
@ -216,21 +294,49 @@ public class ChatMessageFragment extends AbsConversationFragment {
|
||||
private void changeAudioLayout() {
|
||||
if (audioLayout.getVisibility() == View.VISIBLE) {
|
||||
audioLayout.setVisibility(View.GONE);
|
||||
SendMessageManager.cancel(token);
|
||||
} else {
|
||||
audioLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
private void sendText() {
|
||||
try {
|
||||
Field field = mRongExtension.getInputPanel().getClass().getDeclaredField("mSendBtn");
|
||||
field.setAccessible(true);
|
||||
Button send = (Button) field.get(mRongExtension.getInputPanel());
|
||||
assert send != null;
|
||||
send.callOnClick();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
Conversation.ConversationType conversationType = Conversation.ConversationType.PRIVATE;
|
||||
TextMessage messageContent = TextMessage.obtain(mEditText.getText().toString());
|
||||
|
||||
Message message = Message.obtain(targetId, conversationType, messageContent);
|
||||
|
||||
IMCenter.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
|
||||
@Override
|
||||
public void onAttached(Message message) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(Message message) {
|
||||
SendMessageManager.onCallSuccess(token, new OnSendMessageListener() {
|
||||
@Override
|
||||
public void onError(int status, String msg) {
|
||||
super.onError(status, msg);
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String token) {
|
||||
super.onSuccess(token);
|
||||
ToastUtil.show(token);
|
||||
mEditText.setText("");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Message message, RongIMClient.ErrorCode errorCode) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void sendImage(File file) {
|
||||
|
@ -0,0 +1,91 @@
|
||||
package com.shayu.onetoone.activity.message;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.SurfaceView;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activity.AbsOTOActivity;
|
||||
import com.shayu.onetoone.listener.OnCallStatusListener;
|
||||
|
||||
public class CallVideoActivity extends AbsOTOActivity {
|
||||
|
||||
private SurfaceView myView;
|
||||
private SurfaceView targetView;
|
||||
private ImageView callStop;
|
||||
private ImageView gift;
|
||||
private ImageView message;
|
||||
private ImageView cameraCloseSwitch;
|
||||
private ImageView cameraSwitch;
|
||||
private ImageView micSwitch;
|
||||
private ImageView money;
|
||||
private RoundedImageView avatar;
|
||||
private ImageView close;
|
||||
private ImageView follow;
|
||||
private TextView followText;
|
||||
|
||||
private OnCallStatusListener onCallStatusListener;
|
||||
|
||||
private String targetId;
|
||||
|
||||
public void setOnCallStatusListener(OnCallStatusListener onCallStatusListener) {
|
||||
this.onCallStatusListener = onCallStatusListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_call_video;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main(Bundle savedInstanceState) {
|
||||
initView();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
myView = findViewById(R.id.my_view);
|
||||
targetView = findViewById(R.id.target_view);
|
||||
callStop = findViewById(R.id.call_stop);
|
||||
gift = findViewById(R.id.gift);
|
||||
message = findViewById(R.id.message);
|
||||
cameraCloseSwitch = findViewById(R.id.camera_close_switch);
|
||||
cameraSwitch = findViewById(R.id.camera_switch);
|
||||
micSwitch = findViewById(R.id.mic_switch);
|
||||
money = findViewById(R.id.money);
|
||||
avatar = findViewById(R.id.avatar);
|
||||
close = findViewById(R.id.close);
|
||||
follow = findViewById(R.id.follow);
|
||||
followText = findViewById(R.id.follow_text);
|
||||
// 为所有View设置点击事件监听器
|
||||
setClickListeners();
|
||||
}
|
||||
|
||||
private void setClickListeners() {
|
||||
// 为所有ImageView设置点击事件监听器
|
||||
callStop.setOnClickListener(onClickListener);
|
||||
gift.setOnClickListener(onClickListener);
|
||||
message.setOnClickListener(onClickListener);
|
||||
cameraCloseSwitch.setOnClickListener(onClickListener);
|
||||
cameraSwitch.setOnClickListener(onClickListener);
|
||||
micSwitch.setOnClickListener(onClickListener);
|
||||
money.setOnClickListener(onClickListener);
|
||||
|
||||
// 为其他View设置点击事件监听器
|
||||
avatar.setOnClickListener(onClickListener);
|
||||
close.setOnClickListener(onClickListener);
|
||||
follow.setOnClickListener(onClickListener);
|
||||
}
|
||||
|
||||
private View.OnClickListener onClickListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// 在这里编写点击事件的处理逻辑
|
||||
int id = v.getId();
|
||||
|
||||
}
|
||||
};
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package com.shayu.onetoone.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.GiftBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GiftListAdapter extends RecyclerView.Adapter<GiftListAdapter.ViewHolder> {
|
||||
private Context mContext;
|
||||
private List<GiftBean> list;
|
||||
|
||||
public GiftListAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
public void setList(List<GiftBean> list) {
|
||||
this.list = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new ViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_gift, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
holder.setData(list.get(position), position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView giftIcon;
|
||||
private TextView giftName;
|
||||
private TextView money;
|
||||
private View select;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
giftIcon = itemView.findViewById(R.id.gift_icon);
|
||||
giftName = itemView.findViewById(R.id.gift_name);
|
||||
money = itemView.findViewById(R.id.money);
|
||||
select.findViewById(R.id.bg_select);
|
||||
itemView.setOnClickListener(v -> {
|
||||
select.setVisibility(View.VISIBLE);
|
||||
});
|
||||
}
|
||||
|
||||
private void setData(GiftBean giftBean, int position) {
|
||||
giftName.setText(giftBean.getGiftname());
|
||||
money.setText(giftBean.getNeedcoin() + "");
|
||||
ImgLoader.display(itemView.getContext(), giftBean.getGifticon(), giftIcon);
|
||||
select.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
@ -13,6 +13,8 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.HomeItemBean;
|
||||
import com.shayu.onetoone.utils.ConversationUtils;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -40,7 +42,7 @@ public class HomeHotListAdapter extends RecyclerView.Adapter<HomeHotListAdapter.
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
|
||||
holder.setData(list.get(position),position);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -49,27 +51,58 @@ public class HomeHotListAdapter extends RecyclerView.Adapter<HomeHotListAdapter.
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
private RoundedImageView cover;
|
||||
private RoundedImageView avatar;
|
||||
private ImageView status;
|
||||
private ImageView chat;
|
||||
private TextView userName;
|
||||
private ImageView sex;
|
||||
private TextView age;
|
||||
private ImageView levelIcon;
|
||||
private ImageView cover;
|
||||
private TextView level;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
level=itemView.findViewById(R.id.level);
|
||||
levelIcon=itemView.findViewById(R.id.ic_level);
|
||||
age=itemView.findViewById(R.id.age);
|
||||
sex=itemView.findViewById(R.id.sex);
|
||||
chat=itemView.findViewById(R.id.btn_chat);
|
||||
userName=itemView.findViewById(R.id.user_name);
|
||||
cover=itemView.findViewById(R.id.cover);
|
||||
status=itemView.findViewById(R.id.status);
|
||||
level = itemView.findViewById(R.id.level);
|
||||
levelIcon = itemView.findViewById(R.id.ic_level);
|
||||
age = itemView.findViewById(R.id.age);
|
||||
sex = itemView.findViewById(R.id.sex);
|
||||
chat = itemView.findViewById(R.id.btn_chat);
|
||||
userName = itemView.findViewById(R.id.user_name);
|
||||
avatar = itemView.findViewById(R.id.avatar);
|
||||
status = itemView.findViewById(R.id.status);
|
||||
cover = itemView.findViewById(R.id.cover);
|
||||
}
|
||||
private void setData(HomeItemBean bean,int position){
|
||||
|
||||
private void setData(HomeItemBean bean, int position) {
|
||||
userName.setText(bean.getUser_nicename());
|
||||
age.setText(bean.getAge() + "");
|
||||
level.setText("Lv." + bean.getLevel());
|
||||
if (bean.getSex() == 1) {
|
||||
sex.setImageResource(R.mipmap.ic_home_hot_man);
|
||||
} else {
|
||||
sex.setImageResource(R.mipmap.ic_home_hot_woman);
|
||||
}
|
||||
if (bean.getIs_accost() == 1) {
|
||||
chat.setImageResource(R.mipmap.ic_home_hot_chat_up);
|
||||
} else {
|
||||
chat.setImageResource(R.mipmap.ic_home_hot_chat);
|
||||
}
|
||||
cover.setVisibility(View.GONE);
|
||||
status.setImageResource(R.mipmap.ic_home_hot_status_online);
|
||||
if (bean.getOnline() == 1) {
|
||||
cover.setVisibility(View.VISIBLE);
|
||||
status.setImageResource(R.mipmap.ic_home_hot_status_offine);
|
||||
} else if (bean.getOnline() == 2) {
|
||||
status.setImageResource(R.mipmap.ic_home_hot_status_busy);
|
||||
}
|
||||
ImgLoader.display(mContext, bean.getAvatar(), avatar);
|
||||
itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
ConversationUtils.startConversation(mContext, bean.getId() + "");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -57,6 +57,7 @@ public class HomeRecommendListAdapter extends RecyclerView.Adapter<HomeRecommend
|
||||
private ImageView chat;
|
||||
private TextView userName;
|
||||
private ImageView sex;
|
||||
private ImageView auth;
|
||||
private TextView star;
|
||||
private TextView sign;
|
||||
private LinearLayout tagLayout;
|
||||
@ -70,6 +71,7 @@ public class HomeRecommendListAdapter extends RecyclerView.Adapter<HomeRecommend
|
||||
avatar = itemView.findViewById(R.id.avatar);
|
||||
tagLayout = itemView.findViewById(R.id.user_tag_layout);
|
||||
sign = itemView.findViewById(R.id.user_sign);
|
||||
auth = itemView.findViewById(R.id.auth);
|
||||
}
|
||||
|
||||
private void setData(HomeItemBean bean, int position) {
|
||||
@ -86,6 +88,11 @@ public class HomeRecommendListAdapter extends RecyclerView.Adapter<HomeRecommend
|
||||
} else {
|
||||
sex.setImageResource(R.mipmap.ic_message_tab_woman);
|
||||
}
|
||||
if (bean.getSage_auth() == 1) {
|
||||
auth.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
auth.setVisibility(View.GONE);
|
||||
}
|
||||
ImgLoader.display(mContext, bean.getAvatar(), avatar);
|
||||
chat.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
279
OneToOne/src/main/java/com/shayu/onetoone/bean/GiftBean.java
Normal file
@ -0,0 +1,279 @@
|
||||
package com.shayu.onetoone.bean;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class GiftBean extends BaseModel {
|
||||
private int id;
|
||||
private int mark;
|
||||
private int sendtype;
|
||||
private int type;
|
||||
private int sid;
|
||||
private String giftname;
|
||||
private int needcoin;
|
||||
private String gifticon_mini;
|
||||
private String gifticon;
|
||||
private String corner_mark;
|
||||
private int orderno;
|
||||
private long addtime;
|
||||
private int swftype;
|
||||
private String swf;
|
||||
private String swftime;
|
||||
private String gift_description;
|
||||
private String operate_image;
|
||||
private String operate_url;
|
||||
private int status;
|
||||
private int gift_uid;
|
||||
private int wishtype;
|
||||
private int sort;
|
||||
private int fans_level;
|
||||
private String gift_start_time;
|
||||
private String gift_end_time;
|
||||
private int naming_status;
|
||||
private int naming_coin;
|
||||
private int naming_liveuid;
|
||||
private int naming_uid;
|
||||
private int gift_type;
|
||||
|
||||
public GiftBean() {
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getMark() {
|
||||
return mark;
|
||||
}
|
||||
|
||||
public void setMark(int mark) {
|
||||
this.mark = mark;
|
||||
}
|
||||
|
||||
public int getSendtype() {
|
||||
return sendtype;
|
||||
}
|
||||
|
||||
public void setSendtype(int sendtype) {
|
||||
this.sendtype = sendtype;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getSid() {
|
||||
return sid;
|
||||
}
|
||||
|
||||
public void setSid(int sid) {
|
||||
this.sid = sid;
|
||||
}
|
||||
|
||||
public String getGiftname() {
|
||||
return giftname;
|
||||
}
|
||||
|
||||
public void setGiftname(String giftname) {
|
||||
this.giftname = giftname;
|
||||
}
|
||||
|
||||
public int getNeedcoin() {
|
||||
return needcoin;
|
||||
}
|
||||
|
||||
public void setNeedcoin(int needcoin) {
|
||||
this.needcoin = needcoin;
|
||||
}
|
||||
|
||||
public String getGifticon_mini() {
|
||||
return gifticon_mini;
|
||||
}
|
||||
|
||||
public void setGifticon_mini(String gifticon_mini) {
|
||||
this.gifticon_mini = gifticon_mini;
|
||||
}
|
||||
|
||||
public String getGifticon() {
|
||||
return gifticon;
|
||||
}
|
||||
|
||||
public void setGifticon(String gifticon) {
|
||||
this.gifticon = gifticon;
|
||||
}
|
||||
|
||||
public String getCorner_mark() {
|
||||
return corner_mark;
|
||||
}
|
||||
|
||||
public void setCorner_mark(String corner_mark) {
|
||||
this.corner_mark = corner_mark;
|
||||
}
|
||||
|
||||
public int getOrderno() {
|
||||
return orderno;
|
||||
}
|
||||
|
||||
public void setOrderno(int orderno) {
|
||||
this.orderno = orderno;
|
||||
}
|
||||
|
||||
public long getAddtime() {
|
||||
return addtime;
|
||||
}
|
||||
|
||||
public void setAddtime(long addtime) {
|
||||
this.addtime = addtime;
|
||||
}
|
||||
|
||||
public int getSwftype() {
|
||||
return swftype;
|
||||
}
|
||||
|
||||
public void setSwftype(int swftype) {
|
||||
this.swftype = swftype;
|
||||
}
|
||||
|
||||
public String getSwf() {
|
||||
return swf;
|
||||
}
|
||||
|
||||
public void setSwf(String swf) {
|
||||
this.swf = swf;
|
||||
}
|
||||
|
||||
public String getSwftime() {
|
||||
return swftime;
|
||||
}
|
||||
|
||||
public void setSwftime(String swftime) {
|
||||
this.swftime = swftime;
|
||||
}
|
||||
|
||||
public String getGift_description() {
|
||||
return gift_description;
|
||||
}
|
||||
|
||||
public void setGift_description(String gift_description) {
|
||||
this.gift_description = gift_description;
|
||||
}
|
||||
|
||||
public String getOperate_image() {
|
||||
return operate_image;
|
||||
}
|
||||
|
||||
public void setOperate_image(String operate_image) {
|
||||
this.operate_image = operate_image;
|
||||
}
|
||||
|
||||
public String getOperate_url() {
|
||||
return operate_url;
|
||||
}
|
||||
|
||||
public void setOperate_url(String operate_url) {
|
||||
this.operate_url = operate_url;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public int getGift_uid() {
|
||||
return gift_uid;
|
||||
}
|
||||
|
||||
public void setGift_uid(int gift_uid) {
|
||||
this.gift_uid = gift_uid;
|
||||
}
|
||||
|
||||
public int getWishtype() {
|
||||
return wishtype;
|
||||
}
|
||||
|
||||
public void setWishtype(int wishtype) {
|
||||
this.wishtype = wishtype;
|
||||
}
|
||||
|
||||
public int getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(int sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public int getFans_level() {
|
||||
return fans_level;
|
||||
}
|
||||
|
||||
public void setFans_level(int fans_level) {
|
||||
this.fans_level = fans_level;
|
||||
}
|
||||
|
||||
public String getGift_start_time() {
|
||||
return gift_start_time;
|
||||
}
|
||||
|
||||
public void setGift_start_time(String gift_start_time) {
|
||||
this.gift_start_time = gift_start_time;
|
||||
}
|
||||
|
||||
public String getGift_end_time() {
|
||||
return gift_end_time;
|
||||
}
|
||||
|
||||
public void setGift_end_time(String gift_end_time) {
|
||||
this.gift_end_time = gift_end_time;
|
||||
}
|
||||
|
||||
public int getNaming_status() {
|
||||
return naming_status;
|
||||
}
|
||||
|
||||
public void setNaming_status(int naming_status) {
|
||||
this.naming_status = naming_status;
|
||||
}
|
||||
|
||||
public int getNaming_coin() {
|
||||
return naming_coin;
|
||||
}
|
||||
|
||||
public void setNaming_coin(int naming_coin) {
|
||||
this.naming_coin = naming_coin;
|
||||
}
|
||||
|
||||
public int getNaming_liveuid() {
|
||||
return naming_liveuid;
|
||||
}
|
||||
|
||||
public void setNaming_liveuid(int naming_liveuid) {
|
||||
this.naming_liveuid = naming_liveuid;
|
||||
}
|
||||
|
||||
public int getNaming_uid() {
|
||||
return naming_uid;
|
||||
}
|
||||
|
||||
public void setNaming_uid(int naming_uid) {
|
||||
this.naming_uid = naming_uid;
|
||||
}
|
||||
|
||||
public int getGift_type() {
|
||||
return gift_type;
|
||||
}
|
||||
|
||||
public void setGift_type(int gift_type) {
|
||||
this.gift_type = gift_type;
|
||||
}
|
||||
}
|
@ -37,6 +37,8 @@ public class HomeItemBean extends BaseModel {
|
||||
private String signature;
|
||||
private String star_name;
|
||||
private int age;
|
||||
private int level;
|
||||
private int is_accost;
|
||||
|
||||
public HomeItemBean() {
|
||||
}
|
||||
@ -296,4 +298,20 @@ public class HomeItemBean extends BaseModel {
|
||||
public void setAge(int age) {
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public int getIs_accost() {
|
||||
return is_accost;
|
||||
}
|
||||
|
||||
public void setIs_accost(int is_accost) {
|
||||
this.is_accost = is_accost;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,151 @@
|
||||
package com.shayu.onetoone.bean;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
import io.rong.common.ParcelUtils;
|
||||
import io.rong.imlib.MessageTag;
|
||||
import io.rong.imlib.model.MessageContent;
|
||||
|
||||
@MessageTag(value = "MessageChatGiftContent", flag = MessageTag.ISPERSISTED)
|
||||
public class MessageChatGiftContent extends MessageContent implements Parcelable {
|
||||
private String content;
|
||||
private String title;
|
||||
private String imageUrl;
|
||||
|
||||
private MessageChatGiftContent() {
|
||||
}
|
||||
|
||||
public MessageChatGiftContent(byte[] data) {
|
||||
if (data == null) {
|
||||
return;
|
||||
}
|
||||
String jsonStr = null;
|
||||
try {
|
||||
jsonStr = new String(data, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
}
|
||||
if (jsonStr == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
JSONObject jsonObj = new JSONObject(jsonStr);
|
||||
// 消息携带用户信息时, 自定义消息需添加下面代码
|
||||
if (jsonObj.has("user")) {
|
||||
setUserInfo(parseJsonToUserInfo(jsonObj.getJSONObject("user")));
|
||||
}
|
||||
// 用于群组聊天, 消息携带 @ 人信息时, 自定义消息需添加下面代码
|
||||
if (jsonObj.has("mentionedInfo")) {
|
||||
setMentionedInfo(parseJsonToMentionInfo(jsonObj.getJSONObject("mentionedInfo")));
|
||||
}
|
||||
// 将所有自定义变量从收到的 json 解析并赋值
|
||||
if (jsonObj.has("content")) {
|
||||
content = jsonObj.optString("content");
|
||||
title = jsonObj.optString("title");
|
||||
imageUrl = jsonObj.optString("imageUrl");
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
}
|
||||
}
|
||||
|
||||
public MessageChatGiftContent setContent(String content) {
|
||||
this.content = content;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MessageChatGiftContent setTitle(String title) {
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MessageChatGiftContent setImageUrl(String imageUrl) {
|
||||
this.imageUrl = imageUrl;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public String getImageUrl() {
|
||||
return imageUrl;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
protected MessageChatGiftContent(Parcel in) {
|
||||
setExtra(ParcelUtils.readFromParcel(in));
|
||||
setContent(ParcelUtils.readFromParcel(in));
|
||||
}
|
||||
|
||||
// 快速构建消息对象方法
|
||||
public static MessageChatGiftContent obtain(String title, String content, String imageUrl) {
|
||||
MessageChatGiftContent msg = new MessageChatGiftContent();
|
||||
msg.content = content;
|
||||
msg.title = title;
|
||||
msg.imageUrl = imageUrl;
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
public static final Creator<MessageChatGiftContent> CREATOR = new Creator<MessageChatGiftContent>() {
|
||||
@Override
|
||||
public MessageChatGiftContent createFromParcel(Parcel in) {
|
||||
return new MessageChatGiftContent(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageChatGiftContent[] newArray(int size) {
|
||||
return new MessageChatGiftContent[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public byte[] encode() {
|
||||
JSONObject jsonObj = new JSONObject();
|
||||
try {
|
||||
// 消息携带用户信息时, 自定义消息需添加下面代码
|
||||
if (getJSONUserInfo() != null) {
|
||||
jsonObj.putOpt("user", getJSONUserInfo());
|
||||
}
|
||||
// 用于群组聊天, 消息携带 @ 人信息时, 自定义消息需添加下面代码
|
||||
if (getJsonMentionInfo() != null) {
|
||||
jsonObj.putOpt("mentionedInfo", getJsonMentionInfo());
|
||||
}
|
||||
// 将所有自定义消息的内容,都序列化至 json 对象中
|
||||
jsonObj.put("content", this.content);
|
||||
jsonObj.put("title", this.title);
|
||||
jsonObj.put("imageUrl", this.imageUrl);
|
||||
} catch (JSONException e) {
|
||||
}
|
||||
|
||||
try {
|
||||
return jsonObj.toString().getBytes("UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(@NonNull Parcel dest, int flags) {
|
||||
ParcelUtils.writeToParcel(dest, getExtra());
|
||||
ParcelUtils.writeToParcel(dest, content);
|
||||
ParcelUtils.writeToParcel(dest, title);
|
||||
ParcelUtils.writeToParcel(dest, imageUrl);
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package com.shayu.onetoone.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class MessageConsumeConfigBean extends BaseModel {
|
||||
@SerializedName("vodiePrice")
|
||||
private int videoPrice;//视频扣费金额
|
||||
private int mp3Price;//音频扣费金额
|
||||
private int price;//消息扣费金额
|
||||
private int pingTime;//心跳时间,单位秒
|
||||
|
||||
public MessageConsumeConfigBean() {
|
||||
}
|
||||
|
||||
public int getVideoPrice() {
|
||||
return videoPrice;
|
||||
}
|
||||
|
||||
public void setVideoPrice(int videoPrice) {
|
||||
this.videoPrice = videoPrice;
|
||||
}
|
||||
|
||||
public int getMp3Price() {
|
||||
return mp3Price;
|
||||
}
|
||||
|
||||
public void setMp3Price(int mp3Price) {
|
||||
this.mp3Price = mp3Price;
|
||||
}
|
||||
|
||||
public int getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(int price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public int getPingTime() {
|
||||
return pingTime;
|
||||
}
|
||||
|
||||
public void setPingTime(int pingTime) {
|
||||
this.pingTime = pingTime;
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.shayu.onetoone.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.adapter.GiftListAdapter;
|
||||
import com.shayu.onetoone.bean.GiftBean;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GiftDialog extends AbsDialogPopupWindow {
|
||||
RecyclerView gifList;
|
||||
GiftListAdapter mAdapter;
|
||||
TextView money;
|
||||
Button topUpBtn;
|
||||
Button sendBtn;
|
||||
|
||||
|
||||
public GiftDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.view_message_input_gift;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
gifList = findViewById(R.id.gift_list);
|
||||
money = findViewById(R.id.money);
|
||||
topUpBtn = findViewById(R.id.top_up_btn);
|
||||
sendBtn = findViewById(R.id.send_btn);
|
||||
|
||||
mAdapter = new GiftListAdapter(mContext);
|
||||
gifList.setAdapter(mAdapter);
|
||||
initData();
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getGiftList(new HttpCallback<List<GiftBean>>() {
|
||||
@Override
|
||||
public void onSuccess(List<GiftBean> data) {
|
||||
mAdapter.setList(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
package com.shayu.onetoone.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.listener.OnDialogClickListener;
|
||||
import com.yunbao.common.dialog.AbsDialogCenterPopupWindow;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
public class TipsDialog extends AbsDialogCenterPopupWindow {
|
||||
private String title, content;
|
||||
private OnDialogClickListener onDialogClickListener;
|
||||
TextView mTitle,mContent;
|
||||
Button mCancel,mApply;
|
||||
|
||||
public TipsDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public TipsDialog setTitle(String title) {
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TipsDialog setContent(String content) {
|
||||
this.content = content;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TipsDialog setOnDialogClickListener(OnDialogClickListener onDialogClickListener) {
|
||||
this.onDialogClickListener = onDialogClickListener;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_tips1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
mTitle=findViewById(R.id.title);
|
||||
mContent=findViewById(R.id.content);
|
||||
mCancel=findViewById(R.id.cancel);
|
||||
mApply=findViewById(R.id.apply);
|
||||
|
||||
if(StringUtil.isEmpty(title)){
|
||||
mTitle.setVisibility(GONE);
|
||||
}else{
|
||||
mTitle.setText(title);
|
||||
}
|
||||
if(StringUtil.isEmpty(content)){
|
||||
mContent.setVisibility(GONE);
|
||||
}else{
|
||||
mContent.setText(content);
|
||||
}
|
||||
mCancel.setOnClickListener(v -> {
|
||||
if(onDialogClickListener!=null){
|
||||
onDialogClickListener.onCancel(dialog);
|
||||
}
|
||||
dismiss();
|
||||
});
|
||||
mApply.setOnClickListener(v ->{
|
||||
if(onDialogClickListener!=null){
|
||||
onDialogClickListener.onApply(dialog);
|
||||
}
|
||||
dismiss();
|
||||
});
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.shayu.onetoone.listener;
|
||||
|
||||
import android.view.SurfaceView;
|
||||
|
||||
public abstract class OnCallStatusListener {
|
||||
public abstract void onCallWait(SurfaceView localVideo);
|
||||
|
||||
public abstract void onCallStart(String userId, SurfaceView remoteVideo);
|
||||
|
||||
public abstract void onCallEnd();
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.shayu.onetoone.listener;
|
||||
|
||||
import android.app.Dialog;
|
||||
|
||||
public abstract class OnDialogClickListener {
|
||||
public void onCancel(Dialog dialog){
|
||||
|
||||
}
|
||||
public void onApply(Dialog dialog){
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.shayu.onetoone.listener;
|
||||
|
||||
public abstract class OnSendMessageListener {
|
||||
public static final int STATUS_NOT_PRICE = 0;//金额不够
|
||||
public static final int STATUS_ERROR = 1;//接口错误
|
||||
|
||||
|
||||
public void onSuccess(String token) {
|
||||
|
||||
}
|
||||
|
||||
public void onError(int status, String msg) {
|
||||
}
|
||||
}
|
@ -0,0 +1,230 @@
|
||||
package com.shayu.onetoone.manager;
|
||||
|
||||
import android.Manifest;
|
||||
import android.view.SurfaceView;
|
||||
|
||||
import com.blankj.utilcode.util.PermissionUtils;
|
||||
import com.shayu.onetoone.listener.OnCallStatusListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.calllib.IRongCallListener;
|
||||
import io.rong.calllib.IRongReceivedCallListener;
|
||||
import io.rong.calllib.RongCallClient;
|
||||
import io.rong.calllib.RongCallCommon;
|
||||
import io.rong.calllib.RongCallSession;
|
||||
import io.rong.calllib.StartCameraCallback;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
|
||||
public class CallClientManager {
|
||||
public static CallClientManager manager;
|
||||
|
||||
public static CallClientManager getManager() {
|
||||
if (manager == null) {
|
||||
manager = new CallClientManager();
|
||||
}
|
||||
return manager;
|
||||
}
|
||||
|
||||
private CallClientManager() {
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
RongCallClient.setReceivedCallListener(new CallMeListener());
|
||||
}
|
||||
public void callVideo(String targetId, OnCallStatusListener statusListener) {
|
||||
List<String> userIds = new ArrayList<>();
|
||||
userIds.add(targetId);
|
||||
RongCallClient.getInstance().setVoIPCallListener(new CallStatusListener(statusListener));
|
||||
RongCallClient.getInstance().startCall(Conversation.ConversationType.PRIVATE,targetId,userIds,null, RongCallCommon.CallMediaType.VIDEO,null);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static class CallMeListener implements IRongReceivedCallListener {
|
||||
|
||||
@Override
|
||||
public void onReceivedCall(RongCallSession callSession) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckPermission(RongCallSession callSession) {
|
||||
PermissionUtils.permission(Manifest.permission.CAMERA,Manifest.permission.RECORD_AUDIO).callback(new PermissionUtils.SimpleCallback() {
|
||||
@Override
|
||||
public void onGranted() {
|
||||
RongCallClient.getInstance().onPermissionGranted();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDenied() {
|
||||
RongCallClient.getInstance().onPermissionDenied();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static class CallStatusListener implements IRongCallListener {
|
||||
OnCallStatusListener statusListener;
|
||||
|
||||
public CallStatusListener(OnCallStatusListener statusListener) {
|
||||
this.statusListener = statusListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCallIncoming(RongCallSession callSession, SurfaceView localVideo) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 电话已拨出。
|
||||
* 主叫端拨出电话后,通过回调 onCallOutgoing 通知当前 call 的详细信息。
|
||||
*
|
||||
* @param callSession 通话实体。
|
||||
* @param localVideo 本地 camera 信息。
|
||||
*/
|
||||
@Override
|
||||
public void onCallOutgoing(RongCallSession callSession, SurfaceView localVideo) {
|
||||
statusListener.onCallWait(localVideo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 已建立通话。
|
||||
* 通话接通时,通过回调 onCallConnected 通知当前 call 的详细信息。
|
||||
*
|
||||
* @param callSession 通话实体。
|
||||
* @param localVideo 本地 camera 信息。
|
||||
*/
|
||||
@Override
|
||||
public void onCallConnected(RongCallSession callSession, SurfaceView localVideo) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 通话结束。
|
||||
* 通话中,对方挂断,己方挂断,或者通话过程网络异常造成的通话中断,都会回调 onCallDisconnected。
|
||||
*
|
||||
* @param callSession 通话实体。
|
||||
* @param reason 通话中断原因。
|
||||
*/
|
||||
@Override
|
||||
public void onCallDisconnected(RongCallSession callSession, RongCallCommon.CallDisconnectedReason reason) {
|
||||
statusListener.onCallEnd();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteUserRinging(String userId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteUserAccept(String userId, RongCallCommon.CallMediaType mediaType) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 被叫端加入通话。
|
||||
* 主叫端拨出电话,被叫端收到请求后,加入通话,回调 onRemoteUserJoined。
|
||||
*
|
||||
* @param userId 加入用户的 id。<br />
|
||||
* @param mediaType 加入用户的媒体类型,audio or video。<br />
|
||||
* @param userType 加入用户的类型,1:正常用户,2:观察者。<br />
|
||||
* @param remoteVideo 加入用户者的 camera 信息。如果 userType为2,remoteVideo对象为空;<br />
|
||||
* 如果对端调用{@link RongCallClient#startCall(int, boolean, Conversation.ConversationType, String, List, List, RongCallCommon.CallMediaType, String, StartCameraCallback)} 或
|
||||
* {@link RongCallClient#acceptCall(String, int, boolean, StartCameraCallback)}开始的音视频通话,则可以使用如下设置改变对端视频流的镜像显示:<br />
|
||||
* <pre class="prettyprint">
|
||||
* public void onRemoteUserJoined(String userId, RongCallCommon.CallMediaType mediaType, int userType, SurfaceView remoteVideo) {
|
||||
* if (null != remoteVideo) {
|
||||
* ((RongRTCVideoView) remoteVideo).setMirror( boolean);//观看对方视频流是否镜像处理
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
@Override
|
||||
public void onRemoteUserJoined(String userId, RongCallCommon.CallMediaType mediaType, int userType, SurfaceView remoteVideo) {
|
||||
statusListener.onCallStart(userId,remoteVideo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteUserInvited(String userId, RongCallCommon.CallMediaType mediaType) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 通话中的远端参与者离开。
|
||||
* 回调 onRemoteUserLeft 通知状态更新。
|
||||
*
|
||||
* @param userId 远端参与者的 id。
|
||||
* @param reason 远端参与者离开原因。
|
||||
*/
|
||||
@Override
|
||||
public void onRemoteUserLeft(String userId, RongCallCommon.CallDisconnectedReason reason) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMediaTypeChanged(String userId, RongCallCommon.CallMediaType mediaType, SurfaceView video) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(RongCallCommon.CallErrorCode errorCode) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteCameraDisabled(String userId, boolean disabled) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteMicrophoneDisabled(String userId, boolean disabled) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNetworkReceiveLost(String userId, int lossRate) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNetworkSendLost(int lossRate, int delay) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFirstRemoteVideoFrame(String userId, int height, int width) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFirstRemoteAudioFrame(String userId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAudioLevelSend(String audioLevel) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAudioLevelReceive(HashMap<String, String> audioLevel) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteUserPublishVideoStream(String userId, String streamId, String tag, SurfaceView surfaceView) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoteUserUnpublishVideoStream(String userId, String streamId, String tag) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -6,9 +6,11 @@ import android.util.Log;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.shayu.onetoone.bean.AvatarBean;
|
||||
import com.shayu.onetoone.bean.GiftBean;
|
||||
import com.shayu.onetoone.bean.GreetBean;
|
||||
import com.shayu.onetoone.bean.HomeItemBean;
|
||||
import com.shayu.onetoone.bean.JoinAnchorBean;
|
||||
import com.shayu.onetoone.bean.MessageConsumeConfigBean;
|
||||
import com.shayu.onetoone.bean.OfficialNoticeBean;
|
||||
import com.shayu.onetoone.bean.SystemMessageBean;
|
||||
import com.shayu.onetoone.bean.TargetUserInfoBean;
|
||||
@ -36,6 +38,7 @@ import io.rong.imlib.model.UserInfo;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
/**
|
||||
* 网络管理类 使用参考{@link com.yunbao.common.http.live.LiveNetManager}
|
||||
@ -363,7 +366,7 @@ public class OTONetManager {
|
||||
MultipartBody.Part uploadFile = createUploadFile(file);
|
||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||
API.get().otoApi(mContext)
|
||||
.updateFile(uploadFile,userInfo.getId()+"",userInfo.getToken())
|
||||
.updateFile(uploadFile, userInfo.getId() + "", userInfo.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<AvatarBean>>() {
|
||||
@ -383,6 +386,7 @@ public class OTONetManager {
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getMessageSystemLists(HttpCallback<List<OfficialNoticeBean>> callback) {
|
||||
API.get().otoApi(mContext)
|
||||
.getLists()
|
||||
@ -406,8 +410,8 @@ public class OTONetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getTargetUserInfoList(List<Integer> ids,HttpCallback<List<TargetUserInfoBean>> callback) {
|
||||
StringBuilder sb=new StringBuilder();
|
||||
public void getTargetUserInfoList(List<Integer> ids, HttpCallback<List<TargetUserInfoBean>> callback) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (Integer id : ids) {
|
||||
sb.append(id).append(",");
|
||||
}
|
||||
@ -432,7 +436,8 @@ public class OTONetManager {
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
public void getTargetUserInfo(int toUid,HttpCallback<UserBean> callback) {
|
||||
|
||||
public void getTargetUserInfo(int toUid, HttpCallback<UserBean> callback) {
|
||||
|
||||
API.get().otoApi(mContext)
|
||||
.getTargetUserInfo(toUid)
|
||||
@ -503,7 +508,8 @@ public class OTONetManager {
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
public void getSystemMessageList(int type,HttpCallback<List<SystemMessageBean>> callback) {
|
||||
|
||||
public void getSystemMessageList(int type, HttpCallback<List<SystemMessageBean>> callback) {
|
||||
|
||||
API.get().otoApi(mContext)
|
||||
.getSystemMessageList(type)
|
||||
@ -527,6 +533,79 @@ public class OTONetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void sendMessage(int tuid,
|
||||
int type,
|
||||
String giftId,
|
||||
String msg,
|
||||
String time,
|
||||
int online,
|
||||
String method,
|
||||
HttpCallback<HttpCallbackModel> callback) {
|
||||
|
||||
API.get().otoApi(mContext)
|
||||
.sendMessage(tuid, type, giftId, msg, time, online, method)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(model -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(new HttpCallbackModel(model.getData().getCode(), model.getData().getMsg()));
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
Log.e(TAG, "accept: ", throwable);
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getMessageConsumeConfig(String toUid, HttpCallback<MessageConsumeConfigBean> callback) {
|
||||
|
||||
API.get().otoApi(mContext)
|
||||
.getMessageConsumeConfig(toUid)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Consumer<ResponseModel<MessageConsumeConfigBean>>() {
|
||||
@Override
|
||||
public void accept(ResponseModel<MessageConsumeConfigBean> model) throws Exception {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(model.getData().getInfo());
|
||||
}
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
Log.e(TAG, "accept: ", throwable);
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
public void getGiftList(HttpCallback<List<GiftBean>> callback) {
|
||||
|
||||
API.get().otoApi(mContext)
|
||||
.getGiftList()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(model -> {
|
||||
if (callback != null) {
|
||||
callback.onSuccess(model.getData().getInfo());
|
||||
}
|
||||
}, new Consumer<Throwable>() {
|
||||
@Override
|
||||
public void accept(Throwable throwable) throws Exception {
|
||||
Log.e(TAG, "accept: ", throwable);
|
||||
if (callback != null) {
|
||||
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||
}
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
private MultipartBody.Part createUploadFile(File file) {
|
||||
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);
|
||||
|
@ -0,0 +1,142 @@
|
||||
package com.shayu.onetoone.manager;
|
||||
|
||||
import com.shayu.onetoone.bean.MessageConsumeConfigBean;
|
||||
import com.shayu.onetoone.listener.OnSendMessageListener;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public class SendMessageManager {
|
||||
private static final Map<String, SendData> cache = new HashMap<>();
|
||||
|
||||
public static void sendMessageForAudio(String toUid,OnSendMessageListener listener){
|
||||
SendData sendData = new SendData(Integer.parseInt(toUid),
|
||||
1,
|
||||
"not",
|
||||
"录音消息",
|
||||
"1",
|
||||
1);
|
||||
send(sendData, listener);
|
||||
}
|
||||
public static void sendMessageForText(String toUid, String text, OnSendMessageListener messageListener) {
|
||||
SendData sendData = new SendData(Integer.parseInt(toUid),
|
||||
1,
|
||||
"not",
|
||||
text,
|
||||
"1",
|
||||
1);
|
||||
send(sendData, messageListener);
|
||||
}
|
||||
|
||||
private static void send(SendData sendData, OnSendMessageListener messageListener) {
|
||||
OTONetManager.getInstance(null)
|
||||
.sendMessage(sendData.toUid,
|
||||
sendData.type,
|
||||
sendData.giftId,
|
||||
sendData.content,
|
||||
sendData.time,
|
||||
sendData.online,
|
||||
"before",
|
||||
new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
if (data.getCode() != 0) {
|
||||
OTONetManager.getInstance(null)
|
||||
.getMessageConsumeConfig(sendData.toUid + "", new HttpCallback<MessageConsumeConfigBean>() {
|
||||
@Override
|
||||
public void onSuccess(MessageConsumeConfigBean data) {
|
||||
String msg;
|
||||
if (sendData.type == 2) {
|
||||
msg = data.getVideoPrice() + "";
|
||||
} else if (sendData.type == 5) {
|
||||
msg = data.getMp3Price() + "";
|
||||
} else {
|
||||
msg = data.getPrice() + "";
|
||||
}
|
||||
messageListener.onError(OnSendMessageListener.STATUS_NOT_PRICE, msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
String token = UUID.randomUUID().toString();
|
||||
cache.put(token, sendData);
|
||||
messageListener.onSuccess(token);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
messageListener.onError(OnSendMessageListener.STATUS_ERROR, error);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public static void onCallSuccess(String token, OnSendMessageListener listener) {
|
||||
if (cache.containsKey(token)) {
|
||||
SendData sendData = cache.get(token);
|
||||
assert sendData != null;
|
||||
OTONetManager.getInstance(null)
|
||||
.sendMessage(sendData.toUid,
|
||||
sendData.type,
|
||||
sendData.giftId,
|
||||
sendData.content,
|
||||
sendData.time,
|
||||
sendData.online,
|
||||
"after",
|
||||
new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel sd) {
|
||||
if (sd.getCode() != 0) {
|
||||
listener.onSuccess(sd.getMsg());
|
||||
} else {
|
||||
cache.remove(token);
|
||||
listener.onSuccess(null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
listener.onError(OnSendMessageListener.STATUS_ERROR, error);
|
||||
}
|
||||
}
|
||||
);
|
||||
} else {
|
||||
if (listener != null) {
|
||||
listener.onError(OnSendMessageListener.STATUS_ERROR, "消息发送异常");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void cancel(String token) {
|
||||
cache.remove(token);
|
||||
}
|
||||
|
||||
public static class SendData {
|
||||
private int toUid;
|
||||
private int type;
|
||||
private String giftId;
|
||||
private String content;
|
||||
private String time;
|
||||
private int online;
|
||||
|
||||
public SendData(int toUid, int type, String giftId, String content, String time, int online) {
|
||||
this.toUid = toUid;
|
||||
this.type = type;
|
||||
this.giftId = giftId;
|
||||
this.content = content;
|
||||
this.time = time;
|
||||
this.online = online;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,9 +1,11 @@
|
||||
package com.shayu.onetoone.network;
|
||||
|
||||
import com.shayu.onetoone.bean.AvatarBean;
|
||||
import com.shayu.onetoone.bean.GiftBean;
|
||||
import com.shayu.onetoone.bean.GreetBean;
|
||||
import com.shayu.onetoone.bean.HomeItemBean;
|
||||
import com.shayu.onetoone.bean.JoinAnchorBean;
|
||||
import com.shayu.onetoone.bean.MessageConsumeConfigBean;
|
||||
import com.shayu.onetoone.bean.OfficialNoticeBean;
|
||||
import com.shayu.onetoone.bean.SystemMessageBean;
|
||||
import com.shayu.onetoone.bean.TargetUserInfoBean;
|
||||
@ -30,7 +32,6 @@ import retrofit2.http.Query;
|
||||
public interface OneToOneApi {
|
||||
/**
|
||||
* 用户手机号登录
|
||||
*
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/api/public/?service=Login.userLogin")
|
||||
@ -46,63 +47,94 @@ public interface OneToOneApi {
|
||||
* 用户手机号登录
|
||||
*/
|
||||
@GET("/api/public/?service=Friendappinfos.getInfo")
|
||||
Observable<ResponseModel<UserBean>> getBaseInfos(@Query("login")int login);
|
||||
Observable<ResponseModel<UserBean>> getBaseInfos(@Query("login") int login);
|
||||
|
||||
@GET("/api/public/?service=Home.getRandJoinAnchor")
|
||||
Observable<ResponseModel<List<JoinAnchorBean>>> getRandJoinAnchor();
|
||||
|
||||
@GET("/api/public/?service=Home.getCustomerService")
|
||||
Observable<ResponseModel<List<String>>> getCustomerService();
|
||||
|
||||
@GET("/api/public/?service=Login.userLoginByThird")
|
||||
Observable<ResponseModel<IMLoginModel>> userLoginByThird(@Query("user_id")String uid,
|
||||
@Query("openid") String openId,
|
||||
@Query("admin_id") String promCode,
|
||||
@Query("uuid_Device") String uuid,
|
||||
@Query("nicename") String nickName,
|
||||
@Query("avatar") String avatar,
|
||||
@Query("app_source")String source,
|
||||
@Query("source")String devices,
|
||||
@Query("sign")String sign,
|
||||
@Query("lastlogindevice")String lastlogindevice,
|
||||
@Query("type") String type,
|
||||
@Query("pushid")String pushid
|
||||
Observable<ResponseModel<IMLoginModel>> userLoginByThird(@Query("user_id") String uid,
|
||||
@Query("openid") String openId,
|
||||
@Query("admin_id") String promCode,
|
||||
@Query("uuid_Device") String uuid,
|
||||
@Query("nicename") String nickName,
|
||||
@Query("avatar") String avatar,
|
||||
@Query("app_source") String source,
|
||||
@Query("source") String devices,
|
||||
@Query("sign") String sign,
|
||||
@Query("lastlogindevice") String lastlogindevice,
|
||||
@Query("type") String type,
|
||||
@Query("pushid") String pushid
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Friendappinfos.getText")
|
||||
Observable<ResponseModel<List<GreetBean>>> getMessageMoreGreetConfig();
|
||||
|
||||
@GET("/api/public/?service=Friendappinfos.addText")
|
||||
Observable<ResponseModel<BaseModel>> addMoreGreetConfig( @Query("status")String status,
|
||||
@Query("content")String content,
|
||||
@Query("type")String type);
|
||||
Observable<ResponseModel<BaseModel>> addMoreGreetConfig(@Query("status") String status,
|
||||
@Query("content") String content,
|
||||
@Query("type") String type);
|
||||
|
||||
@GET("/api/public/?service=Friendappinfos.editText")
|
||||
Observable<ResponseModel<BaseModel>> setMoreGreetConfig( @Query("id")String id,
|
||||
@Query("status")String status,
|
||||
@Query("content")String content,
|
||||
@Query("type")String type);
|
||||
Observable<ResponseModel<BaseModel>> setMoreGreetConfig(@Query("id") String id,
|
||||
@Query("status") String status,
|
||||
@Query("content") String content,
|
||||
@Query("type") String type);
|
||||
|
||||
@GET("/api/public/?service=Friendappinfos.delText")
|
||||
Observable<ResponseModel<BaseModel>> removeMoreGreetConfig( @Query("id")String id);
|
||||
Observable<ResponseModel<BaseModel>> removeMoreGreetConfig(@Query("id") String id);
|
||||
|
||||
@GET("/api/public/?service=Friendappinfos.cleanText")
|
||||
Observable<ResponseModel<BaseModel>> cleanMoreGreetConfig();
|
||||
|
||||
@GET("/api/public/?service=Friendappinfos.isHolle")
|
||||
Observable<ResponseModel<Integer>> getGreetConfigStatus();
|
||||
|
||||
@GET("/api/public/?service=Friendappinfos.setTextStatus")
|
||||
Observable<ResponseModel<BaseModel>> setGreetConfigGreet( @Query("id")String id, @Query("status")String status);
|
||||
Observable<ResponseModel<BaseModel>> setGreetConfigGreet(@Query("id") String id, @Query("status") String status);
|
||||
|
||||
@Multipart
|
||||
@POST("/api/public/?service=Friendappinfos.updateAvatar")
|
||||
Observable<ResponseModel<AvatarBean>> updateFile(@Part MultipartBody.Part file,@Query("uid")String uid,@Query("token")String token);
|
||||
Observable<ResponseModel<AvatarBean>> updateFile(@Part MultipartBody.Part file, @Query("uid") String uid, @Query("token") String token);
|
||||
|
||||
@GET("/api/public/?service=Message.getLists")
|
||||
Observable<ResponseModel<List<OfficialNoticeBean>>> getLists();
|
||||
|
||||
@GET("/api/public/?service=Friendappinfos.getOtherInfo")
|
||||
Observable<ResponseModel<UserBean>> getTargetUserInfo(@Query("tuid")int id);
|
||||
Observable<ResponseModel<UserBean>> getTargetUserInfo(@Query("tuid") int id);
|
||||
|
||||
@GET("/api/public/?service=Friendappinfos.getOtherList")
|
||||
Observable<ResponseModel<List<TargetUserInfoBean>>> getTargetUserInfoList(@Query("ids")String ids);
|
||||
Observable<ResponseModel<List<TargetUserInfoBean>>> getTargetUserInfoList(@Query("ids") String ids);
|
||||
|
||||
@GET("/api/public/?service=Friendappuser.hot")
|
||||
Observable<ResponseModel<List<HomeItemBean>>> getHomeHot();
|
||||
|
||||
@GET("/api/public/?service=Friendappuser.recommend")
|
||||
Observable<ResponseModel<List<HomeItemBean>>> getHomeRecommend();
|
||||
|
||||
@GET("/api/public/?service=Message.getListInfo")
|
||||
Observable<ResponseModel<List<SystemMessageBean>>> getSystemMessageList(@Query("type")int type);
|
||||
Observable<ResponseModel<List<SystemMessageBean>>> getSystemMessageList(@Query("type") int type);
|
||||
|
||||
@GET("/api/public/?service=Friendappmsg.sendAfter")
|
||||
Observable<ResponseModel<List<BaseModel>>> sendMessage(
|
||||
@Query("tuid") int tuid,
|
||||
@Query("type") int type,
|
||||
@Query("gift_id") String giftId,
|
||||
@Query("msg") String msg,
|
||||
@Query("time") String time,
|
||||
@Query("online") int online,
|
||||
@Query("method") String method
|
||||
);
|
||||
|
||||
@GET("/api/public/?service=Friendappmsg.getConfig")
|
||||
Observable<ResponseModel<MessageConsumeConfigBean>> getMessageConsumeConfig(@Query("tuid") String toUid);
|
||||
|
||||
@GET("/api/public/?service=Friendappmsg.giftList")
|
||||
Observable<ResponseModel<List<GiftBean>>> getGiftList();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,57 @@
|
||||
package com.shayu.onetoone.provider;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Spannable;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.MessageChatGiftContent;
|
||||
import com.shayu.onetoone.bean.MessageChatGiftContent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imkit.conversation.messgelist.provider.BaseMessageItemProvider;
|
||||
import io.rong.imkit.model.UiMessage;
|
||||
import io.rong.imkit.widget.adapter.IViewProviderListener;
|
||||
import io.rong.imkit.widget.adapter.ViewHolder;
|
||||
import io.rong.imlib.model.MessageContent;
|
||||
|
||||
public class MessageChatReceiveGiftItemProvider extends BaseMessageItemProvider<MessageChatGiftContent> {
|
||||
private Context mContext;
|
||||
|
||||
public MessageChatReceiveGiftItemProvider(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
mConfig.showPortrait = false;
|
||||
mConfig.showSummaryWithName = false;
|
||||
mConfig.showContentBubble = false;
|
||||
mConfig.centerInHorizontal = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ViewHolder onCreateMessageContentViewHolder(ViewGroup parent, int viewType) {
|
||||
return ViewHolder.createViewHolder(mContext, parent, R.layout.view_message_chat_receive_gift);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void bindMessageContentViewHolder(ViewHolder holder, ViewHolder parentHolder, MessageChatGiftContent messageChatGiftContent, UiMessage uiMessage, int position, List<UiMessage> list, IViewProviderListener<UiMessage> listener) {
|
||||
holder.setText(R.id.title, messageChatGiftContent.getTitle());
|
||||
holder.setText(R.id.description, messageChatGiftContent.getContent());
|
||||
ImgLoader.display(mContext, messageChatGiftContent.getImageUrl(), holder.getView(R.id.giftIcon));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onItemClick(ViewHolder holder, MessageChatGiftContent messageChatGiftContent, UiMessage uiMessage, int position, List<UiMessage> list, IViewProviderListener<UiMessage> listener) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isMessageViewType(MessageContent messageContent) {
|
||||
return messageContent instanceof MessageChatGiftContent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Spannable getSummarySpannable(Context context, MessageChatGiftContent messageChatGiftContent) {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
package com.shayu.onetoone.provider;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.imlib.model.MessageContent;
|
||||
import io.rong.message.MessageHandler;
|
||||
|
||||
public class MessageChatTipHandler extends MessageHandler {
|
||||
public MessageChatTipHandler(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decodeMessage(Message message, MessageContent content) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void encodeMessage(Message message) {
|
||||
|
||||
}
|
||||
}
|
9
OneToOne/src/main/res/drawable/bg_button.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="51dp" android:height="29dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#ff8e7ddf" />
|
||||
<corners android:topLeftRadius="6dp" android:topRightRadius="6dp" android:bottomLeftRadius="6dp" android:bottomRightRadius="6dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
9
OneToOne/src/main/res/drawable/bg_chat_gift.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="136dp" android:height="54dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#ffffffff" />
|
||||
<corners android:topLeftRadius="2dp" android:topRightRadius="8dp" android:bottomLeftRadius="8dp" android:bottomRightRadius="8dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
13
OneToOne/src/main/res/drawable/bg_dialog_tip.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="254dp" android:height="173dp">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:type="linear" android:useLevel="true"
|
||||
android:endColor="#fff0edfe"
|
||||
android:centerColor="#ffebe7ff"
|
||||
android:startColor="#bff1eeff"
|
||||
android:angle="360" />
|
||||
<corners android:topLeftRadius="10dp" android:topRightRadius="10dp" android:bottomLeftRadius="10dp" android:bottomRightRadius="10dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
9
OneToOne/src/main/res/drawable/bg_dialog_tip_apply.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="70dp" android:height="38dp">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:type="linear" android:useLevel="true" android:endColor="#ff907cdf" android:startColor="#ffd96ef1" android:angle="135" />
|
||||
<corners android:topLeftRadius="19dp" android:topRightRadius="19dp" android:bottomLeftRadius="19dp" android:bottomRightRadius="19dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
9
OneToOne/src/main/res/drawable/bg_dialog_tip_cancel.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="46dp" android:height="16dp">
|
||||
<shape android:shape="rectangle">
|
||||
<stroke android:width="1dp" android:color="#A9A9A9" />
|
||||
<corners android:topLeftRadius="19dp" android:topRightRadius="19dp" android:bottomLeftRadius="19dp" android:bottomRightRadius="19dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
9
OneToOne/src/main/res/drawable/bg_gift_select.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="57dp" android:height="79dp">
|
||||
<shape android:shape="rectangle">
|
||||
<stroke android:width="1dp" android:color="#ff8e7ddf" />
|
||||
<corners android:topLeftRadius="4dp" android:topRightRadius="4dp" android:bottomLeftRadius="4dp" android:bottomRightRadius="4dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
9
OneToOne/src/main/res/drawable/bg_gift_top_up.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="31dp" android:height="14dp">
|
||||
<shape android:shape="rectangle">
|
||||
<stroke android:width="1dp" android:color="#ffff8037" />
|
||||
<corners android:topLeftRadius="7dp" android:topRightRadius="7dp" android:bottomLeftRadius="7dp" android:bottomRightRadius="7dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
9
OneToOne/src/main/res/drawable/bg_home_hot_cover.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="167dp" android:height="167dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#b3ffffff" />
|
||||
<corners android:topLeftRadius="8dp" android:topRightRadius="7dp" android:bottomLeftRadius="0dp" android:bottomRightRadius="7dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
142
OneToOne/src/main/res/layout/activity_call_video.xml
Normal file
@ -0,0 +1,142 @@
|
||||
<?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.view.SurfaceView
|
||||
android:id="@+id/my_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<android.view.SurfaceView
|
||||
android:id="@+id/target_view"
|
||||
android:layout_width="114dp"
|
||||
android:layout_height="164dp"
|
||||
android:layout_marginTop="124dp"
|
||||
android:layout_marginEnd="17dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/call_stop"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="41dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:srcCompat="@mipmap/ic_call_stop" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/gift"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/call_stop"
|
||||
app:layout_constraintEnd_toStartOf="@+id/call_stop"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/call_stop"
|
||||
app:srcCompat="@mipmap/ic_call_gift" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/message"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/call_stop"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/call_stop"
|
||||
app:layout_constraintTop_toTopOf="@+id/call_stop"
|
||||
app:srcCompat="@mipmap/ic_call_msg" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/camera_close_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="44dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/call_stop"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:srcCompat="@mipmap/ic_call_video_select" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/camera_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/camera_close_switch"
|
||||
app:layout_constraintEnd_toStartOf="@+id/camera_close_switch"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/camera_close_switch"
|
||||
app:srcCompat="@mipmap/ic_call_camera" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mic_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/camera_close_switch"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/camera_close_switch"
|
||||
app:layout_constraintTop_toTopOf="@+id/camera_close_switch"
|
||||
app:srcCompat="@mipmap/ic_call_audio" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/money"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="30dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/camera_switch"
|
||||
app:layout_constraintEnd_toEndOf="@+id/camera_switch"
|
||||
app:layout_constraintStart_toStartOf="@+id/camera_switch"
|
||||
app:srcCompat="@mipmap/ic_call_money" />
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginStart="17dp"
|
||||
android:layout_marginTop="35dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/m_chu_xia"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="18dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/avatar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/avatar"
|
||||
app:srcCompat="@mipmap/ic_call_close" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/follow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="-10dp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/avatar"
|
||||
app:layout_constraintStart_toStartOf="@+id/avatar"
|
||||
app:layout_constraintTop_toBottomOf="@+id/avatar"
|
||||
app:srcCompat="@mipmap/ic_call_follow" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/follow_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="12sp"
|
||||
android:layout_marginTop="4dp"
|
||||
tools:text="未关注"
|
||||
app:layout_constraintEnd_toEndOf="@+id/avatar"
|
||||
app:layout_constraintStart_toStartOf="@+id/avatar"
|
||||
app:layout_constraintTop_toBottomOf="@+id/follow" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
58
OneToOne/src/main/res/layout/dialog_tips1.xml
Normal file
@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_dialog_tip"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="21dp"
|
||||
android:gravity="center"
|
||||
tools:text="餘額不足"
|
||||
android:textColor="#333333"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="14dp"
|
||||
android:layout_marginTop="9dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:gravity="center"
|
||||
tools:text="與TA視頻聊天每分鐘續消耗299鑽石,您可通過充值獲取更多鑽石,以便繼續聊天" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
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_tip_cancel"
|
||||
android:text="離開"
|
||||
android:textColor="#333333"
|
||||
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>
|
67
OneToOne/src/main/res/layout/item_gift.xml
Normal file
@ -0,0 +1,67 @@
|
||||
<?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="79dp">
|
||||
|
||||
<View
|
||||
android:id="@+id/bg_select"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/bg_gift_select"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/gift_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/ic_call_gift" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gift_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:textColor="#333333"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/gift_icon"
|
||||
tools:text="棉花糖" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/gift_name">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="13dp"
|
||||
android:layout_height="13dp"
|
||||
android:layout_gravity="center"
|
||||
app:srcCompat="@mipmap/home_me_diamonds" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/money"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:textColor="#999999"
|
||||
android:textSize="10sp"
|
||||
tools:text="123" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -1,15 +1,14 @@
|
||||
<?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="167dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_height="167dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
android:layout_marginTop="16dp">
|
||||
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/cover"
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
@ -19,13 +18,27 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_corner_radius="10dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_home_hot_cover"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_corner_radius="10dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/ic_home_hot_status" />
|
||||
app:srcCompat="@mipmap/ic_home_hot_status_online" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_chat"
|
||||
android:layout_width="60dp"
|
||||
@ -38,46 +51,23 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="11dp"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="花花"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:textColor="#FFFFFF"
|
||||
android:maxEms="5"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:background="@drawable/bg_home_hot_sex"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/user_name"
|
||||
app:layout_constraintStart_toEndOf="@+id/user_name"
|
||||
app:layout_constraintTop_toTopOf="@+id/user_name">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sex"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="12dp"
|
||||
android:layout_marginStart="5dp"
|
||||
app:srcCompat="@mipmap/ic_home_hot_woman" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/age"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="21"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
app:layout_constraintEnd_toStartOf="@+id/btn_chat"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:text="花花花花花花花花" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout3"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
@ -104,4 +94,32 @@
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:background="@drawable/bg_home_hot_sex"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/linearLayout3"
|
||||
app:layout_constraintStart_toEndOf="@+id/linearLayout3"
|
||||
app:layout_constraintTop_toTopOf="@+id/linearLayout3">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sex"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="12dp"
|
||||
android:layout_marginStart="5dp"
|
||||
app:srcCompat="@mipmap/ic_home_hot_woman" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/age"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="21"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -65,6 +65,13 @@
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/auth"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/ic_home_auth" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
@ -160,9 +160,8 @@
|
||||
android:src="@mipmap/ic_msg_add" />
|
||||
</LinearLayout>
|
||||
|
||||
<include
|
||||
<View
|
||||
android:id="@+id/audio_layout"
|
||||
layout="@layout/view_message_input_audio"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="190dp"
|
||||
android:visibility="gone"
|
||||
|
@ -0,0 +1,45 @@
|
||||
<?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="wrap_content"
|
||||
android:layout_height="50dp"
|
||||
android:background="@drawable/bg_chat_gift">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="11dp"
|
||||
android:textColor="#333333"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="送給你" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:textColor="#888888"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/giftIcon"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title"
|
||||
tools:text="「戀愛小氣球」✖️1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/giftIcon"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/apple" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
77
OneToOne/src/main/res/layout/view_message_input_gift.xml
Normal file
@ -0,0 +1,77 @@
|
||||
<?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="190dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/gift_list"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:layout_constraintBottom_toTopOf="@+id/bottom_layout"
|
||||
tools:listitem="@layout/item_gift"
|
||||
app:spanCount="4"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/bottom_layout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="30dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_gravity="center"
|
||||
app:srcCompat="@mipmap/home_me_diamonds" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/money"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:textColor="#999999"
|
||||
android:textSize="12sp"
|
||||
tools:text="139999992" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/top_up_btn"
|
||||
android:layout_width="31dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="6dp"
|
||||
android:background="@drawable/bg_gift_top_up"
|
||||
android:textColor="#FFB554"
|
||||
android:textSize="10sp"
|
||||
tools:text="充值" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/send_btn"
|
||||
android:layout_width="51dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/bg_button"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="發送" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_call_audio.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_call_audio_select.png
Normal file
After Width: | Height: | Size: 8.5 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_call_camera.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_call_close.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_call_follow.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_call_gift.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_call_money.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_call_msg.png
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_call_stop.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_call_video.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_call_video_select.png
Normal file
After Width: | Height: | Size: 7.6 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_home_auth.png
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_home_hot_man.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_home_hot_status_busy.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |