본문 바로가기
Development/Android

[android] onTouch 사용 시 ClickableViewAccessibility 주의

by Sonagiya 2021. 3. 8.
728x90
반응형

onTouch 메소드를 쓸 때 접근성을 위해 perfomClick 을 호출해야 한다고 합니다.

경고를 없에는 방법은 아래와 같습니다.

  • 작업이 끝나고 true가 리턴될때 view.perfomClick을 호출
  • 어노테이션(@SuppressLint("ClickableViewAccessibility"))을 사용
onTouch lambda should call View#performClick when a click is detected

If a View that overrides onTouchEvent or uses an OnTouchListener does not also implement performClick and call it when clicks are detected, the View may not handle accessibility actions properly. Logic handling the click actions should ideally be placed in View#performClick as some accessibility services invoke performClick when a click action should occur.

Issue id: ClickableViewAccessibility

 

반응형

댓글