In addition to Deepak Azad's answer, you may need the following:
Windows : Window β Settings β Java β Code Style
β Formatter β Edit β Linear Packaging (tab)
Mac OS : ADT -> Preferences -> Java -> Code Style
β Formatter β Edit β Linear Packaging (tab)
Then in the list on the left, select:
Function Calls β Qualified Calls
Now, under this list, set the Line Wrap Policy :
Wrap all items except the first item if not necessary
Verify
Separation force, even if the line is less than the maximum line width
Finally, set the indentation policy to (thanks @Turbo ):
Indent by Column
It should give you the exact behavior you requested.
BONUS: Android Studio / IntelliJ Idea:
Mac OS : Android Studio β Settings ( Cmd +, ) β Editor β Code Style β Java β Wrap and Bindings tab β Call Chains
select
Always wrap
and check
Multiline Alignment
Christian GarcΓa May 04 '12 at 9:21 am 2012-05-04 09:21
source share