Skip to content

Instantly share code, notes, and snippets.

@bootstraponline
Forked from tadfisher/AutofillInterceptor.kt
Created August 17, 2017 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bootstraponline/e70629f1a4fcce4399a05eceaf00ed32 to your computer and use it in GitHub Desktop.
Save bootstraponline/e70629f1a4fcce4399a05eceaf00ed32 to your computer and use it in GitHub Desktop.
AutofillKiller
import android.os.Build
import android.view.View
import io.github.inflationx.viewpump.InflateResult
import io.github.inflationx.viewpump.Interceptor
import javax.inject.Inject
class AutofillKillerInterceptor : Interceptor {
override fun intercept(chain: Interceptor.Chain): InflateResult {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
return chain.proceed(chain.request())
}
val result = chain.proceed(chain.request())
result.view()?.importantForAutofill = View.IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS
return result
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment