How to set max line length in Android Studio code editor?

If you need not a soft wrap,
but actually, brake one long line onto several lines you need:

Go to Preferences(mac) or Settings(windows) -> Editor -> Code style -> Java/Kotlin -> Wrapping and braces (tab) -> Check "Ensure that right margin is not exceeded"

Now try to reformat your code:
press OPTION (ALT) + CMD + L on your Mac (or CTRL + ALT + L on PC)

Edit 13.02.19

As noted in comments this option seems not available in settings for Kotlin. However, there is a workaround to manually add it.
Here is what it takes to make it work:

  1. Export the settings scheme. enter image description here

  2. Open saved xml file.

  3. Find <codeStyleSettings language="kotlin"> tag (or create)

  4. Add the WRAP_LONG_LINES setting manually:

    <codeStyleSettings language="kotlin">
       ...
       <option name="WRAP_LONG_LINES" value="true" />
    </codeStyleSettings>
    
  5. Save edits and and import back the scheme.

  6. Here you go!


MacOS:

  1. Click on Android Studio ( left top corner )
  2. Click Preferences
  3. Type Code Style in search
  4. Click on Code Style
  5. There is a filed right to the 'Hard wrap at' - you can enter needed about of symbols you need

    enter image description here