경고를 피하기 위해 performClick in Kotlin을 재정의하는 방법.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이 작동하지 않습니다.
코드와 관련하여 예제를 제공 할 수 있습니까? 더 나은 이해를 위해. 감사 –