override fun itemclick(position: Int) {
binding.progressbar.visibility=View.VISIBLE
binding?.barcode?.setImageBitmap(exchngeViewModel.getQrImageBitmap(qrCodeData[position], this!!.activity!!))
showDetail(position)
binding.progressbar.visibility=View.GONE
}
fun getQrImageBitmap(data: String, context: Context): Bitmap? {
bitMap = AppUtils.TextToImageEncode(data, context, bus)
return this!!.bitMap
}
这是我的代码我希望在项目点击时显示进度dialog
它应该解除,直到getQrImageBitmap
和showDetail功能完成但我不工作的时候请建议我如何实现这个如何显示和隐藏项目点击的细节。谢谢!!
答案 0 :(得分:0)
在showDetail()
方法
fun showDetail(position: Int) {
SharedPreferenceUtils.setExchangePagePostion(this!!.activity!!, position)
binding?.textHeader?.text = exchangeData[position]
binding?.backButton?.visibility = View.VISIBLE
binding?.recyclerView?.visibility = View.GONE
binding?.barcode?.visibility = View.VISIBLE
binding?.header1?.setBackgroundResource(R.color.colorOrangeGray)
binding?.exchangeButton?.visibility = View.VISIBLE
binding.progressbar.visibility=View.GONE
}