Android Studio by default format Butterknife code in this way:
@BindView(R.id.text_view)
TextView mTextView
Is there a way to tell Android Studio to format code in one line, like this:
@BindView(R.id.text_view) TextView mTextView
If this is possible I would like this rule to apply only to @BindView
annotation.
in Android Studio 2.3.3 File -> Settings -> Editor ->Code Style -> Java -> Wrapping and Braces -> Field annotations -> set to "Do not Wrap"
but this will prevent AS to put the new line on all field annotations.
i don't know if it is possible to have this option only for @BindView, however, if you set the option like this, AS will not put all annotations inline. for instance if you have
@Nullable
String foo;
@BindView View bar;
and format the code, AS will leave both annotations as they are.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With