Commit 2e7e5c09 by 严久程

网络状态不显示问题

parent e9037c13
......@@ -180,6 +180,7 @@ dependencies {
implementation fileTree(dir: 'aars', include: ['*.aar'])
implementation project(':m-user')
implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-confide-api')
api project(':m-tests')
api project(':m-consultant')
implementation modularPublication('com.ydl:m-consultant-api')
......@@ -187,7 +188,7 @@ dependencies {
api project(':m-home')
// api project(':m-confide')
api project(':m-confide')
// api "com.ydl:m-consultant-api:0.0.2"
// api 'com.ydl:m-consultant-module-ydl:0.0.18@aar'
......
......@@ -29,6 +29,7 @@ import com.yidianling.user.widget.SecretDialog
import com.yidianling.user.widget.SecretDialog.OnSecretDialogListener
import kotlinx.android.synthetic.main.activity_main.*
import com.ydl.component.route.PlatformTempCommonRouteImpl
import com.ydl.confide.home.ConfideHomeActivity
import com.ydl.ydlcommon.router.YdlCommonRouterManager
......@@ -131,7 +132,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
}
bt_to_confide.setOnClickListener {
// YDLavManager.instances.login("1193016")
// startActivity(Intent(this, ConfideHomeActivity::class.java))
startActivity(Intent(this, ConfideHomeActivity::class.java))
}
bt_to_muse.setOnClickListener {
......
......@@ -3,6 +3,8 @@ package com.ydl.component.service.web;
import android.app.Activity;
import com.alibaba.android.arouter.launcher.ARouter;
import com.ydl.confide.api.IConfideService;
import com.ydl.webview.H5JsBean;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
......@@ -357,6 +359,11 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
@Override
public void confideConnect(H5JsBean.H5JsCmd.Params jsData) {
// ModularServiceManager.INSTANCE.provide(IConfideService.class).connectionJava(jsData.getId(),jsData.getConfideType(),mContext,null,jsData.getCallType());
((IConfideService) ARouter.getInstance().build("/confide/ConfideService").navigation()).connectionJava(jsData.getId(), 3, mContext, null, jsData.getCallType());
}
@Override
......@@ -440,4 +447,6 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
((NewH5Activity) mContext).setSelfPageType(selfType);
}
}
}
......@@ -5,7 +5,7 @@ ext {
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.48.48",
"m-confide" : "0.0.48.49.5",
"m-consultant" : "0.0.59.10",
"m-fm" : "0.0.29.9",
"m-user" : "0.0.60.8",
......@@ -39,7 +39,7 @@ ext {
"ydl-webview" : "0.0.38.31",
"ydl-media" : "0.0.21.6",
"ydl-pay" : "0.0.18.9",
"m-audioim" : "0.0.49.22",
"m-audioim" : "0.0.49.28",
"ydl-flutter-base": "0.0.14.14",
//以下 几乎不会动
......@@ -122,7 +122,7 @@ ext {
"ydl-webview" : "0.0.38.31",
"ydl-media" : "0.0.21.6",
"ydl-pay" : "0.0.18.9",
"m-audioim" : "0.0.49.22",
"m-audioim" : "0.0.49.28",
"ydl-flutter-base": "0.0.14.14",
//以下 几乎不会动
......
......@@ -228,7 +228,7 @@ class AudioHomeActivity :
showToast("请退出应用,重新打开")
leaveChannel()
}
10, 17 -> {
10 -> {
showToast("当前网络较差,请更换网络")
leaveChannel()
}
......@@ -244,10 +244,7 @@ class AudioHomeActivity :
// showToast("当前用户不允许接听电话,请联系客服")
// leaveChannel()
}
else -> {
//异常关闭
leaveChannel()
}
}
YDLavManager.instances.callEndStatusUpdate(channelId!!, 4, "频道的错误回调信息$err")
}
......@@ -346,41 +343,43 @@ class AudioHomeActivity :
override fun onNetworkQuality(uid: Int, txQuality: Int, rxQuality: Int) {
super.onNetworkQuality(uid, txQuality, rxQuality)
LogUtil.e("onNetworkQuality:-------uid=$uid,txQuality=$txQuality,rxQuality=$rxQuality")
var status = -1
var netStatus = when (uid) {
listenerUid!!.toInt() -> {
if (txQuality in 1..2 && rxQuality in 1..2) {
""
} else if (txQuality >= 5 || rxQuality >= 5) {
"对方的网络已断开"
} else {
status = if (txQuality >= 4 || rxQuality >= 4) {
0
runOnUiThread {
var status = -1
var netStatus = when (uid) {
listenerUid!!.toInt() -> {
if (txQuality in 1..2 && rxQuality in 1..2) {
""
} else if (txQuality >= 5 || rxQuality >= 5) {
"对方的网络已断开"
} else {
1
status = if (txQuality >= 4 || rxQuality >= 4) {
0
} else {
1
}
"对方的网络状况不佳"
}
"对方的网络状况不佳"
}
}
0 -> {
if (txQuality in 1..2 && rxQuality in 1..2) {
""
} else if (txQuality >= 5 || rxQuality >= 5) {
"您的网络已断开"
} else {
status = if (txQuality >= 4 || rxQuality >= 4) {
0
0 -> {
if (txQuality in 1..2 && rxQuality in 1..2) {
""
} else if (txQuality >= 5 || rxQuality >= 5) {
"您的网络已断开"
} else {
1
status = if (txQuality >= 4 || rxQuality >= 4) {
0
} else {
1
}
"您的网络状况不佳"
}
"您的网络状况不佳"
}
else -> {
""
}
}
else -> {
""
}
showNetStatus(netStatus, status)
}
showNetStatus(netStatus, status)
}
}
//
......@@ -1009,6 +1008,7 @@ class AudioHomeActivity :
* 声网离开频道
*/
fun leaveChannel() {
LogUtil.e("调用leaveChannel方法,isLeavelChannel=$isLeavelChannel")
if (!isLeavelChannel) {
isLeavelChannel = true
//刷新h5页面
......@@ -1072,32 +1072,26 @@ class AudioHomeActivity :
* 网络状态
*/
private fun showNetStatus(msg: String, status: Int = 0) {
runOnUiThread {
if (TextUtils.isEmpty(msg)) {
tv_nte_status.visibility = View.GONE
} else {
tv_nte_status.text = msg
if (status == 0) {
tv_nte_status.setCompoundDrawablesWithIntrinsicBounds(
ContextCompat.getDrawable(
this,
R.drawable.av_audio_wifi_normal
), null, null, null
)
}
if (status == 1) {
tv_nte_status.setCompoundDrawablesWithIntrinsicBounds(
ContextCompat.getDrawable(
this,
R.drawable.av_audio_wifi_better
), null, null, null
)
}
if (status == -1) {
tv_nte_status.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null)
}
tv_nte_status.visibility = View.VISIBLE
LogUtil.e("showNetStatus: msg=$msg,status=$status")
if (TextUtils.isEmpty(msg)&&status==-1){
//todo
return
}
if (TextUtils.isEmpty(msg)) {
tv_nte_status.visibility = View.GONE
} else {
tv_nte_status.text = msg
if (status == 0) {
tv_nte_status.setCompoundDrawablesWithIntrinsicBounds(ContextCompat.getDrawable(this, R.drawable.av_audio_wifi_normal), null, null, null)
}
if (status == 1) {
tv_nte_status.setCompoundDrawablesWithIntrinsicBounds(ContextCompat.getDrawable(this, R.drawable.av_audio_wifi_better), null, null, null)
}
if (status == -1) {
tv_nte_status.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null)
}
tv_nte_status.visibility = View.VISIBLE
}
}
......
......@@ -207,7 +207,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
srlContainer.setColorSchemeColors(
ContextCompat.getColor(
this,
R.color.consultant_main_theme
R.color.platform_main_theme
)
)
srlContainer.setProgressViewOffset(false, 0, 200)
......@@ -1519,7 +1519,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
}
FILTER_STATUS_FILTERED -> {
tv.typeface = Typeface.DEFAULT_BOLD
tv.setTextColor(ContextCompat.getColor(this, R.color.consultant_main_theme))
tv.setTextColor(ContextCompat.getColor(this, R.color.platform_main_theme))
tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
......@@ -1533,7 +1533,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.consultant_ic_arrow_drop_down,
R.drawable.platform_arrow_drop_down_en,
0
)
}
......
......@@ -66,5 +66,13 @@ class HomeViewConfig {
* 底部提示语模块
*/
var footerIndex :Int? = 10
var confideTitle:String = "倾诉·排解"
var fmTitle:String = "心灵·电台"
var articleTitle:String = "文章·阅读"
var testsTitle:String = "测试·分析"
var museTitle:String = "助眠·冥想"
var courseTitle:String = "学习·成长"
var consultTitle:String = "咨询·理解"
var dynamicTitle:String = "解忧·问答"
}
}
\ No newline at end of file
......@@ -605,6 +605,14 @@
app:pa_jump_tv_left_size="12sp"
app:pa_jump_tv_left_text="debug环境任意门" />
<ImageView
android:src="@drawable/user_mine_ydl_logo"
android:layout_width="match_parent"
android:scaleType="centerCrop"
android:background="@color/baby_blue"
android:layout_height="wrap_content"/>
</LinearLayout>
</ScrollView>
......
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