Commit fcb72e11 by 霍志良

Merge remote-tracking branch 'origin/new_dev_4.3.91' into 心事动态发布优化

# Conflicts:
#	config.gradle
parents be0e0655 a4de45ff
...@@ -5,13 +5,13 @@ ext { ...@@ -5,13 +5,13 @@ ext {
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.69", "m-confide" : "0.0.49.72",
"m-consultant" : "0.0.60.20", "m-consultant" : "0.0.60.21",
"m-fm" : "0.0.30.08", "m-fm" : "0.0.30.08",
"m-user" : "0.0.62.04", "m-user" : "0.0.62.04",
"m-home" : "0.0.23.36", "m-home" : "0.0.23.37",
"m-im" : "0.0.21.30", "m-im" : "0.0.21.30",
"m-dynamic" : "0.0.7.35", "m-dynamic" : "0.0.7.36",
"m-article" : "0.0.0.10", "m-article" : "0.0.0.10",
"m-muse" : "0.0.28.28", "m-muse" : "0.0.28.28",
...@@ -38,10 +38,10 @@ ext { ...@@ -38,10 +38,10 @@ ext {
"ydl-platform" : "0.0.40.98", "ydl-platform" : "0.0.40.98",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.61", "ydl-webview" : "0.0.38.62",
"ydl-media" : "0.0.21.44", "ydl-media" : "0.0.21.44",
"ydl-pay" : "0.0.18.19", "ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.85", "m-audioim" : "0.0.49.29.88",
"ydl-flutter-base": "0.0.14.38", "ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动 //以下 几乎不会动
...@@ -91,13 +91,13 @@ ext { ...@@ -91,13 +91,13 @@ ext {
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.69", "m-confide" : "0.0.49.72",
"m-consultant" : "0.0.60.20", "m-consultant" : "0.0.60.21",
"m-fm" : "0.0.30.08", "m-fm" : "0.0.30.08",
"m-user" : "0.0.62.04", "m-user" : "0.0.62.04",
"m-home" : "0.0.23.36", "m-home" : "0.0.23.37",
"m-im" : "0.0.21.30", "m-im" : "0.0.21.30",
"m-dynamic" : "0.0.7.35", "m-dynamic" : "0.0.7.36",
"m-article" : "0.0.0.8", "m-article" : "0.0.0.8",
"m-muse" : "0.0.28.28", "m-muse" : "0.0.28.28",
...@@ -122,10 +122,10 @@ ext { ...@@ -122,10 +122,10 @@ ext {
"ydl-platform" : "0.0.40.98", "ydl-platform" : "0.0.40.98",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.61", "ydl-webview" : "0.0.38.62",
"ydl-media" : "0.0.21.44", "ydl-media" : "0.0.21.44",
"ydl-pay" : "0.0.18.19", "ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.85", "m-audioim" : "0.0.49.29.88",
"ydl-flutter-base": "0.0.14.38", "ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动 //以下 几乎不会动
......
package com.ydl.confide.home package com.ydl.confide.home
import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.os.Build import android.os.Build
import android.view.View import android.view.View
...@@ -331,7 +332,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -331,7 +332,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
//数据重组 //数据重组
ConfideHomeUtils.resetData(cacheList!!, v_filterView, listScrollListener!!) ConfideHomeUtils.resetData(cacheList!!, v_filterView, listScrollListener!!)
setHideFilterView() setHideFilterView()
mConfideAdapter?.updataItems(cacheList!!) mConfideAdapter?.updateItems(cacheList!!)
mConfideAdapter?.notifyDataSetChanged() mConfideAdapter?.notifyDataSetChanged()
rv_list.refreshComplete() rv_list.refreshComplete()
} }
...@@ -340,7 +341,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -340,7 +341,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
* 更新适配器数据(用于播放 暂停 状态切换 更新整体数据) * 更新适配器数据(用于播放 暂停 状态切换 更新整体数据)
*/ */
private fun updateAdapterForPlayStatus() { private fun updateAdapterForPlayStatus() {
mConfideAdapter!!.updataItems(cacheList!!) mConfideAdapter!!.updateItems(cacheList!!)
mConfideAdapter!!.notifyDataSetChanged() mConfideAdapter!!.notifyDataSetChanged()
} }
...@@ -425,6 +426,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -425,6 +426,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
*/ */
override fun recommendListMoreResponse(bean: ConfideHomeDataBean) { override fun recommendListMoreResponse(bean: ConfideHomeDataBean) {
dismissProgressDialog() dismissProgressDialog()
rv_list.loadMoreComplete()
bean.recommendId = page bean.recommendId = page
if(bean.body?.size?:0==0) { if(bean.body?.size?:0==0) {
rv_list.loadMoreComplete() rv_list.loadMoreComplete()
...@@ -432,14 +434,8 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -432,14 +434,8 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
return return
} }
(cacheList as ArrayList).add(bean) (cacheList as ArrayList).add(bean)
var size = mConfideAdapter!!.itemCount val size = mConfideAdapter!!.itemCount
mConfideAdapter!!.addItems(ConfideHomeUtils.getRecommendList(bean)) mConfideAdapter!!.addItems(ConfideHomeUtils.getRecommendList(bean))
// if (bean?.body == null || bean.body!!.size < 10) {
// rv_list.setNoMore(true)
// } else {
rv_list.loadMoreComplete()
// }
mConfideAdapter!!.notifyItemInserted(if (size > 0) size + 1 else 0) mConfideAdapter!!.notifyItemInserted(if (size > 0) size + 1 else 0)
} }
...@@ -448,13 +444,14 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -448,13 +444,14 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
*/ */
override fun recommendListResponse(bean: ConfideHomeDataBean) { override fun recommendListResponse(bean: ConfideHomeDataBean) {
dismissProgressDialog() dismissProgressDialog()
updateCacheDataByRecommend(bean)
mConfideAdapter!!.updataItems(cacheList!!)
if (bean?.body == null || bean.body!!.size < 10) {
rv_list.setNoMore(true)
} else {
rv_list.loadMoreComplete() rv_list.loadMoreComplete()
} updateCacheDataByRecommend(bean)
mConfideAdapter!!.updateItems(cacheList!!)
// if (bean.body == null || bean.body.size < 10) {
// rv_list.setNoMore(true)
// } else {
// rv_list.loadMoreComplete()
// }
mConfideAdapter!!.notifyDataSetChanged() mConfideAdapter!!.notifyDataSetChanged()
} }
...@@ -532,6 +529,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -532,6 +529,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
} }
} }
@SuppressLint("MissingSuperCall")
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
mConfideEvent!!.destoryPlayer() mConfideEvent!!.destoryPlayer()
......
...@@ -43,7 +43,7 @@ class ConfideHomeAdapter(private val mContext: Context, ...@@ -43,7 +43,7 @@ class ConfideHomeAdapter(private val mContext: Context,
return mListData!![position].type!! return mListData!![position].type!!
} }
fun updataItems(list: List<ConfideHomeDataBean>) { fun updateItems(list: List<ConfideHomeDataBean>) {
if (null == mListData || mListData!!.isEmpty()) { if (null == mListData || mListData!!.isEmpty()) {
mListData = ArrayList() mListData = ArrayList()
} else { } else {
......
倾诉首页界面
\ No newline at end of file
...@@ -118,7 +118,7 @@ class ConfideHomeUtils { ...@@ -118,7 +118,7 @@ class ConfideHomeUtils {
*/ */
fun getRecommendList(dataBean: ConfideHomeDataBean): MutableList<ConfideHomeDataBean> { fun getRecommendList(dataBean: ConfideHomeDataBean): MutableList<ConfideHomeDataBean> {
var list: MutableList<ConfideHomeDataBean> = ArrayList() var list: MutableList<ConfideHomeDataBean> = ArrayList()
if (null == dataBean || null == dataBean.body || dataBean.body.isEmpty()) { if (dataBean.body == null || dataBean.body.isEmpty()) {
return list return list
} }
for (bodyBean in dataBean.body) { for (bodyBean in dataBean.body) {
......
...@@ -2,9 +2,15 @@ package com.yidianling.im.config; ...@@ -2,9 +2,15 @@ package com.yidianling.im.config;
import android.app.Application; import android.app.Application;
import android.content.Context; import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;
import com.alibaba.fastjson.JSON;
import com.netease.nimlib.sdk.NIMClient; import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.auth.LoginInfo; import com.netease.nimlib.sdk.auth.LoginInfo;
import com.netease.nimlib.sdk.mixpush.MixPushMessageHandler;
import com.netease.nimlib.sdk.mixpush.NIMPushClient;
import com.netease.nimlib.sdk.uinfo.model.UserInfo; import com.netease.nimlib.sdk.uinfo.model.UserInfo;
import com.netease.nimlib.sdk.util.NIMUtil; import com.netease.nimlib.sdk.util.NIMUtil;
import com.ydl.ydlcommon.utils.SharedPreferencesEditor; import com.ydl.ydlcommon.utils.SharedPreferencesEditor;
...@@ -28,6 +34,8 @@ import com.yidianling.uikit.business.uinfo.UserInfoHelper; ...@@ -28,6 +34,8 @@ import com.yidianling.uikit.business.uinfo.UserInfoHelper;
import com.yidianling.uikit.custom.config.YDLToolBarOptions; import com.yidianling.uikit.custom.config.YDLToolBarOptions;
import com.yidianling.user.api.bean.UserResponseBean; import com.yidianling.user.api.bean.UserResponseBean;
import java.util.Map;
import de.greenrobot.event.EventBus; import de.greenrobot.event.EventBus;
...@@ -67,6 +75,32 @@ public class NimApplication { ...@@ -67,6 +75,32 @@ public class NimApplication {
ImObserversHelper.Companion.getInstance().registerObserver(true); ImObserversHelper.Companion.getInstance().registerObserver(true);
// 初始化听筒模式 // 初始化听筒模式
initEarMode(); initEarMode();
NIMPushClient.registerMixPushMessageHandler(new MixPushMessageHandler() {
@Override
public boolean onNotificationClicked(Context context, Map<String, String> map) {
Log.d("notification", JSON.toJSONString(map));
String routeAndroid = map.get("route_android");
if (routeAndroid != null) {
try {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setPackage(context.getPackageName());
intent.setData(Uri.parse(routeAndroid));
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
return true;
} catch (Throwable e) {
Log.e("app", "", e);
}
}
return false;
}
@Override
public boolean cleanMixPushNotifications(int i) {
return false;
}
});
} }
} }
......
...@@ -5,6 +5,7 @@ import android.app.Activity; ...@@ -5,6 +5,7 @@ import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Handler; import android.os.Handler;
import android.os.SystemClock; import android.os.SystemClock;
import android.text.Editable; import android.text.Editable;
...@@ -30,9 +31,9 @@ import androidx.constraintlayout.widget.ConstraintLayout; ...@@ -30,9 +31,9 @@ import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.SPUtils; import com.blankj.utilcode.util.SPUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.netease.nimlib.sdk.NIMClient; import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.media.record.AudioRecorder; import com.netease.nimlib.sdk.media.record.AudioRecorder;
import com.netease.nimlib.sdk.media.record.IAudioRecordCallback; import com.netease.nimlib.sdk.media.record.IAudioRecordCallback;
...@@ -72,7 +73,9 @@ import com.yidianling.user.api.service.IUserService; ...@@ -72,7 +73,9 @@ import com.yidianling.user.api.service.IUserService;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import de.greenrobot.event.EventBus; import de.greenrobot.event.EventBus;
import io.reactivex.functions.Consumer; import io.reactivex.functions.Consumer;
...@@ -645,7 +648,70 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba ...@@ -645,7 +648,70 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
} }
protected IMMessage createTextMessage(String text) { protected IMMessage createTextMessage(String text) {
return MessageBuilder.createTextMessage(container.account, container.sessionType, text); IMMessage msg = MessageBuilder.createTextMessage(container.account, container.sessionType, text);
Map<String, Object> payload = new HashMap<>();
fillHwPayload(payload, NimUIKit.getAccount(), container.sessionType.getValue());
fillOppoPayload(payload, NimUIKit.getAccount(), container.sessionType.getValue());
fillVivoPayload(payload, NimUIKit.getAccount(), container.sessionType.getValue());
payload.put("sessionId", NimUIKit.getAccount());
payload.put("sessionType", container.sessionType.getValue());
msg.setPushPayload(payload);
return msg;
}
private void fillHwPayload(Map<String, Object> pushPayload, String sessionId, int sessionType) {
//华为
Intent hwIntent = new Intent(Intent.ACTION_VIEW);
String intentStr = String.format(
"im://ydl.com/session?sessionId=%s&sessionType=%s",
sessionId, // 发送者的account 或 群聊id
sessionType // 类型(单聊或群聊)
);
hwIntent.setData(Uri.parse(intentStr));
hwIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
String intentUri = hwIntent.toUri(Intent.URI_INTENT_SCHEME);
//点击事件的内容
JSONObject clickAction = new JSONObject();
//通知的内容
JSONObject notification = new JSONObject();
try {
clickAction.fluentPut("type", 1)
.put("intent", intentUri);
notification.put("click_action", clickAction);
pushPayload.put("hwField", notification);
} catch (JSONException e) {
e.printStackTrace();
}
}
private void fillVivoPayload(Map<String, Object> pushPayload, String sessionId, int sessionType) {
Map<String, Object> vivoField = new HashMap<>();
vivoField.put("classification", 1);
vivoField.put("skipType", 3);
Intent intent = new Intent(Intent.ACTION_VIEW);
String intentStr = String.format(
"im://ydl.com/session?sessionId=%s&sessionType=%s",
sessionId, // 发送者的account 或 群聊id
sessionType // 类型(单聊或群聊)
);
intent.setData(Uri.parse(intentStr));
String intentUri = intent.toUri(Intent.URI_INTENT_SCHEME);
vivoField.put("skipContent", intentUri);
pushPayload.put("vivoField", vivoField);
}
private void fillOppoPayload(Map<String, Object> pushPayload, String sessionId, int sessionType) {
Map<String, Object> oppoField = new HashMap<>();
String intentStr = String.format(
"im://ydl.com/session?sessionId=%s&sessionType=%s",
sessionId, // 发送者的account 或 群聊id
sessionType // 类型(单聊或群聊)
);
oppoField.put("click_action_type", 5);
oppoField.put("click_action_url", intentStr);
oppoField.put("channel_id", "nim_message_channel_001");
pushPayload.put("oppoField", oppoField);
} }
/** /**
......
...@@ -1018,12 +1018,8 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -1018,12 +1018,8 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
handler.proceed(); handler.proceed();
return; return;
} }
final AlertDialog.Builder builder = new AlertDialog.Builder(this); ToastUtil.toastShort("SSL 证书验证错误");
builder.setMessage(R.string.platform_notification_error_ssl_cert_invalid); handler.cancel();
builder.setPositiveButton("继续", (dialog, which) -> handler.proceed());
builder.setNegativeButton("取消", (dialog, which) -> handler.cancel());
final AlertDialog dialog = builder.create();
dialog.show();
} }
private void initShareMenu() { private void initShareMenu() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment