package Ġcom . ser ch in ast ico . lin . detector s Ċ Ċ import Ġcom . android . tools . lint . detector . api . Scope Ċ import Ġcom . ser ch in ast ico . lin . annotations . Detector Ċ import Ġcom . ser ch in ast ico . lin . dsl . detector Ċ import Ġcom . ser ch in ast ico . lin . dsl . is Class Or Subclass Of Ċ import Ġcom . ser ch in ast ico . lin . dsl . issue Ċ import Ġorg . jetbrains . u ast . U Call Expression Ċ Ċ @ Detector Ċ fun Ġno Find ViewById Calls () Ġ= Ġdetector ( ĊĠĠĠ Ġissue ( ĊĠĠĠĠĠĠĠ ĠScope . JAVA _ FILE _ SCOPE , ĊĠĠĠĠĠĠĠ Ġ" There Ġshould Ġnot Ġbe Ġcalls Ġto ĠfindViewById ", ĊĠĠĠĠĠĠĠ Ġ""" Now ad ays Ġthere Ġare Ġbetter Ġways Ġto Ġsynt het ize Ġthese Ġcalls Ġinto Ġa Ġmore Ġconcise Ġdeclaration Ġwith Ġtools ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ| Ġlike ĠB utter Kn ife . ĠSee Ġhttps :// github . com / J ake Wh art on / but ter knife Ġor ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ| Ġhttps :// kotlin lang . org / docs / tutorials / android - plugin . html # view - binding """. trim Margin () ĊĠĠĠ Ġ) Ċ ) Ġ{ ĊĠĠĠ Ġcall Expression Ġ{ Ġsuch That Ġ{ Ġit . is Find ViewById Call Ġ} Ġ} Ċ } Ċ Ċ private Ġinline Ġval ĠU Call Expression . is Find ViewById Call : ĠBoolean ĊĠĠĠ Ġget () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġreceiver Type Ġ= Ġreceiver Type Ġ?: Ġreturn Ġfalse ĊĊĠĠĠĠĠĠĠ Ġval Ġis Receiver Child Of Activity Or View Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreceiver Type . is Class Or Subclass Of (" android . app . Activity ", Ġ" android . view . View ") ĊĠĠĠĠĠĠĠ Ġval Ġis Method Find ViewById Ġ= Ġmethod Identifier ?. name Ġ== Ġ" findViewById " ĊĠĠĠĠĠĠĠ Ġval Ġis Not Android Content Id Ġ= Ġvalue Arguments . first OrNull ()?. as Source String () Ġ== Ġ" android . R . id . content " ĊĊĠĠĠĠĠĠĠ Ġreturn Ġis Receiver Child Of Activity Or View Ġ&& Ġis Method Find ViewById Ġ&& Ġ! isNot Android Content Id ĊĠĠĠ Ġ} Ċ