📜  如何在 kotlin 中使用安全 args - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:38.477000             🧑  作者: Mango

代码示例1
def nav_version = "2.3.5"
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version")
id("androidx.navigation.safeargs")
        
override fun onClick(v: View) {
   val amountTv: EditText = view!!.findViewById(R.id.editTextAmount)
   val amount = amountTv.text.toString().toInt()
   val action = SpecifyAmountFragmentDirections.confirmationAction(amount)
   v.findNavController().navigate(action)
}