dengzii / RemoveButterKnife

Remove ButterKnife annotations and generate view id binding code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove ButterKnife

Remove ButterKnife binding annotations, generate bindView method and findViewById instead.

screen_cap

TODO

  • Activity, View, Dialog, Fragment.
  • Replace ButterKnief.bind with bindView method.
  • @BindXxx => findViewById or getResource().getXxx(R.id.xx).
  • @OnClick, @OnLongClick => setOnClickListener, setOnLongClickListener
  • @OnCheckedChanged, @OnEditorAction, @OnFocusChange, @OnItemClick, @OnItemSelected, @OnPageChange, @OnTouch
  • @BindArray => getResource().getXxxArray(R.id.xx).
  • @BindViews => findViewById
  • Custom field name, bind method name.
  • Enable generation option.
  • Remove import statement on success.

Install

  • install from release jar

    • Navigation -> File -> Settings -> Plugins -> On the top side, click 'gear' icon -> install plugin form disk -> choose the jar you download
  • install from IntelliJ Plugin Repository

    • Navigation -> File -> Settings -> Plugins -> search 'Generate FindViewById'

Usage

Code Editor > Right Mouse Button > Refactor > Remove ButterKnife

Build

Kotlin dependency <depends>org.jetbrains.kotlin</depends> must import kotlin plugin jars as project dependency first, import dependency from Project Structure > Module > Dependencies, choose kotlin plugin your IDEA installation path > plugin > kotlin > lib.

About

Remove ButterKnife annotations and generate view id binding code.

License:Apache License 2.0


Languages

Language:Kotlin 95.1%Language:Java 4.9%