|
@@ -1,5 +1,10 @@
|
|
|
package com.grkj.iscs_mc.view.fragment
|
|
package com.grkj.iscs_mc.view.fragment
|
|
|
|
|
|
|
|
|
|
+import android.content.Context
|
|
|
|
|
+import android.text.Editable
|
|
|
|
|
+import android.text.TextWatcher
|
|
|
|
|
+import android.view.inputmethod.InputMethodManager
|
|
|
|
|
+import android.widget.EditText
|
|
|
import androidx.navigation.fragment.navArgs
|
|
import androidx.navigation.fragment.navArgs
|
|
|
import com.bumptech.glide.Glide
|
|
import com.bumptech.glide.Glide
|
|
|
import com.grkj.iscs_mc.R
|
|
import com.grkj.iscs_mc.R
|
|
@@ -57,7 +62,30 @@ class MaterialInspectionTableFragment :
|
|
|
vo.status = "2"
|
|
vo.status = "2"
|
|
|
mBinding?.rvMaterial?.adapter?.notifyItemChanged(position)
|
|
mBinding?.rvMaterial?.adapter?.notifyItemChanged(position)
|
|
|
}
|
|
}
|
|
|
- holder.setText(R.id.tv_measure, vo.measure ?: "")
|
|
|
|
|
|
|
+// holder.setText(R.id.tv_measure, vo.measure ?: "")
|
|
|
|
|
+ val et = holder.getView<EditText>(R.id.et_measure)
|
|
|
|
|
+ et.setText(vo.measure ?: "")
|
|
|
|
|
+ val textWatcher = object : TextWatcher {
|
|
|
|
|
+ override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {}
|
|
|
|
|
+
|
|
|
|
|
+ override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {
|
|
|
|
|
+ if (et.hasFocus()) {
|
|
|
|
|
+ vo.measure = p0.toString()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ override fun afterTextChanged(p0: Editable?) {}
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ et.setOnFocusChangeListener { view, b ->
|
|
|
|
|
+ if (b) {
|
|
|
|
|
+ et.addTextChangedListener(textWatcher)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ et.removeTextChangedListener(textWatcher)
|
|
|
|
|
+ val imm = requireContext().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
|
|
|
|
+ imm.hideSoftInputFromWindow(view.windowToken, 0)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|