Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

About validate input vlaue by MutableStateFlow & LoginActivityState #3

Open
CMingTseng opened this issue Sep 28, 2022 · 0 comments
Open

Comments

@CMingTseng
Copy link

Dear Sir

thx your demo

i try upgrade Hilt verion -- PR #2

now i base your demo try to modify something -like input value validate

i think validate input must into Viewmodel

and the steps is "validate input --> login"

it can use kotlin flow combine

so i try it https://github.com/CMingTseng/android-clean-architecture/blob/b42a42819c88c5a7adbf86cdc50031aa72849fea/app/src/main/java/com/ydhnwb/cleanarchitectureexercise/presentation/login/LoginViewModel.kt#L54

but something is not right

  1. if input email "or" pwd is wrong , the validate result notify to UI by MutableStateFlow is right ,the UI (fragment)
    will show "not email type" or "PWD length wrong "

  2. when input email "And" pwd are wrong ,the validate result notify to UI by MutableStateFlow only one time !!!
    the UI (fragment) anly show "not email type" or "PWD length wrong " , not both

what is wrong ?

THX

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant