update
This commit is contained in:
parent
2bdc95b3b5
commit
676aba70e7
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.shayu.onetoone" >
|
||||
package="com.shayu.onetoone">
|
||||
|
||||
<uses-permission
|
||||
android:name="android.permission.CALL_PHONE"
|
||||
@ -93,7 +93,7 @@
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
tools:replace="theme,label,icon,allowBackup" >
|
||||
tools:replace="theme,label,icon,allowBackup">
|
||||
<activity
|
||||
android:name=".activity.login.TagselectionActivity"
|
||||
android:exported="false" />
|
||||
@ -107,7 +107,7 @@
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.LauncherActivity"
|
||||
android:exported="true" >
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@ -135,12 +135,18 @@
|
||||
<activity
|
||||
android:name=".activity.login.RegisterActivity"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.WebViewActivity"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.message.SystemMessageActivity"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="com.shayu.onetoone.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true" >
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths" />
|
||||
|
@ -0,0 +1,108 @@
|
||||
package com.shayu.onetoone.activity;
|
||||
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.webkit.ValueCallback;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebResourceRequest;
|
||||
import android.webkit.WebResourceResponse;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.utils.AndroidBug5497Workaround;
|
||||
import com.yunbao.common.utils.JavascriptInterfaceUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
@Route(path = RouteManager.ACTIVITY_WEB_VIEW)
|
||||
public class WebViewActivity extends AbsOTOActivity {
|
||||
WebView webView;
|
||||
String titleString;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_webview;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main(Bundle savedInstanceState) {
|
||||
webView = findViewById(R.id.webView);
|
||||
titleString = getIntent().getStringExtra("title");
|
||||
if (!StringUtil.isEmpty(titleString)) {
|
||||
setTitle(titleString);
|
||||
}
|
||||
initWebView();
|
||||
}
|
||||
|
||||
private void initWebView() {
|
||||
WebSettings settings = webView.getSettings();
|
||||
settings.setJavaScriptEnabled(true); // 是否开启JS支持
|
||||
settings.setJavaScriptCanOpenWindowsAutomatically(true); // 是否允许JS打开新窗口
|
||||
settings.setDomStorageEnabled(true);
|
||||
webView.addJavascriptInterface(JavascriptInterfaceUtils.getInstance().setmContext(this, webView)
|
||||
.setPageClose(true)
|
||||
.setLiveZhuangBana(false), "androidObject");
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
settings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
}
|
||||
webView.loadUrl(getIntent().getStringExtra("url"));
|
||||
AndroidBug5497Workaround.assistActivity(this);
|
||||
|
||||
webView.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
L.e("H5-------->" + url);
|
||||
if (url.startsWith(Constants.COPY_PREFIX)) {
|
||||
String content = url.substring(Constants.COPY_PREFIX.length());
|
||||
if (!TextUtils.isEmpty(content)) {
|
||||
copy(content);
|
||||
}
|
||||
} else {
|
||||
view.loadUrl(url);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
if (TextUtils.isEmpty(titleString)) {
|
||||
setTitle(view.getTitle());
|
||||
} else {
|
||||
setTitle(titleString);
|
||||
}
|
||||
int height = view.getMeasuredHeight();
|
||||
Log.e("网页高度", height + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedHttpError(WebView view, WebResourceRequest request, WebResourceResponse errorResponse) {
|
||||
super.onReceivedHttpError(view, request, errorResponse);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制到剪贴板
|
||||
*/
|
||||
private void copy(String content) {
|
||||
ClipboardManager cm = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
||||
ClipData clipData = ClipData.newPlainText("text", content);
|
||||
cm.setPrimaryClip(clipData);
|
||||
ToastUtil.show(getString(R.string.copy_success));
|
||||
}
|
||||
}
|
@ -0,0 +1,177 @@
|
||||
package com.shayu.onetoone.activity.fragments.message;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.GestureDetector;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import io.rong.common.RLog;
|
||||
import io.rong.imkit.conversation.ConversationFragment;
|
||||
import io.rong.imkit.conversation.extension.RongExtension;
|
||||
import io.rong.imkit.model.UiMessage;
|
||||
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.refresh.SmartRefreshLayout;
|
||||
import io.rong.imkit.widget.refresh.wrapper.RongRefreshHeader;
|
||||
|
||||
public abstract class AbsConversationFragment extends ConversationFragment {
|
||||
private final String TAG = AbsConversationFragment.class.getSimpleName();
|
||||
private LinearLayout mNotificationContainer;
|
||||
public Context mContext;
|
||||
View rootView;
|
||||
|
||||
public void setTitle(String title) {
|
||||
TextView view = findViewById(R.id.title);
|
||||
if (view != null) {
|
||||
view.setText(title);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
rootView = getLayoutView(inflater, container, savedInstanceState);
|
||||
mContext = getActivity();
|
||||
this.mList = (RecyclerView) rootView.findViewById(io.rong.imkit.R.id.rc_message_list);
|
||||
this.mRongExtension = (RongExtension) rootView.findViewById(io.rong.imkit.R.id.rc_extension);
|
||||
this.mRefreshLayout = (SmartRefreshLayout) rootView.findViewById(io.rong.imkit.R.id.rc_refresh);
|
||||
this.mNewMessageNum = (TextView) rootView.findViewById(io.rong.imkit.R.id.rc_new_message_number);
|
||||
this.mUnreadHistoryMessageNum = (TextView) rootView.findViewById(io.rong.imkit.R.id.rc_unread_message_count);
|
||||
this.mUnreadMentionMessageNum = (TextView) rootView.findViewById(io.rong.imkit.R.id.rc_mention_message_count);
|
||||
this.mNotificationContainer = (LinearLayout) rootView.findViewById(io.rong.imkit.R.id.rc_notification_container);
|
||||
this.mNewMessageNum.setOnClickListener(this);
|
||||
this.mUnreadHistoryMessageNum.setOnClickListener(this);
|
||||
this.mUnreadMentionMessageNum.setOnClickListener(this);
|
||||
this.mLinearLayoutManager = this.createLayoutManager();
|
||||
if (this.mList != null) {
|
||||
this.mList.setLayoutManager(this.mLinearLayoutManager);
|
||||
}
|
||||
|
||||
this.mRefreshLayout.setOnTouchListener(new View.OnTouchListener() {
|
||||
@SuppressLint({"ClickableViewAccessibility"})
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
AbsConversationFragment.this.closeExpand();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
this.mAdapter.setItemClickListener(new BaseAdapter.OnItemClickListener() {
|
||||
public void onItemClick(View view, ViewHolder holder, int position) {
|
||||
AbsConversationFragment.this.closeExpand();
|
||||
}
|
||||
|
||||
public boolean onItemLongClick(View view, ViewHolder holder, int position) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (this.mList != null) {
|
||||
this.mList.setAdapter(this.mAdapter);
|
||||
this.mList.addOnScrollListener(this.mScrollListener);
|
||||
this.mList.setItemAnimator((RecyclerView.ItemAnimator) null);
|
||||
final GestureDetector gd = new GestureDetector(this.getContext(), new GestureDetector.SimpleOnGestureListener() {
|
||||
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
|
||||
AbsConversationFragment.this.closeExpand();
|
||||
return super.onScroll(e1, e2, distanceX, distanceY);
|
||||
}
|
||||
});
|
||||
this.mList.addOnItemTouchListener(new RecyclerView.OnItemTouchListener() {
|
||||
public boolean onInterceptTouchEvent(@NonNull RecyclerView rv, @NonNull MotionEvent e) {
|
||||
return gd.onTouchEvent(e);
|
||||
}
|
||||
|
||||
public void onTouchEvent(@NonNull RecyclerView rv, @NonNull MotionEvent e) {
|
||||
}
|
||||
|
||||
public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.mRefreshLayout.setNestedScrollingEnabled(false);
|
||||
this.mRefreshLayout.setRefreshHeader(new RongRefreshHeader(this.getContext()));
|
||||
this.mRefreshLayout.setRefreshFooter(new RongRefreshHeader(this.getContext()));
|
||||
this.mRefreshLayout.setEnableRefresh(true);
|
||||
this.mRefreshLayout.setOnRefreshListener(this);
|
||||
this.mRefreshLayout.setOnLoadMoreListener(this);
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
mContext = getActivity();
|
||||
mRongExtension.setVisibility(View.GONE);
|
||||
main();
|
||||
View back = findViewById(R.id.btn_back);
|
||||
if (back != null) {
|
||||
back.setOnClickListener(v -> getActivity().finish());
|
||||
}
|
||||
}
|
||||
|
||||
private RecyclerView.LayoutManager createLayoutManager() {
|
||||
LinearLayoutManager linearLayoutManager = new FixedLinearLayoutManager(this.getContext());
|
||||
linearLayoutManager.setStackFromEnd(true);
|
||||
return linearLayoutManager;
|
||||
}
|
||||
|
||||
private void closeExpand() {
|
||||
if (this.mRongExtensionViewModel != null) {
|
||||
this.mRongExtensionViewModel.collapseExtensionBoard();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private final RecyclerView.OnScrollListener mScrollListener = new RecyclerView.OnScrollListener() {
|
||||
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
||||
super.onScrolled(recyclerView, dx, dy);
|
||||
AbsConversationFragment.this.mMessageViewModel.onScrolled(recyclerView, dx, dy, AbsConversationFragment.this.mAdapter.getHeadersCount(), AbsConversationFragment.this.mAdapter.getFootersCount());
|
||||
}
|
||||
|
||||
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
|
||||
if (newState == 0 && AbsConversationFragment.this.onScrollStopRefreshList) {
|
||||
AbsConversationFragment.this.onScrollStopRefreshList = false;
|
||||
RLog.d(AbsConversationFragment.this.TAG, "onScrollStateChanged refresh List");
|
||||
AbsConversationFragment.this.refreshList((List) AbsConversationFragment.this.mMessageViewModel.getUiMessageLiveData().getValue());
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
private void refreshList(final List<UiMessage> data) {
|
||||
if (!this.mList.isComputingLayout() && this.mList.getScrollState() == 0) {
|
||||
this.mAdapter.setDataCollection(data);
|
||||
} else {
|
||||
this.onScrollStopRefreshList = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public abstract View getLayoutView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState);
|
||||
|
||||
public abstract void main();
|
||||
|
||||
public Intent getIntent() {
|
||||
return getActivity().getIntent();
|
||||
}
|
||||
|
||||
public <T extends View> T findViewById(@IdRes int id) {
|
||||
return rootView.findViewById(id);
|
||||
}
|
||||
}
|
@ -4,8 +4,10 @@ import android.annotation.SuppressLint;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowInsets;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
@ -17,11 +19,13 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
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.manager.OTONetManager;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.interfaces.ImageResultCallback;
|
||||
import com.yunbao.common.utils.ProcessImageUtil;
|
||||
@ -36,6 +40,7 @@ import io.rong.imkit.IMCenter;
|
||||
import io.rong.imkit.conversation.ConversationFragment;
|
||||
import io.rong.imkit.manager.AudioPlayManager;
|
||||
import io.rong.imkit.manager.AudioRecordManager;
|
||||
import io.rong.imkit.model.UiMessage;
|
||||
import io.rong.imkit.utils.PermissionCheckUtil;
|
||||
import io.rong.imkit.utils.RongOperationPermissionUtils;
|
||||
import io.rong.imlib.IRongCallback;
|
||||
@ -47,7 +52,7 @@ import io.rong.message.ImageMessage;
|
||||
/**
|
||||
* 融云聊天UI
|
||||
*/
|
||||
public class ChatMessageFragment extends ConversationFragment {
|
||||
public class ChatMessageFragment extends AbsConversationFragment {
|
||||
Button mSendBtn;
|
||||
View mInputPanel;
|
||||
ImageView img, call, video, gift;
|
||||
@ -61,18 +66,30 @@ public class ChatMessageFragment extends ConversationFragment {
|
||||
private float mLastTouchY;
|
||||
private boolean mUpDirection;
|
||||
|
||||
|
||||
RoundedImageView avatar;
|
||||
TextView uname;
|
||||
TextView sign;
|
||||
TextView home;
|
||||
ImageView sex;
|
||||
ImageView status;
|
||||
Button follow;
|
||||
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
initBtn();
|
||||
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();
|
||||
|
||||
call.setOnClickListener(v -> {
|
||||
MessageChatTipsContent bean = MessageChatTipsContent.obtain(WordUtil.getString(R.string.message_chat_tip1));
|
||||
MessageChatTipsContent bean = MessageChatTipsContent.obtain(WordUtil.getNewString(R.string.message_chat_tip1));
|
||||
IMCenter.getInstance().insertOutgoingMessage(conversationType, targetId, Message.SentStatus.SENT, bean, System.currentTimeMillis(), new RongIMClient.ResultCallback<Message>() {
|
||||
@Override
|
||||
public void onSuccess(Message message) {
|
||||
@ -90,6 +107,16 @@ public class ChatMessageFragment extends ConversationFragment {
|
||||
updateMyInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getLayoutView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.rc_conversation_fragment,container,false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void main() {
|
||||
|
||||
}
|
||||
|
||||
private void initCamera() {
|
||||
cameraUtil.setImageResultCallback(new ImageResultCallback() {
|
||||
@Override
|
||||
@ -258,4 +285,58 @@ public class ChatMessageFragment extends ConversationFragment {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void initChat() {
|
||||
avatar = findViewById(R.id.avatar);
|
||||
uname = findViewById(R.id.user_name);
|
||||
sign = findViewById(R.id.signature);
|
||||
sex = findViewById(R.id.sex);
|
||||
status = findViewById(R.id.status);
|
||||
home = findViewById(R.id.home);
|
||||
follow = findViewById(R.id.follow);
|
||||
targetId = getIntent().getStringExtra("targetId");
|
||||
updateUserInfo();
|
||||
follow.setOnClickListener(v -> {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void updateUserInfo() {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getTargetUserInfo(Integer.parseInt(targetId), new HttpCallback<UserBean>() {
|
||||
@Override
|
||||
public void onSuccess(UserBean data) {
|
||||
ImgLoader.display(mContext, data.getUser().getAvatar(), avatar);
|
||||
uname.setText(data.getUser().getUserNicename());
|
||||
sign.setText(data.getUser().getSignature());
|
||||
if (data.getUser().getSex() == 1) {
|
||||
sex.setImageResource(R.mipmap.ic_message_tab_man);
|
||||
} else {
|
||||
sex.setImageResource(R.mipmap.ic_message_tab_woman);
|
||||
}
|
||||
|
||||
switch (Integer.parseInt(data.getUser().getOnline())) {
|
||||
case 0:
|
||||
status.setImageResource(R.mipmap.ic_message_msg_status_online);
|
||||
break;
|
||||
case 2:
|
||||
status.setImageResource(R.mipmap.ic_message_msg_status_busy);
|
||||
break;
|
||||
default:
|
||||
status.setImageResource(R.mipmap.ic_message_msg_status_offline);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onViewLongClick(int clickType, UiMessage data) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,71 @@
|
||||
package com.shayu.onetoone.activity.fragments.message;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.adapter.MessageInteractionConversationListAdapter;
|
||||
import com.shayu.onetoone.bean.OfficialNoticeBean;
|
||||
import com.shayu.onetoone.bean.SystemMessageBean;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.view.SystemNoticeUiMessage;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import io.rong.imkit.conversation.MessageListAdapter;
|
||||
import io.rong.imkit.model.UiMessage;
|
||||
import io.rong.imlib.model.Message;
|
||||
|
||||
public class MessageInteractiveFragment extends AbsConversationFragment {
|
||||
private OfficialNoticeBean noticeBean;
|
||||
|
||||
public MessageInteractiveFragment(String data) {
|
||||
super();
|
||||
noticeBean = JSONObject.parseObject(data, OfficialNoticeBean.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getLayoutView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_interaction, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void main() {
|
||||
setTitle(noticeBean.getTitle());
|
||||
|
||||
initData();
|
||||
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getSystemMessageList(noticeBean.getType(), new HttpCallback<List<SystemMessageBean>>() {
|
||||
@Override
|
||||
public void onSuccess(List<SystemMessageBean> data) {
|
||||
List<UiMessage> list = new ArrayList<>();
|
||||
for (SystemMessageBean item : data) {
|
||||
SystemNoticeUiMessage message = new SystemNoticeUiMessage(new Message());
|
||||
message.setBean(item);
|
||||
list.add(message);
|
||||
}
|
||||
mAdapter.setDataCollection(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MessageListAdapter onResolveAdapter() {
|
||||
return new MessageInteractionConversationListAdapter(this);
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.shayu.onetoone.activity.fragments.message;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.adapter.MessageNoticeConversationListAdapter;
|
||||
import com.shayu.onetoone.bean.OfficialNoticeBean;
|
||||
import com.shayu.onetoone.bean.SystemMessageBean;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.view.SystemNoticeUiMessage;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import io.rong.imkit.conversation.MessageListAdapter;
|
||||
import io.rong.imkit.model.UiMessage;
|
||||
import io.rong.imlib.model.Message;
|
||||
|
||||
public class MessageNoticeFragment extends AbsConversationFragment {
|
||||
private OfficialNoticeBean noticeBean;
|
||||
|
||||
public MessageNoticeFragment(String data) {
|
||||
super();
|
||||
noticeBean = JSONObject.parseObject(data, OfficialNoticeBean.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getLayoutView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_notice, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void main() {
|
||||
setTitle(noticeBean.getTitle());
|
||||
initData();
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getSystemMessageList(noticeBean.getType(), new HttpCallback<List<SystemMessageBean>>() {
|
||||
@Override
|
||||
public void onSuccess(List<SystemMessageBean> data) {
|
||||
List<UiMessage> list = new ArrayList<>();
|
||||
for (SystemMessageBean item : data) {
|
||||
SystemNoticeUiMessage message = new SystemNoticeUiMessage(new Message());
|
||||
message.setBean(item);
|
||||
list.add(message);
|
||||
}
|
||||
mAdapter.setDataCollection(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MessageListAdapter onResolveAdapter() {
|
||||
return new MessageNoticeConversationListAdapter(this);
|
||||
}
|
||||
}
|
@ -24,6 +24,7 @@ import com.shayu.onetoone.bean.OfficialNoticeBean;
|
||||
import com.shayu.onetoone.bean.TargetUserInfoBean;
|
||||
import com.shayu.onetoone.event.MessageMsgBusEvent;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.yanzhenjie.recyclerview.OnItemMenuClickListener;
|
||||
import com.yanzhenjie.recyclerview.OnItemMenuStateListener;
|
||||
import com.yanzhenjie.recyclerview.SwipeMenuBridge;
|
||||
@ -454,7 +455,6 @@ public class MsgMessageFragment extends BaseFragment implements BaseAdapter.OnIt
|
||||
try {
|
||||
int type = Integer.parseInt(targetId);
|
||||
if (type < 100) {
|
||||
ToastUtil.showDebug("还没做");
|
||||
startSystem(JSONObject.parseObject(mAdapter.getSystemItem(type).mCore.getLatestMessageExtra(), OfficialNoticeBean.class), baseUiConversation.getConversationIdentifier());
|
||||
return;
|
||||
}
|
||||
@ -484,7 +484,7 @@ public class MsgMessageFragment extends BaseFragment implements BaseAdapter.OnIt
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putInt("model", noticeBean.getType());
|
||||
bundle.putString("data", JSONObject.toJSONString(noticeBean));
|
||||
RouteUtils.routeToConversationActivity(getContext(), conversationIdentifier, bundle);
|
||||
RouteUtils.routeToConversationActivity(getContext(), conversationIdentifier,bundle);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,35 +1,64 @@
|
||||
package com.shayu.onetoone.activity.fragments.message;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.res.Resources;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.OfficialNoticeBean;
|
||||
import com.shayu.onetoone.bean.SystemMessageBean;
|
||||
import com.shayu.onetoone.manager.OTONetManager;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import io.rong.imkit.IMCenter;
|
||||
import io.rong.imkit.config.RongConfigCenter;
|
||||
import io.rong.imkit.conversation.ConversationFragment;
|
||||
import io.rong.imkit.conversation.MessageListAdapter;
|
||||
import io.rong.imkit.model.UiMessage;
|
||||
import io.rong.imkit.widget.adapter.BaseAdapter;
|
||||
import io.rong.imkit.widget.adapter.ViewHolder;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.imlib.model.UserInfo;
|
||||
import io.rong.message.TextMessage;
|
||||
|
||||
public class SystemMessageFragment extends ConversationFragment {
|
||||
public class SystemMessageFragment extends AbsConversationFragment {
|
||||
View mInputPanel;
|
||||
|
||||
View titleBar;
|
||||
Button callService;
|
||||
OfficialNoticeBean noticeBean;
|
||||
|
||||
public SystemMessageFragment(String data) {
|
||||
super();
|
||||
noticeBean = JSONObject.parseObject(data, OfficialNoticeBean.class);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
init();
|
||||
initData();
|
||||
initSystemMessage();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
@ -45,6 +74,20 @@ public class SystemMessageFragment extends ConversationFragment {
|
||||
}
|
||||
}
|
||||
|
||||
private void initSystemMessage() {
|
||||
titleBar = findViewById(R.id.include);
|
||||
callService = findViewById(R.id.call_service);
|
||||
titleBar.setVisibility(View.VISIBLE);
|
||||
setTitle(noticeBean.getTitle());
|
||||
callService.setOnClickListener(v -> {
|
||||
String value = SpUtil.getStringValue("customerService");
|
||||
if (!StringUtil.isEmpty(value)) {
|
||||
OfficialNoticeBean service = JSONObject.parseObject(value, OfficialNoticeBean.class);
|
||||
RouteManager.forwardWebViewActivity(service.getTitle(), service.getLink());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
OTONetManager.getInstance(getContext())
|
||||
.getSystemMessageList(SystemMessageBean.TYPE_SYSTEM, new HttpCallback<List<SystemMessageBean>>() {
|
||||
@ -65,10 +108,42 @@ public class SystemMessageFragment extends ConversationFragment {
|
||||
private void sendMessage(SystemMessageBean item) {
|
||||
TextMessage content = TextMessage.obtain(item.getContent());
|
||||
UiMessage message = new UiMessage(Message.obtain("4", Conversation.ConversationType.PRIVATE, content));
|
||||
message.setSentStatus(Message.SentStatus.SENT);
|
||||
UserInfo userInfo = new UserInfo(item.getId() + "", item.getTitle(), mipmapToUri(R.mipmap.icon_vip_gold));
|
||||
message.setUserInfo(userInfo);
|
||||
message.setMessageDirection(Message.MessageDirection.RECEIVE);
|
||||
message.setState(0);
|
||||
message.setTargetId("4");
|
||||
mAdapter.add(message);
|
||||
}
|
||||
|
||||
private Uri mipmapToUri(int resId) {
|
||||
Resources r = getResources();
|
||||
return Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://"
|
||||
+ r.getResourcePackageName(resId) + "/"
|
||||
+ r.getResourceTypeName(resId) + "/"
|
||||
+ r.getResourceEntryName(resId) + "/"
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public View getLayoutView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.view_conversation_system_fragment, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onViewLongClick(int clickType, UiMessage data) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void main() {
|
||||
String data = getIntent().getStringExtra("data");
|
||||
if (!StringUtil.isEmpty(data)) {
|
||||
noticeBean = JSONObject.parseObject(data, OfficialNoticeBean.class);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,8 @@ import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.activity.AbsOTOActivity;
|
||||
import com.shayu.onetoone.activity.fragments.message.ChatMessageFragment;
|
||||
import com.shayu.onetoone.activity.fragments.message.MessageInteractiveFragment;
|
||||
import com.shayu.onetoone.activity.fragments.message.MessageNoticeFragment;
|
||||
import com.shayu.onetoone.activity.fragments.message.SystemMessageFragment;
|
||||
import com.shayu.onetoone.bean.OfficialNoticeBean;
|
||||
import com.shayu.onetoone.bean.SystemMessageBean;
|
||||
@ -34,120 +36,40 @@ import io.rong.imkit.conversation.ConversationFragment;
|
||||
*/
|
||||
@Route(path = RouteManager.ACTIVITY_MSG_CHAT)
|
||||
public class ChatActivity extends AbsOTOActivity {
|
||||
String targetId;
|
||||
RoundedImageView avatar;
|
||||
TextView uname;
|
||||
TextView sign;
|
||||
TextView home;
|
||||
ImageView sex;
|
||||
ImageView status;
|
||||
Button follow;
|
||||
OfficialNoticeBean noticeBean;
|
||||
|
||||
View titleBar;
|
||||
int model;
|
||||
Button callService;
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
model = getIntent().getIntExtra("model", 0);
|
||||
String data = getIntent().getStringExtra("data");
|
||||
if (!StringUtil.isEmpty(data)) {
|
||||
noticeBean = JSONObject.parseObject(data, OfficialNoticeBean.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
switch (model) {
|
||||
case SystemMessageBean.TYPE_SYSTEM:
|
||||
return R.layout.activity_msg_message;
|
||||
}
|
||||
return R.layout.activity_msg_chat;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main(Bundle savedInstanceState) {
|
||||
|
||||
|
||||
int type = getIntent().getIntExtra("model", 0);
|
||||
ConversationFragment conversationFragment;
|
||||
switch (model) {
|
||||
case SystemMessageBean.TYPE_SYSTEM:
|
||||
conversationFragment = new SystemMessageFragment();
|
||||
initSystemMessage();
|
||||
break;
|
||||
default:
|
||||
conversationFragment = new ChatMessageFragment();
|
||||
initChat();
|
||||
}
|
||||
if (type == 4) {
|
||||
conversationFragment = new SystemMessageFragment(getIntent().getStringExtra("data"));
|
||||
} else if (type == 1) {
|
||||
conversationFragment = new MessageNoticeFragment(getIntent().getStringExtra("data"));
|
||||
} else if (type == 2) {
|
||||
conversationFragment=new MessageInteractiveFragment(getIntent().getStringExtra("data"));
|
||||
} else {
|
||||
conversationFragment = new ChatMessageFragment();
|
||||
|
||||
}
|
||||
FragmentManager manager = getSupportFragmentManager();
|
||||
FragmentTransaction transaction = manager.beginTransaction();
|
||||
transaction.replace(R.id.container, conversationFragment);
|
||||
transaction.commit();
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void initSystemMessage() {
|
||||
titleBar = findViewById(R.id.include);
|
||||
callService=findViewById(R.id.call_service);
|
||||
titleBar.setVisibility(View.VISIBLE);
|
||||
setTitle(noticeBean.getTitle());
|
||||
callService.setOnClickListener(v -> {
|
||||
String value = SpUtil.getStringValue("customerService");
|
||||
if(!StringUtil.isEmpty(value)) {
|
||||
OfficialNoticeBean service=JSONObject.parseObject(value, OfficialNoticeBean.class);
|
||||
RouteUtil.forwardZhuangBanActivity(service.getTitle(),service.getLink());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initChat() {
|
||||
avatar = findViewById(R.id.avatar);
|
||||
uname = findViewById(R.id.user_name);
|
||||
sign = findViewById(R.id.signature);
|
||||
sex = findViewById(R.id.sex);
|
||||
status = findViewById(R.id.status);
|
||||
home = findViewById(R.id.home);
|
||||
follow = findViewById(R.id.follow);
|
||||
targetId = getIntent().getStringExtra("targetId");
|
||||
updateUserInfo();
|
||||
follow.setOnClickListener(v -> {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void updateUserInfo() {
|
||||
OTONetManager.getInstance(mContext)
|
||||
.getTargetUserInfo(Integer.parseInt(targetId), new HttpCallback<UserBean>() {
|
||||
@Override
|
||||
public void onSuccess(UserBean data) {
|
||||
ImgLoader.display(mContext, data.getUser().getAvatar(), avatar);
|
||||
uname.setText(data.getUser().getUserNicename());
|
||||
sign.setText(data.getUser().getSignature());
|
||||
if (data.getUser().getSex() == 1) {
|
||||
sex.setImageResource(R.mipmap.ic_message_tab_man);
|
||||
} else {
|
||||
sex.setImageResource(R.mipmap.ic_message_tab_woman);
|
||||
}
|
||||
|
||||
switch (Integer.parseInt(data.getUser().getOnline())) {
|
||||
case 0:
|
||||
status.setImageResource(R.mipmap.ic_message_msg_status_online);
|
||||
break;
|
||||
case 2:
|
||||
status.setImageResource(R.mipmap.ic_message_msg_status_busy);
|
||||
break;
|
||||
default:
|
||||
status.setImageResource(R.mipmap.ic_message_msg_status_offline);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,50 @@
|
||||
package com.shayu.onetoone.adapter;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.SystemMessageBean;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.shayu.onetoone.view.SystemNoticeUiMessage;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import io.rong.imkit.conversation.MessageListAdapter;
|
||||
import io.rong.imkit.model.UiMessage;
|
||||
import io.rong.imkit.widget.adapter.IViewProviderListener;
|
||||
import io.rong.imkit.widget.adapter.ViewHolder;
|
||||
|
||||
public class MessageInteractionConversationListAdapter extends MessageListAdapter {
|
||||
|
||||
public MessageInteractionConversationListAdapter(IViewProviderListener<UiMessage> listener) {
|
||||
super(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return ViewHolder.createViewHolder(parent.getContext(), parent, R.layout.item_interaction_msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDataCollection(List<UiMessage> data) {
|
||||
super.setDataCollection(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
SystemMessageBean bean = ((SystemNoticeUiMessage) getData().get(position)).getBean();
|
||||
holder.setText(R.id.content, bean.getContent());
|
||||
holder.setText(R.id.text, bean.getUser_nicename());
|
||||
holder.setText(R.id.time, new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault()).format(new Date(bean.getAddtime() * 1000)));
|
||||
ImgLoader.display(holder.getContext(), bean.getAvatar(), holder.getView(R.id.ico));
|
||||
ImgLoader.display(holder.getContext(), bean.getAvatar(), holder.getView(R.id.img_item_interaction));
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.shayu.onetoone.adapter;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.shayu.onetoone.R;
|
||||
import com.shayu.onetoone.bean.SystemMessageBean;
|
||||
import com.shayu.onetoone.manager.RouteManager;
|
||||
import com.shayu.onetoone.view.SystemNoticeUiMessage;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import io.rong.imkit.conversation.MessageListAdapter;
|
||||
import io.rong.imkit.model.UiMessage;
|
||||
import io.rong.imkit.widget.adapter.IViewProviderListener;
|
||||
import io.rong.imkit.widget.adapter.ViewHolder;
|
||||
|
||||
public class MessageNoticeConversationListAdapter extends MessageListAdapter {
|
||||
|
||||
public MessageNoticeConversationListAdapter(IViewProviderListener<UiMessage> listener) {
|
||||
super(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return ViewHolder.createViewHolder(parent.getContext(), parent, R.layout.item_sys_msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDataCollection(List<UiMessage> data) {
|
||||
super.setDataCollection(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
SystemMessageBean bean = ((SystemNoticeUiMessage) getData().get(position)).getBean();
|
||||
holder.setText(R.id.content, bean.getContent());
|
||||
holder.setText(R.id.text, bean.getTitle());
|
||||
holder.setText(R.id.time, new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault()).format(new Date(bean.getAddtime() * 1000)));
|
||||
|
||||
if (StringUtil.isEmpty(bean.getBanner())) {
|
||||
holder.setVisible(R.id.cv_img_content, false);
|
||||
} else {
|
||||
holder.setVisible(R.id.cv_img_content, true);
|
||||
ImgLoader.display(holder.getContext(), bean.getBanner(), holder.getView(R.id.img_content));
|
||||
}
|
||||
holder.setOnClickListener(R.id.bg, new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
RouteManager.forwardWebViewActivity(bean.getTitle(), bean.getLink());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -52,6 +52,7 @@ public class MsgMessageRecyclerViewAdapter extends ConversationListAdapter {
|
||||
List<BaseUiConversation> top = new ArrayList<>();
|
||||
List<BaseUiConversation> data2 = new ArrayList<>();
|
||||
for (BaseUiConversation datum : data) {
|
||||
System.out.println("接收到的Tid="+datum.mCore.getTargetId());
|
||||
try {
|
||||
int parseInt = Integer.parseInt(datum.mCore.getTargetId());
|
||||
if (parseInt < 100) {
|
||||
@ -59,6 +60,7 @@ public class MsgMessageRecyclerViewAdapter extends ConversationListAdapter {
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
continue;
|
||||
}
|
||||
if (datum.mCore.getConversationType() == Conversation.ConversationType.PRIVATE || datum.mCore.getConversationType() == Conversation.ConversationType.SYSTEM) {
|
||||
if (datum.mCore.isTop()) {
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.shayu.onetoone.manager;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
|
||||
/**
|
||||
@ -11,6 +13,7 @@ public class RouteManager {
|
||||
public static final String ACTIVITY_MSG_CHAT = "/activity/ChatActivity";//聊天页面
|
||||
public static final String ACTIVITY_ENTRY = "/activity/EntryActivity";
|
||||
public static final String ACTIVITY_LOGIN = "/activity/LoginActivity";
|
||||
public static final String ACTIVITY_WEB_VIEW = "/activity/WebViewActivity";
|
||||
|
||||
public static void forwardMainActivity() {
|
||||
ARouter.getInstance().build(ACTIVITY_MAIN)
|
||||
@ -31,8 +34,17 @@ public class RouteManager {
|
||||
ARouter.getInstance().build(ACTIVITY_ENTRY)
|
||||
.navigation();
|
||||
}
|
||||
|
||||
public static void forwardLoginActivity() {
|
||||
ARouter.getInstance().build(ACTIVITY_LOGIN)
|
||||
.navigation();
|
||||
}
|
||||
|
||||
public static void forwardWebViewActivity(String title, String url) {
|
||||
ARouter.getInstance().build(ACTIVITY_WEB_VIEW)
|
||||
.withString("title", title)
|
||||
.withString("url", url)
|
||||
.navigation();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.shayu.onetoone.view;
|
||||
|
||||
import com.shayu.onetoone.bean.SystemMessageBean;
|
||||
|
||||
import io.rong.imkit.model.UiMessage;
|
||||
import io.rong.imlib.model.Message;
|
||||
|
||||
public class SystemNoticeUiMessage extends UiMessage {
|
||||
SystemMessageBean bean;
|
||||
|
||||
public SystemMessageBean getBean() {
|
||||
return bean;
|
||||
}
|
||||
|
||||
public void setBean(SystemMessageBean bean) {
|
||||
this.bean = bean;
|
||||
}
|
||||
|
||||
public SystemNoticeUiMessage(Message message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
@ -5,14 +5,6 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="26dp">
|
||||
|
||||
<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"
|
||||
@ -21,5 +13,5 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/include2" />
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
26
OneToOne/src/main/res/layout/activity_webview.xml
Normal file
26
OneToOne/src/main/res/layout/activity_webview.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<include
|
||||
android:id="@+id/include"
|
||||
android:layout_marginTop="@dimen/activity_top"
|
||||
layout="@layout/view_activity_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="71dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<WebView
|
||||
android:id="@+id/webView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/include" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
117
OneToOne/src/main/res/layout/fragment_interaction.xml
Normal file
117
OneToOne/src/main/res/layout/fragment_interaction.xml
Normal file
@ -0,0 +1,117 @@
|
||||
<?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:background="#FFFFFF"
|
||||
android:orientation="vertical">
|
||||
<include
|
||||
android:id="@+id/include"
|
||||
layout="@layout/view_activity_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="71dp"
|
||||
|
||||
android:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<io.rong.imkit.widget.refresh.SmartRefreshLayout
|
||||
android:id="@+id/rc_refresh"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/include">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rc_message_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:overScrollMode="never" />
|
||||
</io.rong.imkit.widget.refresh.SmartRefreshLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_new_message_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:background="@drawable/rc_conversation_newmsg"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="12dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/rc_refresh"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_unread_message_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/rc_unread_height"
|
||||
android:layout_marginTop="@dimen/rc_margin_size_30"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="@drawable/rc_unread_msg_bg_style"
|
||||
android:drawableStart="@drawable/rc_unread_msg_arrow"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:minWidth="120dp"
|
||||
android:paddingStart="7dp"
|
||||
android:paddingEnd="7dp"
|
||||
android:textColor="@color/rc_text_main_color"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_mention_message_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/rc_unread_height"
|
||||
android:layout_marginTop="@dimen/rc_margin_size_80"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="@drawable/rc_unread_msg_bg_style"
|
||||
android:drawableStart="@drawable/rc_unread_msg_arrow"
|
||||
android:drawablePadding="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:minWidth="120dp"
|
||||
android:paddingStart="7dp"
|
||||
android:paddingEnd="7dp"
|
||||
android:text="@string/rc_mention_messages"
|
||||
android:textColor="@color/rc_text_main_color"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<io.rong.imkit.conversation.extension.RongExtension
|
||||
android:id="@+id/rc_extension"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:RCStyle="SCE"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/rc_refresh" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rc_notification_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:background="#660F0F0F"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
116
OneToOne/src/main/res/layout/fragment_notice.xml
Normal file
116
OneToOne/src/main/res/layout/fragment_notice.xml
Normal file
@ -0,0 +1,116 @@
|
||||
<?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:background="@color/rc_background_main_color"
|
||||
android:orientation="vertical">
|
||||
<include
|
||||
android:id="@+id/include"
|
||||
layout="@layout/view_activity_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="71dp"
|
||||
|
||||
android:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<io.rong.imkit.widget.refresh.SmartRefreshLayout
|
||||
android:id="@+id/rc_refresh"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/include">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rc_message_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:overScrollMode="never" />
|
||||
</io.rong.imkit.widget.refresh.SmartRefreshLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_new_message_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:background="@drawable/rc_conversation_newmsg"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="12dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/rc_refresh"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_unread_message_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/rc_unread_height"
|
||||
android:layout_marginTop="@dimen/rc_margin_size_30"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="@drawable/rc_unread_msg_bg_style"
|
||||
android:drawableStart="@drawable/rc_unread_msg_arrow"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:minWidth="120dp"
|
||||
android:paddingStart="7dp"
|
||||
android:paddingEnd="7dp"
|
||||
android:textColor="@color/rc_text_main_color"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_mention_message_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/rc_unread_height"
|
||||
android:layout_marginTop="@dimen/rc_margin_size_80"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="@drawable/rc_unread_msg_bg_style"
|
||||
android:drawableStart="@drawable/rc_unread_msg_arrow"
|
||||
android:drawablePadding="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:minWidth="120dp"
|
||||
android:paddingStart="7dp"
|
||||
android:paddingEnd="7dp"
|
||||
android:text="@string/rc_mention_messages"
|
||||
android:textColor="@color/rc_text_main_color"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<io.rong.imkit.conversation.extension.RongExtension
|
||||
android:id="@+id/rc_extension"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:RCStyle="SCE"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/rc_refresh" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rc_notification_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#660F0F0F"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
101
OneToOne/src/main/res/layout/item_interaction_msg.xml
Normal file
101
OneToOne/src/main/res/layout/item_interaction_msg.xml
Normal file
@ -0,0 +1,101 @@
|
||||
<?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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rt_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/ico"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_margin="12dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rt_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@+id/ico"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginRight="3dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="65dp"
|
||||
tools:text="名稱名稱"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp" />
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/text"
|
||||
android:layout_margin="6dp"
|
||||
tools:text="评论了你:晚上好!!!!!!你好啊"
|
||||
android:textColor="#999999"
|
||||
android:textSize="13sp" />
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="6dp"
|
||||
android:text="2-24 17:00"
|
||||
android:textColor="@color/gay_8c8c8c"
|
||||
android:textSize="12sp" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lt_img"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="visible">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginRight="12dp"
|
||||
app:cardCornerRadius="8dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_item_interaction"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
97
OneToOne/src/main/res/layout/item_sys_msg.xml
Normal file
97
OneToOne/src/main/res/layout/item_sys_msg.xml
Normal file
@ -0,0 +1,97 @@
|
||||
<?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"
|
||||
android:id="@+id/bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/background_fff">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginRight="65dp"
|
||||
android:text="通知標題標題通知標題標題"
|
||||
android:textColor="#ff161616"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:text="2-24 17:00"
|
||||
android:textColor="#ff8c8c8c"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_img_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_below="@id/text"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:visibility="visible"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="87dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:visibility="visible" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/cv_img_content"
|
||||
android:layout_margin="20dp"
|
||||
android:textColor="@color/gray3"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/to_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginBottom="18dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="點擊查看"
|
||||
android:textColor="#ffaaaaaa"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="17dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:src="@mipmap/icon_more_live_menu" />
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -6,6 +6,15 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/rc_background_main_color"
|
||||
android:orientation="vertical">
|
||||
<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" />
|
||||
|
||||
|
||||
<io.rong.imkit.widget.refresh.SmartRefreshLayout
|
||||
android:id="@+id/rc_refresh"
|
||||
@ -14,7 +23,7 @@
|
||||
app:layout_constraintBottom_toTopOf="@id/rc_extension"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
app:layout_constraintTop_toBottomOf="@+id/include2">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rc_message_list"
|
||||
|
@ -7,9 +7,10 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginStart="18dp"
|
||||
android:scaleType="center"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
@ -0,0 +1,125 @@
|
||||
<?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:background="@color/rc_background_main_color"
|
||||
android:orientation="vertical">
|
||||
<include
|
||||
android:id="@+id/include"
|
||||
layout="@layout/view_activity_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="71dp"
|
||||
|
||||
android:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<io.rong.imkit.widget.refresh.SmartRefreshLayout
|
||||
android:id="@+id/rc_refresh"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/include"
|
||||
app:layout_constraintBottom_toTopOf="@+id/call_service"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rc_message_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:overScrollMode="never" />
|
||||
</io.rong.imkit.widget.refresh.SmartRefreshLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_new_message_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:background="@drawable/rc_conversation_newmsg"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="12dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/rc_refresh"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_unread_message_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/rc_unread_height"
|
||||
android:layout_marginTop="@dimen/rc_margin_size_30"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="@drawable/rc_unread_msg_bg_style"
|
||||
android:drawableStart="@drawable/rc_unread_msg_arrow"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:minWidth="120dp"
|
||||
android:paddingStart="7dp"
|
||||
android:paddingEnd="7dp"
|
||||
android:textColor="@color/rc_text_main_color"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_mention_message_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/rc_unread_height"
|
||||
android:layout_marginTop="@dimen/rc_margin_size_80"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="@drawable/rc_unread_msg_bg_style"
|
||||
android:drawableStart="@drawable/rc_unread_msg_arrow"
|
||||
android:drawablePadding="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:minWidth="120dp"
|
||||
android:paddingStart="7dp"
|
||||
android:paddingEnd="7dp"
|
||||
android:text="@string/rc_mention_messages"
|
||||
android:textColor="@color/rc_text_main_color"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<io.rong.imkit.conversation.extension.RongExtension
|
||||
android:id="@+id/rc_extension"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:RCStyle="SCE"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/rc_refresh" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rc_notification_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#660F0F0F"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/call_service"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#8E7DDF"
|
||||
android:text="聯繫客服"
|
||||
android:textColor="#FFFFFF"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="activity_top">42dp</dimen>
|
||||
<dimen name="activity_top">22dp</dimen>
|
||||
</resources>
|
@ -62,7 +62,7 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
language = "zh";
|
||||
}
|
||||
if (!getBoolean(KEY_LANGUAGE, !TextUtils.equals(language, "zh"))) {
|
||||
return Locale.SIMPLIFIED_CHINESE;
|
||||
return Locale.TRADITIONAL_CHINESE;
|
||||
} else {
|
||||
return new Locale("en", "rUS");
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ public class ToastUtil {
|
||||
|
||||
|
||||
public static void show(int res) {
|
||||
show(WordUtil.getString(res));
|
||||
show(WordUtil.getNewString(res));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
@ -26,6 +27,16 @@ public class WordUtil {
|
||||
return sResources.getString(res);
|
||||
}
|
||||
|
||||
public static String getNewString(int res) {
|
||||
Configuration config = new Configuration();
|
||||
Configuration tmp = sResources.getConfiguration();
|
||||
config.setToDefaults();
|
||||
config.locale = IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage();
|
||||
sResources.updateConfiguration(config, sResources.getDisplayMetrics());
|
||||
String str = sResources.getString(res);
|
||||
sResources.updateConfiguration(tmp, sResources.getDisplayMetrics());
|
||||
return str;
|
||||
}
|
||||
public static boolean isZh() {
|
||||
Locale locale = sResources.getConfiguration().locale;
|
||||
String language = locale.getLanguage();
|
||||
|
Loading…
x
Reference in New Issue
Block a user