Commit 852a4569 by 刘鹏

Merge branch 'feat/lp/lp_4.3.98_2' into 'd/v4.3.98'

Feat/lp/lp 4.3.98 2

See merge request app_android_lib/YDL-Component!179
parents 1e845878 788b3b3c
......@@ -29,7 +29,7 @@ ext {
"ydl-webview" : "0.0.38.93",
"ydl-media" : "0.0.21.52",
"ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.30.19",
"m-audioim" : "0.0.49.30.22",
"ydl-flutter-base": "0.0.14.38",
......@@ -116,7 +116,7 @@ ext {
"ydl-webview" : "0.0.38.93",
"ydl-media" : "0.0.21.52",
"ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.30.19",
"m-audioim" : "0.0.49.30.22",
"ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动
......
......@@ -561,7 +561,7 @@ class AudioHomeActivity :
writeAgoraLog("主叫方发送的邀请通话消息内容:$content", true)
AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "主叫方发送的邀请通话消息内容:$content")
localRemainTime = (totalDuration ?: 1500).minus(remainTime?.toInt() ?: 1500)
localRemainTime = remainTime?.toInt() ?: 1500
handler = Handler()
vibrator = getSystemService(Service.VIBRATOR_SERVICE) as Vibrator?
......
......@@ -107,7 +107,7 @@
android:id="@+id/tv_notes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="已通话时长"
android:text="剩余时长:"
android:textColor="@color/white"
android:textSize="18sp"
app:layout_constraintEnd_toStartOf="@+id/tv_remain_time"
......
......@@ -402,6 +402,9 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
@SuppressLint("ClickableViewAccessibility")
private fun webViewInit(wv_content: ProgressWebView) {
val userService = findRouteService(IUserService::class.java)
val isLogin = userService.isLogin()
first_order.visibility = if (isLogin) View.GONE else View.VISIBLE
val setting: WebSettings = wv_content?.settings!!
//支持js
setting.setJavaScriptEnabled(true)
......@@ -687,11 +690,12 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
//登录成功
fun onEvent(event: UserLoginEvent) {
loadUrl()
webViewInit(wv_content)
}
//绑定成功
fun onEvent(event: UserBindPhoneEvent) {
loadUrl()
webViewInit(wv_content)
}
}
\ No newline at end of file
......@@ -51,10 +51,15 @@ import com.yidianling.user.safePrivate.HandUnlockCheckActivity
import com.yidianling.user.ui.CountryListActivity
import com.yidianling.user.ui.login.contract.ILoginContract
import com.yidianling.user.ui.login.presenter.LoginPresenterImpl
import com.yidianling.user.widget.AgreePrivacyBottomDialog
import com.yidianling.user.widget.SecretDialog
import com.yidianling.user.widget.ZDialog
import com.yidianling.user.widget.ZDialogDirection
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.user_activity_register_and_login_bottom.*
import kotlinx.android.synthetic.main.user_activity_register_and_login_new.*
import kotlinx.android.synthetic.main.user_activity_secret.*
/**
* @author jiucheng
......@@ -78,6 +83,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
private var handler: Handler? = null
private var isFromGuide = false//是否来自启动页
private var isFromOneKeyLogin = false // 是否来自一键登录界面
private var bottomDialog: AgreePrivacyBottomDialog? = null
companion object {
private var BIND_PHONE = "bind_phone"//用于判断时候是绑定手机号
......@@ -317,9 +323,11 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
et_phone_number.hint = SpannedString(hintStr)
}
/**
* 设置点击事件
*/
@SuppressLint("WrongConstant")
private fun setClickEvent() {
skip_bind.setOnClickListener {
ActionCountUtils.count(UserBIConstants.USER_REGISTER_PAGE_SKIP_CLICK)
......@@ -393,12 +401,34 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
startActivityForResult(intent, REQUEST_CODE_COUNTRY)
overridePendingTransition(R.anim.platform_slide_in_from_bottom, R.anim.user_slide_null)
}
//下一步
ll_next.setOnClickListener {
if (iv_select_protocol.visibility == View.VISIBLE && !isAgreeProtocol) {
val shake = AnimationUtils.loadAnimation(this, R.anim.user_shake_input)//加载动画资源文件 
check_protocol.startAnimation(shake)
ToastUtil.toastShort("请您先同意壹点灵《用户使用协议》、《隐私保护政策》,才能登录使用")
if (iv_select_protocol.visibility == View.VISIBLE && !isAgreeProtocol && !et_phone_number.text.isNullOrEmpty()) {
if (null == bottomDialog) {
bottomDialog = AgreePrivacyBottomDialog(
this,
object : AgreePrivacyBottomDialog.OnAgreeBottomListener {
override fun onCancel() {
}
override fun onSure() {
isAgreeProtocol = true
iv_select_protocol.setImageResource(R.drawable.user_login_protocol_selected_new)
if (checkPhone()) {
mPresenter.checkPhoneStatus(
userPhoneNumber!!,
countryCode!!,
isBindPhone
)
}
}
})
bottomDialog?.show()
} else {
bottomDialog?.show()
}
return@setOnClickListener
}
if (checkPhone()) {
......
package com.yidianling.user.widget
import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.text.Spannable
import android.text.SpannableString
import android.text.TextPaint
import android.text.method.LinkMovementMethod
import android.text.style.ClickableSpan
import android.view.Gravity
import android.view.View
import android.view.WindowManager
import androidx.core.content.ContextCompat
import com.yidianling.user.R
import com.yidianling.user.ui.login.H5Activity
import kotlinx.android.synthetic.main.user_agree_privacy_dialog.*
class AgreePrivacyBottomDialog(context: Context, private val listener: OnAgreeBottomListener?) :
Dialog(context, R.style.platform_dialog_default_style) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.user_agree_privacy_dialog)
val params = window.attributes
params.width = WindowManager.LayoutParams.MATCH_PARENT
params.height = WindowManager.LayoutParams.WRAP_CONTENT
window.setGravity(Gravity.BOTTOM)
window.attributes = params
user_dialog_no_agree.setOnClickListener {
//拒绝
listener?.onCancel()
dismiss()
}
user_dialog_secret_agree.setOnClickListener {
//同意
listener?.onSure()
dismiss()
}
user_agree_dialog_protocol.text = agreeDialogProtocol()
user_agree_dialog_protocol.movementMethod = LinkMovementMethod.getInstance()
}
interface OnAgreeBottomListener {
fun onCancel()
fun onSure()
}
private fun agreeDialogProtocol(): SpannableString {
val name = "请先同意" + context.resources.getString(R.string.user_login_name_start)
val str = "${name}用户使用协议、隐私\n保护政策才能登录使用哦"
var start = name.length
val spannableString = SpannableString(str)
spannableString.setSpan(object : ClickableSpan() {
override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color =
ContextCompat.getColor(context, R.color.user_1da1f2trans)
ds.isUnderlineText = true //设置下划线
}
override fun onClick(widget: View) {
H5Activity.start(context, false)
}
}, start, start + 6, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
spannableString.setSpan(object : ClickableSpan() {
override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color =
ContextCompat.getColor(context, R.color.user_1da1f2trans)
ds.isUnderlineText = true //设置下划线
}
override fun onClick(widget: View) {
H5Activity.start(context, true)
}
}, start + 7, start + 13, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
return spannableString
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners
android:topLeftRadius="@dimen/platform_dp_8"
android:topRightRadius="@dimen/platform_dp_8" />
<solid android:color="@color/white" />
</shape>
\ No newline at end of file
<?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="wrap_content"
android:background="@drawable/user_agree_dialog_top_right_left">
<TextView
android:id="@+id/user_agree_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_28"
android:text="使用协议及隐私保护"
android:textColor="@color/pay_color_242424"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"></TextView>
<TextView
android:id="@+id/user_agree_dialog_protocol"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_28"
android:text="请先同意协议才能登录使用哦"
android:textColor="@color/platform_color_BFBFBF"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/user_agree_title"></TextView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/platform_dp_40"
android:layout_marginTop="@dimen/platform_dp_28"
android:layout_marginRight="@dimen/platform_dp_40"
android:layout_marginBottom="@dimen/platform_dp_40"
android:background="#ffffff"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/user_agree_dialog_protocol">
<TextView
android:id="@+id/user_dialog_no_agree"
android:layout_width="wrap_content"
android:layout_height="44dp"
android:layout_marginRight="@dimen/platform_dp_12"
android:layout_weight="1"
android:background="@drawable/user_secret_left_btn_bg"
android:gravity="center"
android:text="拒绝"
android:textColor="#999999"
android:textSize="17sp" />
<TextView
android:id="@+id/user_dialog_secret_agree"
android:layout_width="wrap_content"
android:layout_height="44dp"
android:layout_marginLeft="5.5dp"
android:layout_weight="1"
android:background="@drawable/user_secret_right_btn_bg"
android:gravity="center"
android:text="同意"
android:textColor="#FFFFFF"
android:textSize="17sp"
android:textStyle="bold" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -205,7 +205,7 @@ class HttpConfig {
if(!isPlaintext(buffer)) return@Interceptor resp
val readString = buffer.clone().readString(Charset.forName("UTF-8"))
val fromJson = Gson().fromJson<BaseAPIResponse<Any>>(readString, BaseAPIResponse::class.java)
if (fromJson.code != "200") {
if (fromJson.code != "200" && fromJson.code != "0") {
Apm.reportCustom("network_business_error", "${api}(${fromJson.code},${fromJson.msg})", Exception("${api}(${fromJson.code},${fromJson.msg})"))
}
} catch (throwable: Throwable) {
......
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