Find deprecated Android APIs
ProprietarySearch-only bundle that flags Android APIs the platform has deprecated or removed: findViewById, AsyncTask, the single-arg getColor/getDrawable/getColorStateList resource getters, the zero-arg Handler() constructor, kotlinx.android.synthetic imports, the moved kotlinx.android.parcel.Parcelize import, startActivityForResult/onActivityResult/requestPermissions, LocalBroadcastManager, deprecated Fragment lifecycle methods, Resources.getDrawable / getColor, startService, PreferenceManager, Vibrator.vibrate(long), Context.registerReceiver without flags, and MutableLiveData allocations.
org. openrewrite. kotlin. android. FindDeprecatedAndroidApis$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. android. FindDeprecatedAndroidApis$KtRecipe'Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.
Recipe list
It runs these recipes, in this order.
- Find
findViewByIdcall sites - Find
AsyncTaskinstantiations - Find
AsyncTask.execute/executeOnExecutorcalls - Find deprecated
Context.getColor/getDrawable/getColorStateListcalls - Find
resources.getDrawable(...)(one-arg) calls - Find
resources.getColor(...)(one-arg) calls - Find
Handler()constructor calls without an explicitLooper - Find
kotlinx.android.synthetic.*imports - Find
kotlinx.android.parcelimports - Find
startActivityForResultcalls - Find
onActivityResultoverrides - Find direct
requestPermissions(...)calls - Find
onRequestPermissionsResultoverrides - Find
LocalBroadcastManager.getInstance(...)usage - Find
Fragment.setRetainInstance(true)calls - Find
FragmentManager.executePendingTransactions()calls - Find
Fragment.onAttach(Activity)overrides - Find
Fragment.onActivityCreatedoverrides - Find
AlertDialog.Builder(this)constructions - Find
startService(...)calls - Find
PreferenceManager.getDefaultSharedPreferences(...)calls - Find
android.preference.PreferenceManagerimports - Find
Vibrator.vibrate(long)(one-arg) calls - Find
Context.registerReceiver(...)calls - Find
MutableLiveDataallocations