forked from github/wulkanowy-mirror
Show all known adfslight registers in register list (#766)
This commit is contained in:
parent
64a19d9627
commit
3ac085573f
@ -7,7 +7,6 @@ import android.view.View
|
|||||||
import android.view.View.GONE
|
import android.view.View.GONE
|
||||||
import android.view.View.VISIBLE
|
import android.view.View.VISIBLE
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.ArrayAdapter
|
|
||||||
import androidx.core.widget.doOnTextChanged
|
import androidx.core.widget.doOnTextChanged
|
||||||
import io.github.wulkanowy.R
|
import io.github.wulkanowy.R
|
||||||
import io.github.wulkanowy.data.db.entities.Student
|
import io.github.wulkanowy.data.db.entities.Student
|
||||||
@ -46,9 +45,6 @@ class LoginFormFragment : BaseFragment(), LoginFormView {
|
|||||||
override val formHostSymbol: String
|
override val formHostSymbol: String
|
||||||
get() = hostSymbols.getOrNull(hostKeys.indexOf(loginFormHost.text.toString())).orEmpty()
|
get() = hostSymbols.getOrNull(hostKeys.indexOf(loginFormHost.text.toString())).orEmpty()
|
||||||
|
|
||||||
override val formSymbolValue: String
|
|
||||||
get() = loginFormSymbol.text.toString()
|
|
||||||
|
|
||||||
override val nicknameLabel: String
|
override val nicknameLabel: String
|
||||||
get() = getString(R.string.login_nickname_hint)
|
get() = getString(R.string.login_nickname_hint)
|
||||||
|
|
||||||
@ -77,7 +73,6 @@ class LoginFormFragment : BaseFragment(), LoginFormView {
|
|||||||
|
|
||||||
loginFormUsername.doOnTextChanged { _, _, _, _ -> presenter.onUsernameTextChanged() }
|
loginFormUsername.doOnTextChanged { _, _, _, _ -> presenter.onUsernameTextChanged() }
|
||||||
loginFormPass.doOnTextChanged { _, _, _, _ -> presenter.onPassTextChanged() }
|
loginFormPass.doOnTextChanged { _, _, _, _ -> presenter.onPassTextChanged() }
|
||||||
loginFormSymbol.doOnTextChanged { _, _, _, _ -> presenter.onSymbolTextChanged() }
|
|
||||||
loginFormHost.setOnItemClickListener { _, _, _, _ -> presenter.onHostSelected() }
|
loginFormHost.setOnItemClickListener { _, _, _, _ -> presenter.onHostSelected() }
|
||||||
loginFormSignIn.setOnClickListener { presenter.onSignInClick() }
|
loginFormSignIn.setOnClickListener { presenter.onSignInClick() }
|
||||||
loginFormAdvancedButton.setOnClickListener { presenter.onAdvancedLoginClick() }
|
loginFormAdvancedButton.setOnClickListener { presenter.onAdvancedLoginClick() }
|
||||||
@ -86,9 +81,6 @@ class LoginFormFragment : BaseFragment(), LoginFormView {
|
|||||||
loginFormContactEmail.setOnClickListener { presenter.onEmailClick() }
|
loginFormContactEmail.setOnClickListener { presenter.onEmailClick() }
|
||||||
loginFormRecoverLink.setOnClickListener { presenter.onRecoverClick() }
|
loginFormRecoverLink.setOnClickListener { presenter.onRecoverClick() }
|
||||||
loginFormPass.setOnEditorDoneSignIn { loginFormSignIn.callOnClick() }
|
loginFormPass.setOnEditorDoneSignIn { loginFormSignIn.callOnClick() }
|
||||||
loginFormSymbol.setOnEditorDoneSignIn { loginFormSignIn.callOnClick() }
|
|
||||||
|
|
||||||
loginFormSymbol.setAdapter(ArrayAdapter(requireContext(), android.R.layout.simple_list_item_1, resources.getStringArray(R.array.symbols_values)))
|
|
||||||
|
|
||||||
with(loginFormHost) {
|
with(loginFormHost) {
|
||||||
setText(hostKeys.getOrNull(0).orEmpty())
|
setText(hostKeys.getOrNull(0).orEmpty())
|
||||||
@ -102,18 +94,10 @@ class LoginFormFragment : BaseFragment(), LoginFormView {
|
|||||||
loginFormPass.setText(pass)
|
loginFormPass.setText(pass)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun setSymbol(symbol: String) {
|
|
||||||
loginFormSymbol.setText(symbol)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun setUsernameLabel(label: String) {
|
override fun setUsernameLabel(label: String) {
|
||||||
loginFormUsernameLayout.hint = label
|
loginFormUsernameLayout.hint = label
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun showSymbol(show: Boolean) {
|
|
||||||
loginFormSymbolLayout.visibility = if (show) VISIBLE else GONE
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun setErrorUsernameRequired() {
|
override fun setErrorUsernameRequired() {
|
||||||
with(loginFormUsernameLayout) {
|
with(loginFormUsernameLayout) {
|
||||||
requestFocus()
|
requestFocus()
|
||||||
@ -135,13 +119,6 @@ class LoginFormFragment : BaseFragment(), LoginFormView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun setErrorSymbolRequired(focus: Boolean) {
|
|
||||||
with(loginFormSymbolLayout) {
|
|
||||||
if (focus) requestFocus()
|
|
||||||
error = getString(R.string.login_symbol_helper)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun setErrorPassRequired(focus: Boolean) {
|
override fun setErrorPassRequired(focus: Boolean) {
|
||||||
with(loginFormPassLayout) {
|
with(loginFormPassLayout) {
|
||||||
if (focus) requestFocus()
|
if (focus) requestFocus()
|
||||||
@ -171,10 +148,6 @@ class LoginFormFragment : BaseFragment(), LoginFormView {
|
|||||||
loginFormPassLayout.error = null
|
loginFormPassLayout.error = null
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun clearSymbolError() {
|
|
||||||
loginFormSymbolLayout.error = null
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun showSoftKeyboard() {
|
override fun showSoftKeyboard() {
|
||||||
activity?.showSoftInput()
|
activity?.showSoftInput()
|
||||||
}
|
}
|
||||||
@ -227,10 +200,7 @@ class LoginFormFragment : BaseFragment(), LoginFormView {
|
|||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
with(presenter) {
|
presenter.updateUsernameLabel()
|
||||||
updateUsernameLabel()
|
|
||||||
updateSymbolInputVisibility()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun openEmail(lastError: String) {
|
override fun openEmail(lastError: String) {
|
||||||
@ -242,7 +212,7 @@ class LoginFormFragment : BaseFragment(), LoginFormView {
|
|||||||
"${appInfo.systemManufacturer} ${appInfo.systemModel}",
|
"${appInfo.systemManufacturer} ${appInfo.systemModel}",
|
||||||
appInfo.systemVersion.toString(),
|
appInfo.systemVersion.toString(),
|
||||||
appInfo.versionName,
|
appInfo.versionName,
|
||||||
"$formHostValue/$formSymbolValue",
|
"$formHostValue/$formHostSymbol",
|
||||||
lastError
|
lastError
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -48,9 +48,7 @@ class LoginFormPresenter @Inject constructor(
|
|||||||
if (formHostValue.contains("fakelog")) {
|
if (formHostValue.contains("fakelog")) {
|
||||||
setCredentials("jan@fakelog.cf", "jan123")
|
setCredentials("jan@fakelog.cf", "jan123")
|
||||||
}
|
}
|
||||||
setSymbol(formHostSymbol)
|
|
||||||
updateUsernameLabel()
|
updateUsernameLabel()
|
||||||
updateSymbolInputVisibility()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,12 +58,6 @@ class LoginFormPresenter @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateSymbolInputVisibility() {
|
|
||||||
view?.run {
|
|
||||||
showSymbol("adfs" in formHostValue)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun onPassTextChanged() {
|
fun onPassTextChanged() {
|
||||||
view?.clearPassError()
|
view?.clearPassError()
|
||||||
}
|
}
|
||||||
@ -74,17 +66,13 @@ class LoginFormPresenter @Inject constructor(
|
|||||||
view?.clearUsernameError()
|
view?.clearUsernameError()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun onSymbolTextChanged() {
|
|
||||||
view?.clearSymbolError()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun onSignInClick() {
|
fun onSignInClick() {
|
||||||
val email = view?.formUsernameValue.orEmpty().trim()
|
val email = view?.formUsernameValue.orEmpty().trim()
|
||||||
val password = view?.formPassValue.orEmpty().trim()
|
val password = view?.formPassValue.orEmpty().trim()
|
||||||
val host = view?.formHostValue.orEmpty().trim()
|
val host = view?.formHostValue.orEmpty().trim()
|
||||||
val symbol = view?.formSymbolValue.orEmpty().trim()
|
val symbol = view?.formHostSymbol.orEmpty().trim()
|
||||||
|
|
||||||
if (!validateCredentials(email, password, host, symbol)) return
|
if (!validateCredentials(email, password, host)) return
|
||||||
|
|
||||||
disposable.add(studentRepository.getStudentsScrapper(email, password, host, symbol)
|
disposable.add(studentRepository.getStudentsScrapper(email, password, host, symbol)
|
||||||
.subscribeOn(schedulers.backgroundThread)
|
.subscribeOn(schedulers.backgroundThread)
|
||||||
@ -128,7 +116,7 @@ class LoginFormPresenter @Inject constructor(
|
|||||||
view?.onRecoverClick()
|
view?.onRecoverClick()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun validateCredentials(login: String, password: String, host: String, symbol: String): Boolean {
|
private fun validateCredentials(login: String, password: String, host: String): Boolean {
|
||||||
var isCorrect = true
|
var isCorrect = true
|
||||||
|
|
||||||
if (login.isEmpty()) {
|
if (login.isEmpty()) {
|
||||||
@ -156,11 +144,6 @@ class LoginFormPresenter @Inject constructor(
|
|||||||
isCorrect = false
|
isCorrect = false
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("standard" !in host && symbol.isBlank()) {
|
|
||||||
view?.setErrorSymbolRequired(focus = isCorrect)
|
|
||||||
isCorrect = false
|
|
||||||
}
|
|
||||||
|
|
||||||
return isCorrect
|
return isCorrect
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,28 +15,20 @@ interface LoginFormView : BaseView {
|
|||||||
|
|
||||||
val formHostSymbol: String
|
val formHostSymbol: String
|
||||||
|
|
||||||
val formSymbolValue: String
|
|
||||||
|
|
||||||
val nicknameLabel: String
|
val nicknameLabel: String
|
||||||
|
|
||||||
val emailLabel: String
|
val emailLabel: String
|
||||||
|
|
||||||
fun setCredentials(username: String, pass: String)
|
fun setCredentials(username: String, pass: String)
|
||||||
|
|
||||||
fun setSymbol(symbol: String)
|
|
||||||
|
|
||||||
fun setUsernameLabel(label: String)
|
fun setUsernameLabel(label: String)
|
||||||
|
|
||||||
fun showSymbol(show: Boolean)
|
|
||||||
|
|
||||||
fun setErrorUsernameRequired()
|
fun setErrorUsernameRequired()
|
||||||
|
|
||||||
fun setErrorLoginRequired()
|
fun setErrorLoginRequired()
|
||||||
|
|
||||||
fun setErrorEmailRequired()
|
fun setErrorEmailRequired()
|
||||||
|
|
||||||
fun setErrorSymbolRequired(focus: Boolean)
|
|
||||||
|
|
||||||
fun setErrorPassRequired(focus: Boolean)
|
fun setErrorPassRequired(focus: Boolean)
|
||||||
|
|
||||||
fun setErrorPassInvalid(focus: Boolean)
|
fun setErrorPassInvalid(focus: Boolean)
|
||||||
@ -47,8 +39,6 @@ interface LoginFormView : BaseView {
|
|||||||
|
|
||||||
fun clearPassError()
|
fun clearPassError()
|
||||||
|
|
||||||
fun clearSymbolError()
|
|
||||||
|
|
||||||
fun showSoftKeyboard()
|
fun showSoftKeyboard()
|
||||||
|
|
||||||
fun hideSoftKeyboard()
|
fun hideSoftKeyboard()
|
||||||
|
@ -11,7 +11,6 @@ import android.view.ViewGroup
|
|||||||
import android.webkit.JavascriptInterface
|
import android.webkit.JavascriptInterface
|
||||||
import android.webkit.WebView
|
import android.webkit.WebView
|
||||||
import android.webkit.WebViewClient
|
import android.webkit.WebViewClient
|
||||||
import android.widget.ArrayAdapter
|
|
||||||
import androidx.core.widget.doOnTextChanged
|
import androidx.core.widget.doOnTextChanged
|
||||||
import io.github.wulkanowy.R
|
import io.github.wulkanowy.R
|
||||||
import io.github.wulkanowy.ui.base.BaseFragment
|
import io.github.wulkanowy.ui.base.BaseFragment
|
||||||
@ -35,15 +34,17 @@ class LoginRecoverFragment : BaseFragment(), LoginRecoverView {
|
|||||||
|
|
||||||
private lateinit var hostValues: Array<String>
|
private lateinit var hostValues: Array<String>
|
||||||
|
|
||||||
|
private lateinit var hostSymbols: Array<String>
|
||||||
|
|
||||||
override val recoverHostValue: String
|
override val recoverHostValue: String
|
||||||
get() = hostValues.getOrNull(hostKeys.indexOf(loginRecoverHost.text.toString())).orEmpty()
|
get() = hostValues.getOrNull(hostKeys.indexOf(loginRecoverHost.text.toString())).orEmpty()
|
||||||
|
|
||||||
|
override val formHostSymbol: String
|
||||||
|
get() = hostSymbols.getOrNull(hostKeys.indexOf(loginRecoverHost.text.toString())).orEmpty()
|
||||||
|
|
||||||
override val recoverNameValue: String
|
override val recoverNameValue: String
|
||||||
get() = loginRecoverName.text.toString().trim()
|
get() = loginRecoverName.text.toString().trim()
|
||||||
|
|
||||||
override val recoverSymbolValue: String
|
|
||||||
get() = loginRecoverSymbol.text.toString().trim()
|
|
||||||
|
|
||||||
override val emailHintString: String
|
override val emailHintString: String
|
||||||
get() = getString(R.string.login_email_hint)
|
get() = getString(R.string.login_email_hint)
|
||||||
|
|
||||||
@ -66,17 +67,15 @@ class LoginRecoverFragment : BaseFragment(), LoginRecoverView {
|
|||||||
loginRecoverWebView.setBackgroundColor(Color.TRANSPARENT)
|
loginRecoverWebView.setBackgroundColor(Color.TRANSPARENT)
|
||||||
hostKeys = resources.getStringArray(R.array.hosts_keys)
|
hostKeys = resources.getStringArray(R.array.hosts_keys)
|
||||||
hostValues = resources.getStringArray(R.array.hosts_values)
|
hostValues = resources.getStringArray(R.array.hosts_values)
|
||||||
|
hostSymbols = resources.getStringArray(R.array.hosts_symbols)
|
||||||
|
|
||||||
loginRecoverName.doOnTextChanged { _, _, _, _ -> presenter.onNameTextChanged() }
|
loginRecoverName.doOnTextChanged { _, _, _, _ -> presenter.onNameTextChanged() }
|
||||||
loginRecoverSymbol.doOnTextChanged { _, _, _, _ -> presenter.onSymbolTextChanged() }
|
|
||||||
loginRecoverHost.setOnItemClickListener { _, _, _, _ -> presenter.onHostSelected() }
|
loginRecoverHost.setOnItemClickListener { _, _, _, _ -> presenter.onHostSelected() }
|
||||||
loginRecoverButton.setOnClickListener { presenter.onRecoverClick() }
|
loginRecoverButton.setOnClickListener { presenter.onRecoverClick() }
|
||||||
loginRecoverErrorRetry.setOnClickListener { presenter.onRecoverClick() }
|
loginRecoverErrorRetry.setOnClickListener { presenter.onRecoverClick() }
|
||||||
loginRecoverErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
loginRecoverErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
||||||
loginRecoverLogin.setOnClickListener { (activity as LoginActivity).switchView(0) }
|
loginRecoverLogin.setOnClickListener { (activity as LoginActivity).switchView(0) }
|
||||||
|
|
||||||
loginRecoverSymbol.setAdapter(ArrayAdapter(requireContext(), android.R.layout.simple_list_item_1, resources.getStringArray(R.array.symbols_values)))
|
|
||||||
|
|
||||||
with(loginRecoverHost) {
|
with(loginRecoverHost) {
|
||||||
setText(hostKeys.getOrNull(0).orEmpty())
|
setText(hostKeys.getOrNull(0).orEmpty())
|
||||||
setAdapter(LoginSymbolAdapter(context, R.layout.support_simple_spinner_dropdown_item, hostKeys))
|
setAdapter(LoginSymbolAdapter(context, R.layout.support_simple_spinner_dropdown_item, hostKeys))
|
||||||
@ -106,25 +105,10 @@ class LoginRecoverFragment : BaseFragment(), LoginRecoverView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun setSymbolError(focus: Boolean) {
|
|
||||||
with(loginRecoverSymbolLayout) {
|
|
||||||
if (focus) requestFocus()
|
|
||||||
error = getString(R.string.login_field_required)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun clearUsernameError() {
|
override fun clearUsernameError() {
|
||||||
loginRecoverNameLayout.error = null
|
loginRecoverNameLayout.error = null
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun clearSymbolError() {
|
|
||||||
loginRecoverSymbolLayout.error = null
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun showSymbol(show: Boolean) {
|
|
||||||
loginRecoverSymbolLayout.visibility = if (show) VISIBLE else GONE
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun showProgress(show: Boolean) {
|
override fun showProgress(show: Boolean) {
|
||||||
loginRecoverProgress.visibility = if (show) VISIBLE else GONE
|
loginRecoverProgress.visibility = if (show) VISIBLE else GONE
|
||||||
}
|
}
|
||||||
|
@ -34,10 +34,6 @@ class LoginRecoverPresenter @Inject constructor(
|
|||||||
view?.clearUsernameError()
|
view?.clearUsernameError()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun onSymbolTextChanged() {
|
|
||||||
view?.clearSymbolError()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun onHostSelected() {
|
fun onHostSelected() {
|
||||||
view?.run {
|
view?.run {
|
||||||
if ("fakelog" in recoverHostValue) setDefaultCredentials("jan@fakelog.cf")
|
if ("fakelog" in recoverHostValue) setDefaultCredentials("jan@fakelog.cf")
|
||||||
@ -48,7 +44,6 @@ class LoginRecoverPresenter @Inject constructor(
|
|||||||
|
|
||||||
fun updateFields() {
|
fun updateFields() {
|
||||||
view?.run {
|
view?.run {
|
||||||
showSymbol("adfs" in recoverHostValue)
|
|
||||||
setUsernameHint(if ("standard" in recoverHostValue) emailHintString else loginPeselEmailHintString)
|
setUsernameHint(if ("standard" in recoverHostValue) emailHintString else loginPeselEmailHintString)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -56,9 +51,9 @@ class LoginRecoverPresenter @Inject constructor(
|
|||||||
fun onRecoverClick() {
|
fun onRecoverClick() {
|
||||||
val username = view?.recoverNameValue.orEmpty()
|
val username = view?.recoverNameValue.orEmpty()
|
||||||
val host = view?.recoverHostValue.orEmpty()
|
val host = view?.recoverHostValue.orEmpty()
|
||||||
val symbol = view?.recoverSymbolValue.orEmpty()
|
val symbol = view?.formHostSymbol.orEmpty()
|
||||||
|
|
||||||
if (!validateInput(username, host, symbol)) return
|
if (!validateInput(username, host)) return
|
||||||
|
|
||||||
disposable.add(recoverRepository.getReCaptchaSiteKey(host, symbol.ifBlank { "Default" })
|
disposable.add(recoverRepository.getReCaptchaSiteKey(host, symbol.ifBlank { "Default" })
|
||||||
.subscribeOn(schedulers.backgroundThread)
|
.subscribeOn(schedulers.backgroundThread)
|
||||||
@ -80,7 +75,7 @@ class LoginRecoverPresenter @Inject constructor(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun validateInput(username: String, host: String, symbol: String): Boolean {
|
private fun validateInput(username: String, host: String): Boolean {
|
||||||
var isCorrect = true
|
var isCorrect = true
|
||||||
|
|
||||||
if (username.isEmpty()) {
|
if (username.isEmpty()) {
|
||||||
@ -93,18 +88,13 @@ class LoginRecoverPresenter @Inject constructor(
|
|||||||
isCorrect = false
|
isCorrect = false
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("adfs" in host && symbol.isBlank()) {
|
|
||||||
view?.setSymbolError(focus = isCorrect)
|
|
||||||
isCorrect = false
|
|
||||||
}
|
|
||||||
|
|
||||||
return isCorrect
|
return isCorrect
|
||||||
}
|
}
|
||||||
|
|
||||||
fun onReCaptchaVerified(reCaptchaResponse: String) {
|
fun onReCaptchaVerified(reCaptchaResponse: String) {
|
||||||
val username = view?.recoverNameValue.orEmpty()
|
val username = view?.recoverNameValue.orEmpty()
|
||||||
val host = view?.recoverHostValue.orEmpty()
|
val host = view?.recoverHostValue.orEmpty()
|
||||||
val symbol = view?.recoverSymbolValue.ifNullOrBlank { "Default" }
|
val symbol = view?.formHostSymbol.ifNullOrBlank { "Default" }
|
||||||
|
|
||||||
with(disposable) {
|
with(disposable) {
|
||||||
clear()
|
clear()
|
||||||
|
@ -6,9 +6,9 @@ interface LoginRecoverView : BaseView {
|
|||||||
|
|
||||||
val recoverHostValue: String
|
val recoverHostValue: String
|
||||||
|
|
||||||
val recoverNameValue: String
|
val formHostSymbol: String
|
||||||
|
|
||||||
val recoverSymbolValue: String
|
val recoverNameValue: String
|
||||||
|
|
||||||
val emailHintString: String
|
val emailHintString: String
|
||||||
|
|
||||||
@ -22,18 +22,12 @@ interface LoginRecoverView : BaseView {
|
|||||||
|
|
||||||
fun clearUsernameError()
|
fun clearUsernameError()
|
||||||
|
|
||||||
fun clearSymbolError()
|
|
||||||
|
|
||||||
fun showSymbol(show: Boolean)
|
|
||||||
|
|
||||||
fun setErrorNameRequired()
|
fun setErrorNameRequired()
|
||||||
|
|
||||||
fun setUsernameHint(hint: String)
|
fun setUsernameHint(hint: String)
|
||||||
|
|
||||||
fun setUsernameError(message: String)
|
fun setUsernameError(message: String)
|
||||||
|
|
||||||
fun setSymbolError(focus: Boolean)
|
|
||||||
|
|
||||||
fun showSoftKeyboard()
|
fun showSoftKeyboard()
|
||||||
|
|
||||||
fun hideSoftKeyboard()
|
fun hideSoftKeyboard()
|
||||||
|
@ -202,7 +202,7 @@
|
|||||||
android:layout_marginRight="24dp"
|
android:layout_marginRight="24dp"
|
||||||
android:hint="@string/login_host_hint"
|
android:hint="@string/login_host_hint"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/loginFormSymbolLayout"
|
app:layout_constraintBottom_toTopOf="@+id/loginFormAdvancedButton"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/loginFormRecoverLink">
|
app:layout_constraintTop_toBottomOf="@+id/loginFormRecoverLink">
|
||||||
@ -215,36 +215,6 @@
|
|||||||
tools:ignore="Deprecated,LabelFor" />
|
tools:ignore="Deprecated,LabelFor" />
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
|
||||||
android:id="@+id/loginFormSymbolLayout"
|
|
||||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="24dp"
|
|
||||||
android:layout_marginLeft="24dp"
|
|
||||||
android:layout_marginTop="24dp"
|
|
||||||
android:layout_marginEnd="24dp"
|
|
||||||
android:layout_marginRight="24dp"
|
|
||||||
android:hint="@string/login_symbol_hint"
|
|
||||||
app:errorEnabled="true"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/loginFormSignIn"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/loginFormHostLayout">
|
|
||||||
|
|
||||||
<AutoCompleteTextView
|
|
||||||
android:id="@+id/loginFormSymbol"
|
|
||||||
style="@style/Widget.MaterialComponents.TextInputEditText.OutlinedBox"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:imeActionLabel="@string/login_sign_in"
|
|
||||||
android:imeOptions="actionDone"
|
|
||||||
android:importantForAutofill="no"
|
|
||||||
android:inputType="textAutoComplete|textNoSuggestions"
|
|
||||||
android:maxLines="1"
|
|
||||||
tools:ignore="LabelFor" />
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/loginFormAdvancedButton"
|
android:id="@+id/loginFormAdvancedButton"
|
||||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||||
@ -259,7 +229,7 @@
|
|||||||
app:layout_constraintBottom_toBottomOf="@id/loginFormSignIn"
|
app:layout_constraintBottom_toBottomOf="@id/loginFormSignIn"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/loginFormSignIn"
|
app:layout_constraintEnd_toStartOf="@+id/loginFormSignIn"
|
||||||
app:layout_constraintHorizontal_bias="0.0"
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
app:layout_constraintStart_toStartOf="@id/loginFormSymbolLayout"
|
app:layout_constraintStart_toStartOf="@id/loginFormHostLayout"
|
||||||
app:layout_constraintTop_toTopOf="@+id/loginFormSignIn" />
|
app:layout_constraintTop_toTopOf="@+id/loginFormSignIn" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
@ -274,7 +244,7 @@
|
|||||||
android:text="@string/login_sign_in"
|
android:text="@string/login_sign_in"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/loginFormSymbolLayout" />
|
app:layout_constraintTop_toBottomOf="@+id/loginFormHostLayout" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/loginFormPrivacyLink"
|
android:id="@+id/loginFormPrivacyLink"
|
||||||
|
@ -88,6 +88,7 @@
|
|||||||
android:autofillHints="emailAddress"
|
android:autofillHints="emailAddress"
|
||||||
android:inputType="textEmailAddress"
|
android:inputType="textEmailAddress"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
tools:targetApi="o" />
|
tools:targetApi="o" />
|
||||||
|
|
||||||
<requestFocus />
|
<requestFocus />
|
||||||
@ -105,7 +106,7 @@
|
|||||||
android:layout_marginRight="24dp"
|
android:layout_marginRight="24dp"
|
||||||
android:hint="@string/login_host_hint"
|
android:hint="@string/login_host_hint"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/loginRecoverSymbolLayout"
|
app:layout_constraintBottom_toTopOf="@+id/loginRecoverButton"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/loginRecoverNameLayout">
|
app:layout_constraintTop_toBottomOf="@+id/loginRecoverNameLayout">
|
||||||
@ -118,46 +119,17 @@
|
|||||||
tools:ignore="Deprecated,LabelFor" />
|
tools:ignore="Deprecated,LabelFor" />
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
|
||||||
android:id="@+id/loginRecoverSymbolLayout"
|
|
||||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="24dp"
|
|
||||||
android:layout_marginLeft="24dp"
|
|
||||||
android:layout_marginTop="24dp"
|
|
||||||
android:layout_marginEnd="24dp"
|
|
||||||
android:layout_marginRight="24dp"
|
|
||||||
android:hint="@string/login_symbol_hint"
|
|
||||||
app:errorEnabled="true"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/loginRecoverButton"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/loginRecoverHostLayout">
|
|
||||||
|
|
||||||
<AutoCompleteTextView
|
|
||||||
android:id="@+id/loginRecoverSymbol"
|
|
||||||
style="@style/Widget.MaterialComponents.TextInputEditText.OutlinedBox"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:imeActionLabel="@string/login_sign_in"
|
|
||||||
android:imeOptions="actionDone"
|
|
||||||
android:inputType="textAutoComplete|textNoSuggestions"
|
|
||||||
android:maxLines="1"
|
|
||||||
tools:ignore="LabelFor" />
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/loginRecoverButton"
|
android:id="@+id/loginRecoverButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="24dp"
|
||||||
android:layout_marginEnd="24dp"
|
android:layout_marginEnd="24dp"
|
||||||
android:layout_marginRight="24dp"
|
android:layout_marginRight="24dp"
|
||||||
android:text="@string/login_recover"
|
android:text="@string/login_recover"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/loginRecoverSymbolLayout" />
|
app:layout_constraintTop_toBottomOf="@+id/loginRecoverHostLayout" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
@ -1,33 +1,60 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
|
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
|
||||||
<string-array name="hosts_keys">
|
<string-array name="hosts_keys">
|
||||||
<item>Vulcan - standardowy</item>
|
<item>Vulcan</item>
|
||||||
<item>Vulcan - niestandardowy</item>
|
|
||||||
<item>Opolska eSzkoła</item>
|
<item>Opolska eSzkoła</item>
|
||||||
<item>Gdańska Platforma Edukacyjna</item>
|
<item>Gdańska Platforma Edukacyjna</item>
|
||||||
<item>Lubelski Portal Oświatowy</item>
|
<item>Lubelski Portal Oświatowy</item>
|
||||||
<item>EduNet Miasta Tarnowa</item>
|
<item>EduNet Miasta Tarnowa</item>
|
||||||
<item>ResMan Rzeszów</item>
|
<item>ResMan Rzeszów</item>
|
||||||
|
<item>Rawa Mazowiecka - Platforma vEdukacja</item>
|
||||||
|
<item>Zduńska Wola - e-Urząd</item>
|
||||||
|
<item>Sieradz - Portal oświatowy</item>
|
||||||
|
<item>Łask - Platforma vEdukacja</item>
|
||||||
|
<item>Powiat łaski - Platforma edukacyjna</item>
|
||||||
|
<item>Powiat Krasnostawski - Platforma oświatowa</item>
|
||||||
|
<item>Powiat kętrzyński - Platforma e-Usług</item>
|
||||||
|
<item>Gmina Ulan-Majorat - Platforma oświatowa</item>
|
||||||
|
<item>Gmina Ozorków - Platforma edukacyjna</item>
|
||||||
|
<item>Gmina Łopiennik Górny - Platforma oświatowa</item>
|
||||||
<item>Fakelog</item>
|
<item>Fakelog</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
<string-array name="hosts_values">
|
<string-array name="hosts_values">
|
||||||
<item>https://vulcan.net.pl/?standard</item>
|
<item>https://vulcan.net.pl/?standard</item>
|
||||||
<item>https://vulcan.net.pl/?adfs</item>
|
|
||||||
<item>https://eszkola.opolskie.pl</item>
|
<item>https://eszkola.opolskie.pl</item>
|
||||||
<item>https://edu.gdansk.pl</item>
|
<item>https://edu.gdansk.pl</item>
|
||||||
<item>https://edu.lublin.eu</item>
|
<item>https://edu.lublin.eu</item>
|
||||||
<item>https://umt.tarnow.pl</item>
|
<item>https://umt.tarnow.pl</item>
|
||||||
<item>https://resman.pl</item>
|
<item>https://resman.pl</item>
|
||||||
|
<item>https://vulcan.net.pl/</item>
|
||||||
|
<item>https://vulcan.net.pl/</item>
|
||||||
|
<item>https://vulcan.net.pl/</item>
|
||||||
|
<item>https://vulcan.net.pl/</item>
|
||||||
|
<item>https://vulcan.net.pl/</item>
|
||||||
|
<item>https://vulcan.net.pl/</item>
|
||||||
|
<item>https://vulcan.net.pl/</item>
|
||||||
|
<item>https://vulcan.net.pl/</item>
|
||||||
|
<item>https://vulcan.net.pl/</item>
|
||||||
|
<item>https://vulcan.net.pl/</item>
|
||||||
<item>http://fakelog.cf/?standard</item>
|
<item>http://fakelog.cf/?standard</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
<string-array name="hosts_symbols">
|
<string-array name="hosts_symbols">
|
||||||
<item>Default</item>
|
<item>Default</item>
|
||||||
<item />
|
|
||||||
<item>opole</item>
|
<item>opole</item>
|
||||||
<item>gdansk</item>
|
<item>gdansk</item>
|
||||||
<item>lublin</item>
|
<item>lublin</item>
|
||||||
<item>tarnow</item>
|
<item>tarnow</item>
|
||||||
<item>rzeszow</item>
|
<item>rzeszow</item>
|
||||||
|
<item>rawamazowiecka</item>
|
||||||
|
<item>zdunskawola</item>
|
||||||
|
<item>sieradz</item>
|
||||||
|
<item>lask</item>
|
||||||
|
<item>powiatlaski</item>
|
||||||
|
<item>powiatkrasnostawski</item>
|
||||||
|
<item>powiatketrzynski</item>
|
||||||
|
<item>gminaulanmajorat</item>
|
||||||
|
<item>gminaozorkow</item>
|
||||||
|
<item>gminalopiennikgorny</item>
|
||||||
<item>powiatwulkanowy</item>
|
<item>powiatwulkanowy</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
</resources>
|
</resources>
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -92,7 +92,6 @@ class LoginFormPresenterTest {
|
|||||||
`when`(loginFormView.formUsernameValue).thenReturn("@")
|
`when`(loginFormView.formUsernameValue).thenReturn("@")
|
||||||
`when`(loginFormView.formPassValue).thenReturn("123456")
|
`when`(loginFormView.formPassValue).thenReturn("123456")
|
||||||
`when`(loginFormView.formHostValue).thenReturn("https://fakelog.cf/?standard")
|
`when`(loginFormView.formHostValue).thenReturn("https://fakelog.cf/?standard")
|
||||||
`when`(loginFormView.formSymbolValue).thenReturn("Default")
|
|
||||||
`when`(loginFormView.formHostSymbol).thenReturn("Default")
|
`when`(loginFormView.formHostSymbol).thenReturn("Default")
|
||||||
presenter.onSignInClick()
|
presenter.onSignInClick()
|
||||||
|
|
||||||
@ -110,7 +109,6 @@ class LoginFormPresenterTest {
|
|||||||
`when`(loginFormView.formUsernameValue).thenReturn("@")
|
`when`(loginFormView.formUsernameValue).thenReturn("@")
|
||||||
`when`(loginFormView.formPassValue).thenReturn("123456")
|
`when`(loginFormView.formPassValue).thenReturn("123456")
|
||||||
`when`(loginFormView.formHostValue).thenReturn("https://fakelog.cf/?standard")
|
`when`(loginFormView.formHostValue).thenReturn("https://fakelog.cf/?standard")
|
||||||
`when`(loginFormView.formSymbolValue).thenReturn("Default")
|
|
||||||
`when`(loginFormView.formHostSymbol).thenReturn("Default")
|
`when`(loginFormView.formHostSymbol).thenReturn("Default")
|
||||||
presenter.onSignInClick()
|
presenter.onSignInClick()
|
||||||
|
|
||||||
@ -128,7 +126,6 @@ class LoginFormPresenterTest {
|
|||||||
`when`(loginFormView.formUsernameValue).thenReturn("@")
|
`when`(loginFormView.formUsernameValue).thenReturn("@")
|
||||||
`when`(loginFormView.formPassValue).thenReturn("123456")
|
`when`(loginFormView.formPassValue).thenReturn("123456")
|
||||||
`when`(loginFormView.formHostValue).thenReturn("https://fakelog.cf/?standard")
|
`when`(loginFormView.formHostValue).thenReturn("https://fakelog.cf/?standard")
|
||||||
`when`(loginFormView.formSymbolValue).thenReturn("Default")
|
|
||||||
`when`(loginFormView.formHostSymbol).thenReturn("Default")
|
`when`(loginFormView.formHostSymbol).thenReturn("Default")
|
||||||
presenter.onSignInClick()
|
presenter.onSignInClick()
|
||||||
presenter.onSignInClick()
|
presenter.onSignInClick()
|
||||||
@ -147,7 +144,6 @@ class LoginFormPresenterTest {
|
|||||||
`when`(loginFormView.formUsernameValue).thenReturn("@")
|
`when`(loginFormView.formUsernameValue).thenReturn("@")
|
||||||
`when`(loginFormView.formPassValue).thenReturn("123456")
|
`when`(loginFormView.formPassValue).thenReturn("123456")
|
||||||
`when`(loginFormView.formHostValue).thenReturn("https://fakelog.cf/?standard")
|
`when`(loginFormView.formHostValue).thenReturn("https://fakelog.cf/?standard")
|
||||||
`when`(loginFormView.formSymbolValue).thenReturn("Default")
|
|
||||||
`when`(loginFormView.formHostSymbol).thenReturn("Default")
|
`when`(loginFormView.formHostSymbol).thenReturn("Default")
|
||||||
presenter.onSignInClick()
|
presenter.onSignInClick()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user