Created
August 25, 2015 11:06
-
-
Save mariusk/63f3e6503200e92cae5b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun onClickLogin(@suppress("UNUSED_PARAMETER") v: View) { | |
Log.i(TAG, "onClickLogin "+email+" "+password+" "+Token.type+" "+Token.token); | |
Server.login(email, password, Token.type, Token.token) | |
.successUi { json -> | |
Log.i(TAG, "login successful, json: "+json.toString()) | |
val user = json.getJSONObject("user") | |
AppState.auth.setUser(user.getInt("userid"), | |
user.getString("email"), | |
user.getString("name")) | |
Toast.makeText(this.getContext(), | |
"Login successful", Toast.LENGTH_LONG).show() | |
Log.i(TAG, "POST TOAST") | |
} | |
.failUi { | |
Toast.makeText(this.getContext(), | |
"Login failed!", Toast.LENGTH_LONG).show(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment