|
@@ -20,6 +20,7 @@ import com.swago.baseswago.util.NoDoubleClickListener
|
|
|
import com.swago.baseswago.util.UserInfo
|
|
|
import com.swago.lib_country_picker.Country
|
|
|
import com.swago.user.databinding.ActivityUserEditBinding
|
|
|
+import com.swago.user.dialog.XingZuoDialog
|
|
|
import top.zibin.luban.Luban
|
|
|
import top.zibin.luban.OnCompressListener
|
|
|
import java.io.File
|
|
@@ -47,6 +48,8 @@ class EditInfoActivity : BaseXActivity<ActivityUserEditBinding>() {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private var dialog : XingZuoDialog? =null
|
|
|
+
|
|
|
override fun initOther() {
|
|
|
setBackView(binding.toolbar.ivBack)
|
|
|
binding.toolbar.tvTitle.text = AppContext.getContext().resources.getString(R.string.edit_profile)
|
|
@@ -64,7 +67,7 @@ class EditInfoActivity : BaseXActivity<ActivityUserEditBinding>() {
|
|
|
binding.etName.setText(it.user_name)
|
|
|
binding.etAge.setText(it.user_age)
|
|
|
binding.etSign.setText(it.user_signature)
|
|
|
- binding.etConstellation.setText(it.user_constellation)
|
|
|
+ binding.tvConstellation.text = it.user_constellation
|
|
|
binding.tvCountry.text = it.user_country
|
|
|
if (it.user_sex == 0){
|
|
|
binding.tvSex.text = AppContext.getContext().resources.getString(R.string.male)
|
|
@@ -104,20 +107,6 @@ class EditInfoActivity : BaseXActivity<ActivityUserEditBinding>() {
|
|
|
})
|
|
|
|
|
|
|
|
|
- binding.etConstellation.addTextChangedListener(object:TextWatcher{
|
|
|
- override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
|
|
|
- }
|
|
|
-
|
|
|
- override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
|
|
- }
|
|
|
-
|
|
|
- override fun afterTextChanged(s: Editable?) {
|
|
|
- constellation =binding.etConstellation.text.toString()
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
binding.etSign.addTextChangedListener(object:TextWatcher{
|
|
|
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
|
|
|
}
|
|
@@ -150,6 +139,18 @@ class EditInfoActivity : BaseXActivity<ActivityUserEditBinding>() {
|
|
|
startActivityForResult(Intent(this@EditInfoActivity,CountryActivity::class.java),111)
|
|
|
}
|
|
|
})
|
|
|
+ binding.clConstellation.setOnClickListener(object:NoDoubleClickListener(){
|
|
|
+ override fun onClick() {
|
|
|
+ if (dialog == null){
|
|
|
+ dialog = XingZuoDialog.newInstance()
|
|
|
+ dialog?.callback = {
|
|
|
+ constellation = it
|
|
|
+ binding.tvConstellation.text = it
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dialog?.show(supportFragmentManager,"XingZuoDialog")
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
|
|
|
binding.tvSave.setOnClickListener(object : NoDoubleClickListener() {
|
|
@@ -211,14 +212,15 @@ class EditInfoActivity : BaseXActivity<ActivityUserEditBinding>() {
|
|
|
}
|
|
|
|
|
|
override fun initLiveData() {
|
|
|
- userVm.modifyInfoLiveData.observe(this,{
|
|
|
+ userVm.modifyInfoLiveData.observe(this) {
|
|
|
Toast.makeText(AppContext.getContext(), "Modify Success", Toast.LENGTH_SHORT).show()
|
|
|
- })
|
|
|
+ finish()
|
|
|
+ }
|
|
|
|
|
|
- userVm.uploadPicUrlLiveData.observe(this,{
|
|
|
+ userVm.uploadPicUrlLiveData.observe(this) {
|
|
|
imageUrl = it.path
|
|
|
Toast.makeText(AppContext.getContext(), "Upload Success", Toast.LENGTH_SHORT).show()
|
|
|
- })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|