I am adopting the @InjectView
theme throughout my project and have a minor issue when it comes to condensing these declarations. After I put in the initial code it looks great in one line like this..
@InjectView(R.id.tv_report_summary_name) TextView tvReportSummaryName;
However if I do an auto format (Ctrl + Shift + F), Android Studio is automatically replacing this with two lines so it looks like:
@InjectView(R.id.tv_report_summary_name)
TextView tvReportSummaryName;
Is there a way to avoid this or modify my formatting options to make this not happen? Any help is greatly appreciated.
When you open Preferences -> Code Style -> Java.
Choose Tab Wrapping and Braces.
After that scroll to bottom and there is option to set this style as is shown in the image below:
Choose which is wright for you.
Follow this :
File -> Settings -> Editor -> Code style -> Java -> Wrapping and Braces -- Field Annotation and select the checkbox (Do not wrap after single annotation)
Hopefully, it will solve your problem.
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