Commit 9db6f784 by 严久程

防止连击

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