|
@@ -22,6 +22,7 @@ import org.brynhild.graduation.common.utils.JsonUtils
|
|
|
import org.brynhild.graduation.common.utils.MultipleSelectHandler
|
|
|
import org.brynhild.graduation.databinding.ActivityDeviceDetailInfoBinding
|
|
|
import org.brynhild.graduation.databinding.AdminCreateDeviceDialogBinding
|
|
|
+import org.brynhild.graduation.databinding.AdminEnrollFingerPrintDialogBinding
|
|
|
import org.brynhild.graduation.databinding.AdminModifyAreaDialogBinding
|
|
|
import org.brynhild.graduation.databinding.AdminModifyDeviceDialogBinding
|
|
|
import org.brynhild.graduation.network.adapter.DeviceAdapter
|
|
@@ -169,7 +170,7 @@ class DeviceDetailInfoActivity : BaseActivity() {
|
|
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
|
|
when (item.itemId) {
|
|
|
R.id.admin_device_modify->{
|
|
|
- val dialogLayout= AdminModifyDeviceDialogBinding.inflate(LayoutInflater.from(this))
|
|
|
+ val dialogLayout= AdminModifyDeviceDialogBinding.inflate(LayoutInflater.from(this))
|
|
|
dialogLayout.owner.setText(device.owner.toString())
|
|
|
dialogLayout.area.setText(device.area.toString())
|
|
|
dialogLayout.active.setText(device.active.toString())
|
|
@@ -242,6 +243,41 @@ class DeviceDetailInfoActivity : BaseActivity() {
|
|
|
.build()
|
|
|
.show()
|
|
|
}
|
|
|
+ R.id.admin_finger_enroll->{
|
|
|
+ val dialogLayout= AdminEnrollFingerPrintDialogBinding.inflate(LayoutInflater.from(this))
|
|
|
+
|
|
|
+ AlertDialog.Builder(this)
|
|
|
+ .setTitle("修改信息")
|
|
|
+ .setView(dialogLayout.root)
|
|
|
+ .setPositiveButton("确认修改"){_,_->
|
|
|
+ val service= ServiceCreator.create(AdminService::class.java)
|
|
|
+ val data= EnrollFingerPrint(
|
|
|
+ dialogLayout.userId.text.toString().toLongOrNull(),
|
|
|
+ device.mac
|
|
|
+ )
|
|
|
+ service.enrollFingerPrint(LoginConfiguration.userInfo!!.token,data).enqueue(object :
|
|
|
+ Callback<Result> {
|
|
|
+ override fun onResponse(
|
|
|
+ call: Call<Result>,
|
|
|
+ response: Response<Result>
|
|
|
+ ) {
|
|
|
+ ResponseHandler.handle(response,{
|
|
|
+ ResponseHandler.showMessage(it)
|
|
|
+ },{
|
|
|
+ ResponseHandler.showMessage(it)
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun onFailure(call: Call<Result>, t: Throwable) {
|
|
|
+ t.printStackTrace()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .setNegativeButton("取消修改"){_,_->
|
|
|
+
|
|
|
+ }
|
|
|
+ .show()
|
|
|
+ }
|
|
|
}
|
|
|
return true
|
|
|
}
|