diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/template/Template.kt b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/template/Template.kt index 61b4ce81..60e1c063 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/template/Template.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/template/Template.kt @@ -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.prepare 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.templateLoginMethods 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() { - // TODO + TemplateFirstLogin(data) { + completed() + } } override fun cancel() { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/template/firstlogin/TemplateFirstLogin.kt b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/template/firstlogin/TemplateFirstLogin.kt new file mode 100644 index 00000000..f9430721 --- /dev/null +++ b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/template/firstlogin/TemplateFirstLogin.kt @@ -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() + + init { + /*TemplateLoginWeb(data) { + web.webGet(TAG, "get all accounts") { text -> + //val accounts = json.getJsonArray("accounts") + + EventBus.getDefault().post(FirstLoginFinishedEvent(profileList, data.loginStore)) + onSuccess() + } + }*/ + } +}