Hi, I have a question about the new presets from t...
# codingconventions
j
Hi, I have a question about the new presets from the style guide in Android Studio (hopefully this is the right place): I have a bit of code that is a chain of blocks that looks like this:
Copy code
socket.on(Socket.EVENT_CONNECT) { data ->
    data.print("Socket Connect")
    socket.emit("login", "{\"bearer_token\": \"${prefs.authToken}\"}")
}.on("login_response") { data ->
    data.print("Login Response")
    emitSubscribe()
    mConnectionStatus.postValue(true)
}.on("subscribe_response") { data ->
    data.print("Subscribe Response")
}.on(Socket.EVENT_DISCONNECT) { data ->
    data.print("Socket Disconnect")
    socket.connect()
}
But Android Studio really wants it to look like this:
Copy code
socket.on(Socket.EVENT_CONNECT) { data ->
    data.print("Socket Connect")
    socket.emit("login", "{\"bearer_token\": \"${prefs.authToken}\"}")
}.on("login_response") { data ->
        data.print("Login Response")
        emitSubscribe()
        mConnectionStatus.postValue(true)
    }.on("subscribe_response") { data ->
        data.print("Subscribe Response")
    }.on(Socket.EVENT_DISCONNECT) { data ->
        data.print("Socket Disconnect")
        socket.connect()
    }
First, is that really meant to be the case? And either way, what exactly do I need to change in my preferences to stop to this suggestion (because I think this is one place I’m going to have to go against the grain)?