Joe
01/23/2018, 10:34 AMsocket.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:
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)?