Advertisement
Guest User

Untitled

a guest
Oct 24th, 2018
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. package bjd.adrian.e_shop
  2.  
  3. import android.content.Context
  4. import android.util.Log
  5.  
  6. class LoginPresenter
  7. {
  8.  
  9. val TAG = "LOGIN PRESENTER"
  10.  
  11. val dbManager: DbManager = DbManager()
  12. val loginView = LoginView()
  13.  
  14. var context: Context = loginView.context
  15.  
  16. fun login(username: String, password: String)
  17. {
  18. dbManager.login(username, password)
  19.  
  20. loginView.showLoadingIndicator()
  21. }
  22.  
  23. fun endLogin()
  24. {
  25. var isLogged: Boolean
  26. isLogged = dbManager.isLogged
  27.  
  28. if(isLogged.equals(true))
  29. {
  30. loginView.hideLoadingIndicator()
  31. Log.v(TAG, "login Ended, LOGGED")
  32.  
  33. }
  34. else
  35. {
  36. loginView.unLogged()
  37. Log.v(TAG, context.getString(R.string.invalidUSorPASS))
  38. loginView.hideLoadingIndicator()
  39. }
  40.  
  41.  
  42. }
  43.  
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement