update
@ -1,8 +1,6 @@
|
||||
package com.shayu.onetoone;
|
||||
|
||||
|
||||
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Process;
|
||||
@ -12,16 +10,22 @@ import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.facebook.FacebookSdk;
|
||||
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.MessageChatTipsItemProvider;
|
||||
import com.shayu.onetoone.utils.NeverCrashUtils;
|
||||
import com.yunbao.common.BuildConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.manager.imrongcloud.InstructorSendReward;
|
||||
import com.yunbao.common.manager.imrongcloud.InstructorSendRewardProvider;
|
||||
import com.yunbao.common.manager.imrongcloud.RecommendLiveRoom;
|
||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import io.rong.imkit.RongIM;
|
||||
import io.rong.imkit.config.RongConfigCenter;
|
||||
import io.rong.imkit.conversationlist.model.BaseUiConversation;
|
||||
@ -65,26 +69,35 @@ public class AppContext extends CommonAppContext {
|
||||
ARouter.printStackTrace();
|
||||
ARouter.init(this);
|
||||
|
||||
|
||||
ProviderManager<BaseUiConversation> providerManager = RongConfigCenter.conversationListConfig().getProviderManager();
|
||||
providerManager.replaceProvider(PrivateConversationProvider.class, new CustomConversationProvider());
|
||||
|
||||
|
||||
ArrayList<Class<? extends MessageContent>> myMessages = new ArrayList<>();
|
||||
myMessages.add(MessageChatTipsContent.class);
|
||||
RongIMClient.registerMessageType(myMessages);
|
||||
|
||||
RongConfigCenter.conversationConfig().addMessageProvider(new InstructorSendRewardProvider(getApplicationContext()));
|
||||
RongConfigCenter.conversationConfig().addMessageProvider(new MessageChatTipsItemProvider(getApplicationContext()));
|
||||
|
||||
String appKey = "pvxdm17jpd3hr";
|
||||
boolean enablePush = true;
|
||||
RongIM.init(this, appKey, enablePush);
|
||||
RongIM.setConnectionStatusListener(new RongIMClient.ConnectionStatusListener() {
|
||||
@Override
|
||||
public void onChanged(ConnectionStatus status) {
|
||||
Log.i("融云", "onChanged: "+status.getMessage());
|
||||
Log.i("融云", "onChanged: " + status.getMessage());
|
||||
}
|
||||
});
|
||||
ProviderManager<BaseUiConversation> providerManager = RongConfigCenter.conversationListConfig().getProviderManager();
|
||||
providerManager.replaceProvider(PrivateConversationProvider.class,new CustomConversationProvider());
|
||||
|
||||
|
||||
RongcloudIMManager.initRongIM(this);
|
||||
RongConfigCenter.conversationConfig().addMessageProvider(new InstructorSendRewardProvider(getApplicationContext()));
|
||||
RongcloudIMManager.addRongcloudIMOnReceiveMessageListener(new RongIMClient.OnReceiveMessageWrapperListener() {
|
||||
@Override
|
||||
public boolean onReceived(Message message, int left, boolean hasPackage, boolean offline) {
|
||||
TextMessage content = (TextMessage) message.getContent();
|
||||
ToastUtil.show("收到:"+content.getContent());
|
||||
ToastUtil.show("收到:" + content.getContent());
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
@ -6,15 +6,47 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.angcyo.tablayout.DslTabLayout;
|
||||
import com.angcyo.tablayout.delegate2.ViewPager2Delegate;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activity.fragments.home.HotFragment;
|
||||
import com.shayu.onetoone.activity.fragments.home.RecommendFragment;
|
||||
import com.shayu.onetoone.activity.fragments.message.MsgFriendFragment;
|
||||
import com.shayu.onetoone.activity.fragments.message.MsgMessageFragment;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 交友主页面
|
||||
*/
|
||||
public class FriendsFragment extends BaseFragment {
|
||||
List<BaseFragment> fragments = new ArrayList<>();
|
||||
@Override
|
||||
public void initView(View itemView) {
|
||||
ViewPager2 viewPager2 = itemView.findViewById(R.id.viewPager);
|
||||
DslTabLayout tabLayout = itemView.findViewById(R.id.dslTabLayout);
|
||||
ViewPager2Delegate.Companion.install(viewPager2, tabLayout, false);
|
||||
|
||||
fragments.add(new RecommendFragment());//消息 - 消息
|
||||
fragments.add(new HotFragment()); //消息 - 好友
|
||||
viewPager2.setAdapter(new FragmentStateAdapter(this) {
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment createFragment(int position) {
|
||||
return fragments.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return fragments.size();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,27 +5,52 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
import com.yunbao.common.fragment.BaseFragment;
|
||||
import com.shayu.onetoone.activity.fragments.BaseFragment;
|
||||
import com.shayu.onetoone.adapter.HomeHotListAdapter;
|
||||
import com.yanzhenjie.recyclerview.SwipeRecyclerView;
|
||||
|
||||
import io.rong.imkit.widget.refresh.SmartRefreshLayout;
|
||||
import io.rong.imkit.widget.refresh.api.RefreshLayout;
|
||||
import io.rong.imkit.widget.refresh.listener.OnLoadMoreListener;
|
||||
import io.rong.imkit.widget.refresh.listener.OnRefreshListener;
|
||||
import io.rong.imkit.widget.refresh.wrapper.RongRefreshHeader;
|
||||
|
||||
public class HotFragment extends BaseFragment {
|
||||
SmartRefreshLayout mRefreshLayout;
|
||||
SwipeRecyclerView recyclerView;
|
||||
HomeHotListAdapter adapter;
|
||||
|
||||
@Override
|
||||
public View createView(LayoutInflater inflater, ViewGroup container) {
|
||||
public void initView(View itemView) {
|
||||
recyclerView = itemView.findViewById(R.id.recyclerView);
|
||||
mRefreshLayout = itemView.findViewById(R.id.swipeRefreshLayout);
|
||||
adapter=new HomeHotListAdapter(getContext());
|
||||
recyclerView.setAdapter(adapter);
|
||||
mRefreshLayout.setNestedScrollingEnabled(false);
|
||||
mRefreshLayout.setRefreshHeader(new RongRefreshHeader(this.getContext()));
|
||||
mRefreshLayout.setRefreshFooter(new RongRefreshHeader(this.getContext()));
|
||||
mRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
onConversationListRefresh(refreshLayout);
|
||||
}
|
||||
});
|
||||
this.mRefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
onConversationListLoadMore();
|
||||
}
|
||||
});
|
||||
}
|
||||
private void onConversationListLoadMore() {
|
||||
}
|
||||
|
||||
private void onConversationListRefresh(RefreshLayout refreshLayout) {
|
||||
|
||||
}
|
||||
@Override
|
||||
public View createView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_hot, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initVariables(Bundle bundle) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState, View contentView) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadData() {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -5,27 +5,54 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
import com.yunbao.common.fragment.BaseFragment;
|
||||
import com.shayu.onetoone.activity.fragments.BaseFragment;
|
||||
import com.shayu.onetoone.adapter.HomeRecommendListAdapter;
|
||||
import com.yanzhenjie.recyclerview.SwipeRecyclerView;
|
||||
|
||||
import io.rong.imkit.widget.refresh.SmartRefreshLayout;
|
||||
import io.rong.imkit.widget.refresh.api.RefreshLayout;
|
||||
import io.rong.imkit.widget.refresh.listener.OnLoadMoreListener;
|
||||
import io.rong.imkit.widget.refresh.listener.OnRefreshListener;
|
||||
import io.rong.imkit.widget.refresh.wrapper.RongRefreshHeader;
|
||||
|
||||
public class RecommendFragment extends BaseFragment {
|
||||
SmartRefreshLayout mRefreshLayout;
|
||||
SwipeRecyclerView recyclerView;
|
||||
HomeRecommendListAdapter adapter;
|
||||
|
||||
@Override
|
||||
public View createView(LayoutInflater inflater, ViewGroup container) {
|
||||
public void initView(View itemView) {
|
||||
recyclerView = itemView.findViewById(R.id.recyclerView);
|
||||
mRefreshLayout = itemView.findViewById(R.id.swipeRefreshLayout);
|
||||
adapter=new HomeRecommendListAdapter(getContext());
|
||||
recyclerView.setAdapter(adapter);
|
||||
mRefreshLayout.setNestedScrollingEnabled(false);
|
||||
mRefreshLayout.setRefreshHeader(new RongRefreshHeader(this.getContext()));
|
||||
mRefreshLayout.setRefreshFooter(new RongRefreshHeader(this.getContext()));
|
||||
mRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
onConversationListRefresh(refreshLayout);
|
||||
}
|
||||
});
|
||||
this.mRefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
onConversationListLoadMore();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void onConversationListLoadMore() {
|
||||
}
|
||||
|
||||
private void onConversationListRefresh(RefreshLayout refreshLayout) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public View createView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_recommend, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initVariables(Bundle bundle) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState, View contentView) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadData() {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -8,11 +8,10 @@ import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.FileProvider;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.MessageChatTipsContent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.interfaces.ImageResultCallback;
|
||||
import com.yunbao.common.utils.ProcessImageUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
@ -24,7 +23,6 @@ import java.util.Date;
|
||||
import io.rong.imkit.IMCenter;
|
||||
import io.rong.imkit.conversation.ConversationFragment;
|
||||
import io.rong.imlib.IRongCallback;
|
||||
import io.rong.imlib.ISendMessageCallback;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
@ -49,6 +47,27 @@ public class ChatMessageFragment extends ConversationFragment {
|
||||
cameraUtil = new ProcessImageUtil(getActivity(), "com.shayu.onetoone.fileprovider");
|
||||
mSendBtn.setOnClickListener(v -> sendText());
|
||||
img.setOnClickListener(v -> cameraUtil.getImageByCamera());
|
||||
initCamera();
|
||||
|
||||
call.setOnClickListener(v -> {
|
||||
MessageChatTipsContent bean= MessageChatTipsContent.obtain("【安全提示】為保障您的權益,慶提高警惕,不要輕易添加或提供第三方聯繫方式");
|
||||
IMCenter.getInstance().insertOutgoingMessage(conversationType, targetId, Message.SentStatus.SENT, bean, System.currentTimeMillis(), new RongIMClient.ResultCallback<Message>() {
|
||||
@Override
|
||||
public void onSuccess(Message message) {
|
||||
ToastUtil.show("成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
ToastUtil.show("失败:"+e.getMessage());
|
||||
System.out.println("失败:"+e.getMessage());
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private void initCamera() {
|
||||
cameraUtil.setImageResultCallback(new ImageResultCallback() {
|
||||
@Override
|
||||
public void beforeCamera() {
|
||||
|
@ -9,7 +9,6 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@ -17,21 +16,17 @@ import androidx.lifecycle.Observer;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activity.fragments.BaseFragment;
|
||||
import com.shayu.onetoone.adapter.MsgMessageRecyclerViewAdapter;
|
||||
import com.shayu.onetoone.bean.MsgMessageBean;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.yanzhenjie.recyclerview.OnItemClickListener;
|
||||
import com.yanzhenjie.recyclerview.OnItemMenuClickListener;
|
||||
import com.yanzhenjie.recyclerview.SwipeMenuBridge;
|
||||
import com.yanzhenjie.recyclerview.SwipeMenuCreator;
|
||||
import com.yanzhenjie.recyclerview.SwipeMenuItem;
|
||||
import com.yanzhenjie.recyclerview.SwipeRecyclerView;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -41,7 +36,6 @@ import io.rong.imkit.IMCenter;
|
||||
import io.rong.imkit.config.ConversationListBehaviorListener;
|
||||
import io.rong.imkit.config.RongConfigCenter;
|
||||
import io.rong.imkit.conversationlist.ConversationListAdapter;
|
||||
import io.rong.imkit.conversationlist.ConversationListFragment;
|
||||
import io.rong.imkit.conversationlist.model.BaseUiConversation;
|
||||
import io.rong.imkit.conversationlist.model.GatheredConversation;
|
||||
import io.rong.imkit.conversationlist.viewmodel.ConversationListViewModel;
|
||||
@ -51,7 +45,6 @@ import io.rong.imkit.utils.RouteUtils;
|
||||
import io.rong.imkit.widget.FixedLinearLayoutManager;
|
||||
import io.rong.imkit.widget.adapter.BaseAdapter;
|
||||
import io.rong.imkit.widget.adapter.ViewHolder;
|
||||
import io.rong.imkit.widget.dialog.OptionsPopupDialog;
|
||||
import io.rong.imkit.widget.refresh.SmartRefreshLayout;
|
||||
import io.rong.imkit.widget.refresh.api.RefreshLayout;
|
||||
import io.rong.imkit.widget.refresh.constant.RefreshState;
|
||||
@ -69,7 +62,7 @@ public class MsgMessageFragment extends BaseFragment implements BaseAdapter.OnIt
|
||||
private static final String TAG = MsgMessageFragment.class.getSimpleName();
|
||||
SwipeRecyclerView mList;
|
||||
SmartRefreshLayout mRefreshLayout;
|
||||
ConversationListAdapter mAdapter;
|
||||
MsgMessageRecyclerViewAdapter mAdapter;
|
||||
List<MsgMessageBean> list;
|
||||
|
||||
protected View mNoticeContainerView;
|
||||
@ -83,7 +76,7 @@ public class MsgMessageFragment extends BaseFragment implements BaseAdapter.OnIt
|
||||
public void initView(View itemView) {
|
||||
mList = itemView.findViewById(R.id.recyclerView);
|
||||
mRefreshLayout = itemView.findViewById(R.id.swipeRefreshLayout);
|
||||
mAdapter = new ConversationListAdapter();
|
||||
mAdapter = new MsgMessageRecyclerViewAdapter();
|
||||
list = new ArrayList<>();
|
||||
initData();
|
||||
mList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
|
@ -0,0 +1,43 @@
|
||||
package com.shayu.onetoone.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
|
||||
public class HomeHotListAdapter extends RecyclerView.Adapter<HomeHotListAdapter.ViewHolder>{
|
||||
private Context mContext;
|
||||
|
||||
public HomeHotListAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new ViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_home_hot,parent,false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder{
|
||||
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.shayu.onetoone.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
|
||||
public class HomeRecommendListAdapter extends RecyclerView.Adapter<HomeRecommendListAdapter.ViewHolder>{
|
||||
private Context mContext;
|
||||
|
||||
public HomeRecommendListAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new ViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_home_recommend,parent,false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder{
|
||||
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package com.shayu.onetoone.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.SpannableString;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@ -16,69 +17,29 @@ import com.yunbao.common.glide.ImgLoader;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imkit.conversationlist.ConversationListAdapter;
|
||||
import io.rong.imkit.conversationlist.model.BaseUiConversation;
|
||||
import io.rong.imkit.conversationlist.model.SingleConversation;
|
||||
import io.rong.imkit.widget.adapter.ViewHolder;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
|
||||
/**
|
||||
* 聊天列表适配器
|
||||
*/
|
||||
public class MsgMessageRecyclerViewAdapter extends RecyclerView.Adapter<MsgMessageRecyclerViewAdapter.ViewHolder> {
|
||||
List<MsgMessageBean> list;
|
||||
Context mContext;
|
||||
|
||||
public MsgMessageRecyclerViewAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
public void setList(List<MsgMessageBean> list) {
|
||||
this.list = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public List<MsgMessageBean> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new ViewHolder(LayoutInflater.from(mContext).inflate(R.layout.rc_conversationlist_item, parent, false));
|
||||
}
|
||||
|
||||
public class MsgMessageRecyclerViewAdapter extends ConversationListAdapter {
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
holder.setData(list.get(position), position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
ImageView avatar;
|
||||
TextView name;
|
||||
TextView content;
|
||||
TextView time;
|
||||
TextView read;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
/* avatar = itemView.findViewById(R.id.msg_message_avatar);
|
||||
name = itemView.findViewById(R.id.msg_message_title);
|
||||
content = itemView.findViewById(R.id.msg_message_content);
|
||||
time = itemView.findViewById(R.id.msg_message_content_time);
|
||||
read = itemView.findViewById(R.id.msg_message_content_not_read);*/
|
||||
}
|
||||
|
||||
public void setData(MsgMessageBean bean, int position) {
|
||||
if (bean.isNotRead()) {
|
||||
read.setVisibility(View.VISIBLE);
|
||||
read.setText(bean.getNotReadNum() + "");
|
||||
BaseUiConversation uiConversation = mDataList.get(position);
|
||||
if (uiConversation.mCore.getConversationType() == Conversation.ConversationType.PRIVATE) {
|
||||
SingleConversation conversation = (SingleConversation) uiConversation;
|
||||
if (conversation.mConversationContent.length() >= 6) {
|
||||
conversation.mConversationContent = new SpannableString(conversation.mConversationContent.toString().substring(0, 6) + "...·");
|
||||
} else {
|
||||
read.setVisibility(View.GONE);
|
||||
conversation.mConversationContent = new SpannableString(conversation.mConversationContent.toString() + " ·");
|
||||
}
|
||||
ImgLoader.display(mContext, bean.getAvatar(), avatar);
|
||||
name.setText(bean.getNickname());
|
||||
content.setText(bean.getContent());
|
||||
time.setText(String.format("·%s", bean.getTime()));
|
||||
} else if (uiConversation.mCore.getConversationType() == Conversation.ConversationType.GROUP) {
|
||||
mDataList.remove(position);
|
||||
}
|
||||
super.onBindViewHolder(holder, position);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,123 @@
|
||||
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 = "MessageChatTipsContent", flag = MessageTag.ISPERSISTED)
|
||||
public class MessageChatTipsContent extends MessageContent implements Parcelable {
|
||||
private String content;
|
||||
|
||||
private MessageChatTipsContent() {
|
||||
}
|
||||
public MessageChatTipsContent(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");
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
}
|
||||
}
|
||||
|
||||
public MessageChatTipsContent setContent(String content) {
|
||||
this.content = content;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
protected MessageChatTipsContent(Parcel in) {
|
||||
setExtra(ParcelUtils.readFromParcel(in));
|
||||
setContent(ParcelUtils.readFromParcel(in));
|
||||
}
|
||||
// 快速构建消息对象方法
|
||||
public static MessageChatTipsContent obtain(String content) {
|
||||
MessageChatTipsContent msg = new MessageChatTipsContent();
|
||||
msg.content = content;
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
public static final Creator<MessageChatTipsContent> CREATOR = new Creator<MessageChatTipsContent>() {
|
||||
@Override
|
||||
public MessageChatTipsContent createFromParcel(Parcel in) {
|
||||
return new MessageChatTipsContent(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageChatTipsContent[] newArray(int size) {
|
||||
return new MessageChatTipsContent[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);
|
||||
} 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);
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
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) {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
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.MessageChatTipsContent;
|
||||
|
||||
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 MessageChatTipsItemProvider extends BaseMessageItemProvider<MessageChatTipsContent> {
|
||||
private Context mContext;
|
||||
|
||||
public MessageChatTipsItemProvider(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_tip);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void bindMessageContentViewHolder(ViewHolder holder, ViewHolder parentHolder, MessageChatTipsContent messageChatTipsContent, UiMessage uiMessage, int position, List<UiMessage> list, IViewProviderListener<UiMessage> listener) {
|
||||
holder.setText(R.id.tips, messageChatTipsContent.getContent());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onItemClick(ViewHolder holder, MessageChatTipsContent messageChatTipsContent, UiMessage uiMessage, int position, List<UiMessage> list, IViewProviderListener<UiMessage> listener) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isMessageViewType(MessageContent messageContent) {
|
||||
return messageContent instanceof MessageChatTipsContent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Spannable getSummarySpannable(Context context, MessageChatTipsContent messageChatTipsContent) {
|
||||
return null;
|
||||
}
|
||||
}
|
9
OneToOne/src/main/res/drawable/bg_home_hot_sex.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="33dp" android:height="12dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#80666666" />
|
||||
<corners android:topLeftRadius="8dp" android:topRightRadius="7dp" android:bottomLeftRadius="7dp" android:bottomRightRadius="7dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="56dp" android:height="16dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#ffffe8f8" />
|
||||
<corners android:topLeftRadius="9dp" android:topRightRadius="9dp" android:bottomLeftRadius="9dp" android:bottomRightRadius="9dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
9
OneToOne/src/main/res/drawable/bg_home_recommend_tag.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="#ffdbdbdb" />
|
||||
<corners android:topLeftRadius="8dp" android:topRightRadius="8dp" android:bottomLeftRadius="8dp" android:bottomRightRadius="8dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
9
OneToOne/src/main/res/drawable/bg_message_chat_tip.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="261dp" android:height="50dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#99ededed" />
|
||||
<corners android:topLeftRadius="8dp" android:topRightRadius="8dp" android:bottomLeftRadius="8dp" android:bottomRightRadius="8dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="44dp" android:height="19dp">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:type="linear" android:useLevel="true" android:endColor="#fffeb29c" android:startColor="#ffff70ee" android:angle="135" />
|
||||
<corners android:topLeftRadius="19dp" android:topRightRadius="19dp" android:bottomLeftRadius="19dp" android:bottomRightRadius="19dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="64dp" android:height="26dp">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:type="linear" android:useLevel="true" android:endColor="#ffffb29c" android:startColor="#ffff76e8" android:angle="180" />
|
||||
<corners android:topLeftRadius="13dp" android:topRightRadius="0dp" android:bottomLeftRadius="13dp" android:bottomRightRadius="0dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="16dp" android:height="16dp">
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="#ffefefef" />
|
||||
<corners android:topLeftRadius="0dp" android:topRightRadius="0dp" android:bottomLeftRadius="0dp" android:bottomRightRadius="0dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="5dp" android:height="5dp">
|
||||
<shape android:shape="oval">
|
||||
<gradient android:type="linear" android:useLevel="true" android:startColor="#ff967ce2" android:endColor="#ffd56ff1" android:angle="180" />
|
||||
<corners android:radius="5dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
@ -2,8 +2,18 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="26dp"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<include
|
||||
android:id="@+id/include2"
|
||||
layout="@layout/view_message_msg_bar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/container"
|
||||
android:layout_width="0dp"
|
||||
@ -11,5 +21,5 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/include2" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -4,18 +4,24 @@
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<io.rong.imkit.widget.refresh.SmartRefreshLayout
|
||||
android:id="@+id/swipeRefreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.yanzhenjie.recyclerview.SwipeRecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
tools:listitem="@layout/rc_conversationlist_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="2"
|
||||
tools:listitem="@layout/item_home_hot" />
|
||||
</io.rong.imkit.widget.refresh.SmartRefreshLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -2,6 +2,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#F7F7F7"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<ImageView
|
||||
|
@ -1,24 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<io.rong.imkit.widget.refresh.SmartRefreshLayout
|
||||
android:id="@+id/swipeRefreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.yanzhenjie.recyclerview.SwipeRecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
tools:listitem="@layout/rc_conversationlist_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
android:layout_height="match_parent"
|
||||
tools:listitem="@layout/item_home_recommend" />
|
||||
</io.rong.imkit.widget.refresh.SmartRefreshLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_top_list"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -1,6 +1,107 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
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">
|
||||
|
||||
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/m_chu_xia"
|
||||
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" />
|
||||
<ImageView
|
||||
android:id="@+id/btn_chat"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="27dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:srcCompat="@mipmap/ic_home_hot_chat" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="11dp"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="花花"
|
||||
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>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="@mipmap/bg_home_hot_live"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toTopOf="@+id/user_name"
|
||||
app:layout_constraintStart_toStartOf="@+id/user_name">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ic_level"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="12dp"
|
||||
android:layout_marginStart="5dp"
|
||||
app:srcCompat="@mipmap/ic_home_hot_woman" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/level"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2dp"
|
||||
android:text="LV.21"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -1,11 +1,11 @@
|
||||
<?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:background="@drawable/bg_home_recommend_item"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_height="84dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
android:background="@drawable/bg_home_recommend_item">
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@ -42,8 +42,10 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/btn_chat_up"
|
||||
@ -52,15 +54,46 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView5"
|
||||
android:id="@+id/user_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TextView" />
|
||||
android:text="TextView"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/user_tag_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/star_up"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_home_recommend_star_sign"
|
||||
android:padding="2dp"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:text="21·水瓶座"
|
||||
android:textColor="#FF37C4"
|
||||
android:textSize="10sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user_sign"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TextView"
|
||||
android:textColor="#888888"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
|
@ -2,6 +2,7 @@
|
||||
<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:background="#F7F7F7"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
24
OneToOne/src/main/res/layout/view_message_chat_tip.xml
Normal file
@ -0,0 +1,24 @@
|
||||
<?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="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tips"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_message_chat_tip"
|
||||
android:maxWidth="261dp"
|
||||
android:padding="5dp"
|
||||
android:paddingStart="11dp"
|
||||
android:paddingEnd="11dp"
|
||||
android:text="【安全提示】為保障您的權益,慶提高警惕,不要輕易添加或提供第三方聯繫方式"
|
||||
android:textColor="#76777B"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
197
OneToOne/src/main/res/layout/view_message_msg_bar.xml
Normal file
@ -0,0 +1,197 @@
|
||||
<?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="135dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_back"
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/ic_top_break" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/more"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="21dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/follow"
|
||||
app:srcCompat="@mipmap/ic_message_msg_more" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/follow"
|
||||
android:layout_width="54dp"
|
||||
android:layout_height="23dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:background="@drawable/bg_message_msg_bar_follow"
|
||||
android:text="关注"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="10dp"
|
||||
app:layout_constraintEnd_toStartOf="@+id/more"
|
||||
app:layout_constraintTop_toTopOf="@+id/btn_back" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout2"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:background="@drawable/bg_message_msg_bar_read_num"
|
||||
app:layout_constraintStart_toEndOf="@+id/btn_back"
|
||||
app:layout_constraintTop_toTopOf="@+id/btn_back">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="99"
|
||||
android:textColor="#555555"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="91dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:background="@drawable/bg_home_recommend_item"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout2">
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginStart="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/m_chu_xia"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sex"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:srcCompat="@mipmap/ic_message_tab_woman" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/home"
|
||||
app:layout_constraintStart_toEndOf="@+id/constraintLayout"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TextView"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="5dp"
|
||||
android:src="@mipmap/ic_message_msg_status" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/user_tag_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/star_up"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@mipmap/bg_message_msg_title_heartbeat"
|
||||
android:gravity="center_horizontal"
|
||||
android:padding="3dp"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:text="心动值95%"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="10sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<View
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="5dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/ic_message_msg_bar_decorate" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user_sign"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="TextView"
|
||||
android:textColor="#888888"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/home"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="26dp"
|
||||
android:background="@drawable/bg_message_msg_bar_home"
|
||||
android:gravity="center"
|
||||
android:paddingStart="14dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:text="查看主页"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
BIN
OneToOne/src/main/res/mipmap-xxhdpi/bg_home_hot_live.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 11 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_home_hot_chat.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_home_hot_chat_up.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_home_hot_status.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_home_hot_woman.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_home_man.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_message_msg_more.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
OneToOne/src/main/res/mipmap-xxhdpi/ic_message_msg_status.png
Normal file
After Width: | Height: | Size: 5.2 KiB |