add login and board_list #26

Manually merged
norangebit merged 38 commits from feature_integrate_login into develop 2020-01-14 19:53:09 +00:00
Showing only changes of commit ac590e418d - Show all commits

View File

@ -3,6 +3,7 @@ package it.unisannio.ding.ids.wedroid.app.view
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import android.webkit.URLUtil
import android.widget.Toast import android.widget.Toast
import it.unisannio.ding.ids.wedroid.app.R import it.unisannio.ding.ids.wedroid.app.R
import it.unisannio.ding.ids.wedroid.app.util.SharedPreferenceHelper import it.unisannio.ding.ids.wedroid.app.util.SharedPreferenceHelper
@ -39,10 +40,17 @@ class LoginActivity : AppCompatActivity() {
val userNameText = username.text.toString() val userNameText = username.text.toString()
val passwordText = password.text.toString() val passwordText = password.text.toString()
val instanceServerText = instanceServer.text.toString()
if (!URLUtil.isValidUrl(instanceServerText)){
Toast.makeText(this, "Formato URL non valido", Toast.LENGTH_LONG)
.show()
return
}
val service = Retrofit.Builder() val service = Retrofit.Builder()
.addConverterFactory(GsonConverterFactory.create()) .addConverterFactory(GsonConverterFactory.create())
.baseUrl(instanceServer.text.toString()) .baseUrl(instanceServerText)
.build() .build()
.create(LoginService::class.java) .create(LoginService::class.java)