Commit 9db6f784 by 严久程

防止连击

parent aa52679c
......@@ -5,6 +5,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import com.ydl.ydlcommon.utils.Utils
import com.yidianling.im.R
/**
......@@ -26,6 +27,10 @@ class CollectInfoStyleAdapter(var list: List<String>, var event: (title: String)
override fun onBindViewHolder(holder: InfoStyleHolder?, position: Int) {
holder!!.bindData(list[position])
holder.itemView.setOnClickListener {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
event(list[position])
}
}
......
......@@ -18,6 +18,7 @@ import android.widget.EditText
import android.widget.LinearLayout
import android.widget.ScrollView
import android.widget.TextView
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.view.dialog.CommonDialog
import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil
......@@ -54,6 +55,10 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
orientation = VERTICAL
tv_skip.setOnClickListener {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
showSkipDialog()
}
}
......@@ -70,6 +75,11 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
private fun proceedNext(list: List<UserQuestInfoBean>) {
tv_start.setOnClickListener {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
addContentView(resultInfoList[1].question!!, true)
tv_start.visibility = View.GONE
......@@ -78,6 +88,10 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
tv_gender_male.setOnClickListener {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
addContentView(tv_gender_male.text.toString(), false)
tv_gender_male.postDelayed({
genderStr = "性别:男"
......@@ -87,6 +101,10 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
}, 300)
}
tv_gender_fomale.setOnClickListener {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
addContentView(tv_gender_fomale.text.toString(), false)
tv_gender_fomale.postDelayed({
genderStr = "性别:女"
......@@ -109,6 +127,10 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
}
date_pick.maxDate = Calendar.getInstance().timeInMillis
tv_age_ensure.setOnClickListener {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
ageStr = "年龄:${(Calendar.getInstance().get(Calendar.YEAR) - year)}岁"
addContentView("${year}年", false)
......@@ -145,6 +167,10 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
}
tv_send.setOnClickListener {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
val content = et_input.text.trim().toString()
if (TextUtils.isEmpty(content)) {
ToastUtil.toastShort("请输入内容")
......@@ -161,6 +187,10 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
}
tv_finish.setOnClickListener {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
val resultContent = ageStr + "\n" + genderStr + "\n" + questionStyleStr + "\n" + questionStr
val genderBean = UserQuestInfoBean(list[1].userInfoType, "", ArrayList(), genderStr.split(":")[1])
......
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