|
|
package com.br_technology.securitytrain_master.ui.mine.activity
|
|
|
|
|
|
import android.Manifest
|
|
|
import android.content.Intent
|
|
|
import android.view.View
|
|
|
import android.widget.Toast
|
|
|
import com.br_technology.securitytrain_master.R
|
|
|
import com.br_technology.securitytrain_master.databinding.ActivityEditPersonalInfoBinding
|
|
|
import com.br_technology.securitytrain_master.ext.initPermissions
|
|
|
import com.br_technology.securitytrain_master.ui.mine.viewmodel.EditPersonalInfoViewModel
|
|
|
import com.br_technology.securitytrain_master.util.PhotoUtils
|
|
|
import com.gyf.immersionbar.ImmersionBar
|
|
|
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
|
|
|
|
...
|
...
|
@@ -51,7 +53,18 @@ class EditPersonalInfoActivity : |
|
|
R.id.rl_up_load_image -> {
|
|
|
//上传和修改头像
|
|
|
initPermissions(Manifest.permission.CAMERA,
|
|
|
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
|
|
onGranted = {
|
|
|
PhotoUtils.get().photoDialogShow(this,"",object : PhotoUtils.PhotoCallBack{
|
|
|
override fun onSuccessListener(imagePath: String?) {
|
|
|
//上传照片到服务器
|
|
|
}
|
|
|
|
|
|
override fun onFailListener() {
|
|
|
//失败的回调
|
|
|
}
|
|
|
|
|
|
})
|
|
|
Toast.makeText(baseContext, "ccccc", Toast.LENGTH_SHORT).show()
|
|
|
},
|
|
|
onDenied = {
|
...
|
...
|
@@ -62,4 +75,12 @@ class EditPersonalInfoActivity : |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
|
|
super.onActivityResult(requestCode, resultCode, data)
|
|
|
if (resultCode == RESULT_OK){
|
|
|
PhotoUtils.get().onActivityResult(this,requestCode,resultCode,data!!)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|