mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-18 12:56:45 -06:00
[APIv2/Template] Add first login template.
This commit is contained in:
parent
46dd543b48
commit
10c439afad
@ -12,6 +12,7 @@ import pl.szczodrzynski.edziennik.api.v2.interfaces.EdziennikInterface
|
|||||||
import pl.szczodrzynski.edziennik.api.v2.models.ApiError
|
import pl.szczodrzynski.edziennik.api.v2.models.ApiError
|
||||||
import pl.szczodrzynski.edziennik.api.v2.prepare
|
import pl.szczodrzynski.edziennik.api.v2.prepare
|
||||||
import pl.szczodrzynski.edziennik.api.v2.template.data.TemplateData
|
import pl.szczodrzynski.edziennik.api.v2.template.data.TemplateData
|
||||||
|
import pl.szczodrzynski.edziennik.api.v2.template.firstlogin.TemplateFirstLogin
|
||||||
import pl.szczodrzynski.edziennik.api.v2.template.login.TemplateLogin
|
import pl.szczodrzynski.edziennik.api.v2.template.login.TemplateLogin
|
||||||
import pl.szczodrzynski.edziennik.api.v2.templateLoginMethods
|
import pl.szczodrzynski.edziennik.api.v2.templateLoginMethods
|
||||||
import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore
|
import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore
|
||||||
@ -68,7 +69,9 @@ class Template(val app: App, val profile: Profile?, val loginStore: LoginStore,
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun firstLogin() {
|
override fun firstLogin() {
|
||||||
// TODO
|
TemplateFirstLogin(data) {
|
||||||
|
completed()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun cancel() {
|
override fun cancel() {
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Kuba Szczodrzyński 2019-10-27.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package pl.szczodrzynski.edziennik.api.v2.template.firstlogin
|
||||||
|
|
||||||
|
import pl.szczodrzynski.edziennik.api.v2.template.DataTemplate
|
||||||
|
import pl.szczodrzynski.edziennik.api.v2.template.data.TemplateApi
|
||||||
|
import pl.szczodrzynski.edziennik.api.v2.template.data.TemplateWeb
|
||||||
|
import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile
|
||||||
|
|
||||||
|
class TemplateFirstLogin(val data: DataTemplate, val onSuccess: () -> Unit) {
|
||||||
|
companion object {
|
||||||
|
private const val TAG = "TemplateFirstLogin"
|
||||||
|
}
|
||||||
|
|
||||||
|
private val web = TemplateWeb(data)
|
||||||
|
private val api = TemplateApi(data)
|
||||||
|
private val profileList = mutableListOf<Profile>()
|
||||||
|
|
||||||
|
init {
|
||||||
|
/*TemplateLoginWeb(data) {
|
||||||
|
web.webGet(TAG, "get all accounts") { text ->
|
||||||
|
//val accounts = json.getJsonArray("accounts")
|
||||||
|
|
||||||
|
EventBus.getDefault().post(FirstLoginFinishedEvent(profileList, data.loginStore))
|
||||||
|
onSuccess()
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user