performtをオーバーライドして警告を回避する方法。Kotlin OnTouchListenerが呼び出されましたが、performClickをオーバーライドしません。
next.setOnTouchListener(View.OnTouchListener { view, motionEvent ->
when (motionEvent.action){
MotionEvent.ACTION_DOWN -> {
val icon: Drawable = ContextCompat.getDrawable(activity.applicationContext, R.drawable.layer_bt_next)
icon.setColorFilter(Color.GRAY, PorterDuff.Mode.MULTIPLY)
next.setImageDrawable(icon)
}
MotionEvent.ACTION_UP -> {
//view.performClick()
next.setImageResource(R.drawable.layer_bt_next)
}
}
[email protected] true
})
view.performClickは機能しません。
コードを例に挙げることはできますか?理解を深めるためにありがとう –