Commit e325951b by 严久程

网络状态不显示问题

parent 30958f70
...@@ -185,35 +185,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>( ...@@ -185,35 +185,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
} }
bt_to_privacy.setOnClickListener { bt_to_privacy.setOnClickListener {
val dialog = SecretDescriptionDialog(this@MainActivity, startActivity(Intent(this@MainActivity,TestAppActivity::class.java))
"感谢您信任并使用壹点灵旗下APP,\\n\n" +
"我们深知个人隐私的重要性,为了您更好的使用本APP,希望您着重关注:\\n\\n1. 为向您提供交易相关基本功能,我们会收集、使用必要的信息;\\n\n" +
"2. 基于您的明示授权,我们可能会获取您的位置(为您提供附近的咨询师等)、设备号信息(以保障您账号与交易安全)等信息,您有权拒绝或取消授权;\\n\n" +
"3. 我们会采业界先进的安全措施保护您的信息安全;\\n\n" +
"4. 未经您同意,我们不会从第三方处获取、共享或向其提供您的信息;\\n\n" +
"5. 您可以查询、更正、删除您的个人信息。",
object : SecretDescriptionDialog.OnSecretDescriptionDialogListener {
override fun onCancel() {
val secretDialog = SecretDialog(
this@MainActivity,
object : SecretDialog.OnSecretDialogListener {
override fun onCancel() {
ToastUtil.toastShort("onCancel")
}
override fun onSure() {
ToastUtil.toastShort("nextStep")
}
})
secretDialog?.show()
}
override fun onSure() {
ToastUtil.toastShort("nextStep")
}
}
)
dialog.show()
} }
} }
......
...@@ -5,10 +5,10 @@ ext { ...@@ -5,10 +5,10 @@ ext {
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.48.49.5", "m-confide" : "0.0.48.49.7",
"m-consultant" : "0.0.59.10", "m-consultant" : "0.0.59.10",
"m-fm" : "0.0.29.9", "m-fm" : "0.0.29.9",
"m-user" : "0.0.60.8", "m-user" : "0.0.60.11",
"m-home" : "0.0.22.3", "m-home" : "0.0.22.3",
"m-im" : "0.0.18.7", "m-im" : "0.0.18.7",
"m-dynamic" : "0.0.7.7", "m-dynamic" : "0.0.7.7",
...@@ -39,7 +39,7 @@ ext { ...@@ -39,7 +39,7 @@ ext {
"ydl-webview" : "0.0.38.31", "ydl-webview" : "0.0.38.31",
"ydl-media" : "0.0.21.6", "ydl-media" : "0.0.21.6",
"ydl-pay" : "0.0.18.9", "ydl-pay" : "0.0.18.9",
"m-audioim" : "0.0.49.28", "m-audioim" : "0.0.49.29.1",
"ydl-flutter-base": "0.0.14.14", "ydl-flutter-base": "0.0.14.14",
//以下 几乎不会动 //以下 几乎不会动
...@@ -122,7 +122,7 @@ ext { ...@@ -122,7 +122,7 @@ ext {
"ydl-webview" : "0.0.38.31", "ydl-webview" : "0.0.38.31",
"ydl-media" : "0.0.21.6", "ydl-media" : "0.0.21.6",
"ydl-pay" : "0.0.18.9", "ydl-pay" : "0.0.18.9",
"m-audioim" : "0.0.49.28", "m-audioim" : "0.0.49.29.1",
"ydl-flutter-base": "0.0.14.14", "ydl-flutter-base": "0.0.14.14",
//以下 几乎不会动 //以下 几乎不会动
......
...@@ -346,37 +346,34 @@ class AudioHomeActivity : ...@@ -346,37 +346,34 @@ class AudioHomeActivity :
runOnUiThread { runOnUiThread {
var status = -1 var status = -1
var netStatus = when (uid) { var netStatus = when (uid) {
listenerUid!!.toInt() -> { 0 -> {
if (txQuality in 1..2 && rxQuality in 1..2) { if (txQuality in 1..2 && rxQuality in 1..2) {
"" ""
} else if (txQuality >= 5 || rxQuality >= 5) { } else if (txQuality >= 5 || rxQuality >= 5) {
"对方的网络已断开" "的网络已断开"
} else { } else {
status = if (txQuality >= 4 || rxQuality >= 4) { status = if (txQuality >= 4 || rxQuality >= 4) {
0 0
} else { } else {
1 1
} }
"对方的网络状况不佳" "的网络状况不佳"
} }
} }
0 -> { else -> {
if (txQuality in 1..2 && rxQuality in 1..2) { if (txQuality in 1..2 && rxQuality in 1..2) {
"" ""
} else if (txQuality >= 5 || rxQuality >= 5) { } else if (txQuality >= 5 || rxQuality >= 5) {
"的网络已断开" "对方的网络已断开"
} else { } else {
status = if (txQuality >= 4 || rxQuality >= 4) { status = if (txQuality >= 4 || rxQuality >= 4) {
0 0
} else { } else {
1 1
} }
"的网络状况不佳" "对方的网络状况不佳"
} }
} }
else -> {
""
}
} }
showNetStatus(netStatus, status) showNetStatus(netStatus, status)
} }
...@@ -605,7 +602,12 @@ class AudioHomeActivity : ...@@ -605,7 +602,12 @@ class AudioHomeActivity :
waitDisposable = waitDisposable =
Observable.interval(0, 100, TimeUnit.MILLISECONDS).subscribeOn(Schedulers.computation()) Observable.interval(0, 100, TimeUnit.MILLISECONDS).subscribeOn(Schedulers.computation())
.take(600).observeOn(AndroidSchedulers.mainThread()).subscribe({ .take(600).observeOn(AndroidSchedulers.mainThread()).subscribe({
tv_change_time_counter.text = "${60 - it / 10}s" val remainTime = 50 - it / 10
if (remainTime <= 0) {
waittingStatus()
} else {
tv_change_time_counter.text = "${remainTime}s"
}
var result = it.toFloat() / 2.5f var result = it.toFloat() / 2.5f
progress_view.setProgress(result) progress_view.setProgress(result)
if (result >= 100f && !iv_hang_up.isEnabled) { if (result >= 100f && !iv_hang_up.isEnabled) {
...@@ -613,10 +615,11 @@ class AudioHomeActivity : ...@@ -613,10 +615,11 @@ class AudioHomeActivity :
iv_hang_up.isEnabled = true iv_hang_up.isEnabled = true
iv_hang_up.setImageResource(R.drawable.audioim_img_hang_up) iv_hang_up.setImageResource(R.drawable.audioim_img_hang_up)
} }
}, { }, {
LogUtil.d(it.message) LogUtil.d(it.message)
}) { }) {
waittingStatus() // waittingStatus()
if (!isConnectSuccess) { if (!isConnectSuccess) {
//关闭音乐 //关闭音乐
stopPlaying() stopPlaying()
...@@ -633,7 +636,8 @@ class AudioHomeActivity : ...@@ -633,7 +636,8 @@ class AudioHomeActivity :
//通话结束或挂断时,上传日志文件 //通话结束或挂断时,上传日志文件
uploadLog() uploadLog()
showChooseDialog(2) showToast("对方手机暂时不在身边,请稍后再试")
userCloseCalling()
} }
} }
...@@ -810,12 +814,12 @@ class AudioHomeActivity : ...@@ -810,12 +814,12 @@ class AudioHomeActivity :
//挂断按钮可点击 //挂断按钮可点击
iv_hang_up.isEnabled = true iv_hang_up.isEnabled = true
iv_hang_up.setImageResource(R.drawable.audioim_img_hang_up) iv_hang_up.setImageResource(R.drawable.audioim_img_hang_up)
if (!isConnectSuccess) { // if (!isConnectSuccess) {
//页面等待文案调整 // //页面等待文案调整
tv_waiting.visibility = View.GONE // tv_waiting.visibility = View.GONE
tv_change_doctor.text = "对方暂无应答,正在为您切换线路重播" // tv_change_doctor.text = "对方暂无应答,正在为您切换线路重播"
tv_change_doctor.visibility = View.VISIBLE // tv_change_doctor.visibility = View.VISIBLE
} // }
if (!isShowAXB) { if (!isShowAXB) {
tv_change_route.visibility = View.GONE tv_change_route.visibility = View.GONE
} else { } else {
...@@ -1073,19 +1077,25 @@ class AudioHomeActivity : ...@@ -1073,19 +1077,25 @@ class AudioHomeActivity :
*/ */
private fun showNetStatus(msg: String, status: Int = 0) { private fun showNetStatus(msg: String, status: Int = 0) {
LogUtil.e("showNetStatus: msg=$msg,status=$status") LogUtil.e("showNetStatus: msg=$msg,status=$status")
if (TextUtils.isEmpty(msg)&&status==-1){
//todo
return
}
if (TextUtils.isEmpty(msg)) { if (TextUtils.isEmpty(msg)) {
tv_nte_status.visibility = View.GONE tv_nte_status.visibility = View.GONE
} else { } else {
tv_nte_status.text = msg tv_nte_status.text = msg
if (status == 0) { if (status == 0) {
tv_nte_status.setCompoundDrawablesWithIntrinsicBounds(ContextCompat.getDrawable(this, R.drawable.av_audio_wifi_normal), null, null, null) tv_nte_status.setCompoundDrawablesWithIntrinsicBounds(
ContextCompat.getDrawable(
this,
R.drawable.av_audio_wifi_normal
), null, null, null
)
} }
if (status == 1) { if (status == 1) {
tv_nte_status.setCompoundDrawablesWithIntrinsicBounds(ContextCompat.getDrawable(this, R.drawable.av_audio_wifi_better), null, null, null) tv_nte_status.setCompoundDrawablesWithIntrinsicBounds(
ContextCompat.getDrawable(
this,
R.drawable.av_audio_wifi_better
), null, null, null
)
} }
if (status == -1) { if (status == -1) {
tv_nte_status.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null) tv_nte_status.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null)
......
...@@ -326,37 +326,34 @@ class ConsultantAudioHomeActivity : BaseMvpActivity<IConsultantAudioHomeActivity ...@@ -326,37 +326,34 @@ class ConsultantAudioHomeActivity : BaseMvpActivity<IConsultantAudioHomeActivity
super.onNetworkQuality(uid, txQuality, rxQuality) super.onNetworkQuality(uid, txQuality, rxQuality)
var status = -1 var status = -1
var netStatus = when (uid) { var netStatus = when (uid) {
userId!!.toInt() -> { 0 -> {
if (txQuality in 1..2 && rxQuality in 1..2) { if (txQuality in 1..2 && rxQuality in 1..2) {
"" ""
} else if (txQuality >= 5 || rxQuality >= 5) { } else if (txQuality >= 5 || rxQuality >= 5) {
"对方的网络已断开" "的网络已断开"
} else { } else {
status = if (txQuality >= 4 || rxQuality >= 4) { status = if (txQuality >= 4 || rxQuality >= 4) {
0 0
} else { } else {
1 1
} }
"对方的网络状况不佳" "的网络状况不佳"
} }
} }
0 -> { else -> {
if (txQuality in 1..2 && rxQuality in 1..2) { if (txQuality in 1..2 && rxQuality in 1..2) {
"" ""
} else if (txQuality >= 5 || rxQuality >= 5) { } else if (txQuality >= 5 || rxQuality >= 5) {
"的网络已断开" "对方的网络已断开"
} else { } else {
status = if (txQuality >= 4 || rxQuality >= 4) { status = if (txQuality >= 4 || rxQuality >= 4) {
0 0
} else { } else {
1 1
} }
"的网络状况不佳" "对方的网络状况不佳"
} }
} }
else -> {
""
}
} }
showNetStatus(netStatus, status) showNetStatus(netStatus, status)
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:paddingTop="@dimen/platform_dp_16" android:orientation="horizontal">
android:paddingBottom="@dimen/platform_dp_16">
<View <ImageView
android:layout_width="48dp" android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/platform_color_EBEBEB"
android:layout_marginRight="@dimen/platform_dp_8"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/platform_color_999999" android:background="@color/baby_blue"
android:textSize="@dimen/platform_dp_10" android:scaleType="centerCrop"
android:text="我是有底线的"/> android:src="@drawable/home_ydl_logo" />
<View
android:layout_width="48dp"
android:layout_height="0.5dp"
android:layout_marginLeft="@dimen/platform_dp_8"
android:background="@color/platform_color_EBEBEB"/>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -159,7 +159,7 @@ public class MineFragment extends BaseFragment implements SwipeRefreshLayout.OnR ...@@ -159,7 +159,7 @@ public class MineFragment extends BaseFragment implements SwipeRefreshLayout.OnR
init(); init();
jtv_test.setVisibility(BuildConfig.DEBUG ? View.VISIBLE : View.GONE); // jtv_test.setVisibility(BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
refreshCouponData(); refreshCouponData();
} }
......
...@@ -553,7 +553,6 @@ ...@@ -553,7 +553,6 @@
android:layout_marginLeft="16dp" android:layout_marginLeft="16dp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:layout_marginRight="14dp" android:layout_marginRight="14dp"
android:layout_marginBottom="20dp"
android:elevation="4dp" android:elevation="4dp"
app:cardCornerRadius="6dp"> app:cardCornerRadius="6dp">
......
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