Commit e325951b by 严久程

网络状态不显示问题

parent 30958f70
......@@ -185,35 +185,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
}
bt_to_privacy.setOnClickListener {
val dialog = SecretDescriptionDialog(this@MainActivity,
"感谢您信任并使用壹点灵旗下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()
startActivity(Intent(this@MainActivity,TestAppActivity::class.java))
}
}
......
......@@ -5,10 +5,10 @@ ext {
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.48.49.5",
"m-confide" : "0.0.48.49.7",
"m-consultant" : "0.0.59.10",
"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-im" : "0.0.18.7",
"m-dynamic" : "0.0.7.7",
......@@ -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.28",
"m-audioim" : "0.0.49.29.1",
"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.28",
"m-audioim" : "0.0.49.29.1",
"ydl-flutter-base": "0.0.14.14",
//以下 几乎不会动
......
......@@ -346,37 +346,34 @@ class AudioHomeActivity :
runOnUiThread {
var status = -1
var netStatus = when (uid) {
listenerUid!!.toInt() -> {
0 -> {
if (txQuality in 1..2 && rxQuality in 1..2) {
""
} else if (txQuality >= 5 || rxQuality >= 5) {
"对方的网络已断开"
"的网络已断开"
} else {
status = if (txQuality >= 4 || rxQuality >= 4) {
0
} else {
1
}
"对方的网络状况不佳"
"的网络状况不佳"
}
}
0 -> {
else -> {
if (txQuality in 1..2 && rxQuality in 1..2) {
""
} else if (txQuality >= 5 || rxQuality >= 5) {
"的网络已断开"
"对方的网络已断开"
} else {
status = if (txQuality >= 4 || rxQuality >= 4) {
0
} else {
1
}
"的网络状况不佳"
"对方的网络状况不佳"
}
}
else -> {
""
}
}
showNetStatus(netStatus, status)
}
......@@ -605,7 +602,12 @@ class AudioHomeActivity :
waitDisposable =
Observable.interval(0, 100, TimeUnit.MILLISECONDS).subscribeOn(Schedulers.computation())
.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
progress_view.setProgress(result)
if (result >= 100f && !iv_hang_up.isEnabled) {
......@@ -613,10 +615,11 @@ class AudioHomeActivity :
iv_hang_up.isEnabled = true
iv_hang_up.setImageResource(R.drawable.audioim_img_hang_up)
}
}, {
LogUtil.d(it.message)
}) {
waittingStatus()
// waittingStatus()
if (!isConnectSuccess) {
//关闭音乐
stopPlaying()
......@@ -633,7 +636,8 @@ class AudioHomeActivity :
//通话结束或挂断时,上传日志文件
uploadLog()
showChooseDialog(2)
showToast("对方手机暂时不在身边,请稍后再试")
userCloseCalling()
}
}
......@@ -810,12 +814,12 @@ class AudioHomeActivity :
//挂断按钮可点击
iv_hang_up.isEnabled = true
iv_hang_up.setImageResource(R.drawable.audioim_img_hang_up)
if (!isConnectSuccess) {
//页面等待文案调整
tv_waiting.visibility = View.GONE
tv_change_doctor.text = "对方暂无应答,正在为您切换线路重播"
tv_change_doctor.visibility = View.VISIBLE
}
// if (!isConnectSuccess) {
// //页面等待文案调整
// tv_waiting.visibility = View.GONE
// tv_change_doctor.text = "对方暂无应答,正在为您切换线路重播"
// tv_change_doctor.visibility = View.VISIBLE
// }
if (!isShowAXB) {
tv_change_route.visibility = View.GONE
} else {
......@@ -1073,19 +1077,25 @@ class AudioHomeActivity :
*/
private fun showNetStatus(msg: String, status: Int = 0) {
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)
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)
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)
......
......@@ -326,37 +326,34 @@ class ConsultantAudioHomeActivity : BaseMvpActivity<IConsultantAudioHomeActivity
super.onNetworkQuality(uid, txQuality, rxQuality)
var status = -1
var netStatus = when (uid) {
userId!!.toInt() -> {
0 -> {
if (txQuality in 1..2 && rxQuality in 1..2) {
""
} else if (txQuality >= 5 || rxQuality >= 5) {
"对方的网络已断开"
"的网络已断开"
} else {
status = if (txQuality >= 4 || rxQuality >= 4) {
0
} else {
1
}
"对方的网络状况不佳"
"的网络状况不佳"
}
}
0 -> {
else -> {
if (txQuality in 1..2 && rxQuality in 1..2) {
""
} else if (txQuality >= 5 || rxQuality >= 5) {
"的网络已断开"
"对方的网络已断开"
} else {
status = if (txQuality >= 4 || rxQuality >= 4) {
0
} else {
1
}
"的网络状况不佳"
"对方的网络状况不佳"
}
}
else -> {
""
}
}
showNetStatus(netStatus, status)
......
<?xml version="1.0" encoding="utf-8"?>
<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_height="wrap_content"
android:gravity="center"
android:paddingTop="@dimen/platform_dp_16"
android:paddingBottom="@dimen/platform_dp_16">
android:orientation="horizontal">
<View
android:layout_width="48dp"
android:layout_height="0.5dp"
android:background="@color/platform_color_EBEBEB"
android:layout_marginRight="@dimen/platform_dp_8"/>
<TextView
android:layout_width="wrap_content"
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_999999"
android:textSize="@dimen/platform_dp_10"
android:text="我是有底线的"/>
<View
android:layout_width="48dp"
android:layout_height="0.5dp"
android:layout_marginLeft="@dimen/platform_dp_8"
android:background="@color/platform_color_EBEBEB"/>
android:background="@color/baby_blue"
android:scaleType="centerCrop"
android:src="@drawable/home_ydl_logo" />
</LinearLayout>
\ No newline at end of file
......@@ -159,7 +159,7 @@ public class MineFragment extends BaseFragment implements SwipeRefreshLayout.OnR
init();
jtv_test.setVisibility(BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
// jtv_test.setVisibility(BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
refreshCouponData();
}
......
......@@ -553,7 +553,6 @@
android:layout_marginLeft="16dp"
android:layout_marginTop="20dp"
android:layout_marginRight="14dp"
android:layout_marginBottom="20dp"
android:elevation="4dp"
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