Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P2022-1557 Common validation #41

Merged
merged 6 commits into from
Mar 25, 2022

Conversation

AdrianPat
Copy link
Contributor

  • creates new class Validation.kt
  • changes id of EditTexts in Sign In and Sign Up (there were the same id)

I need help. It doesn't work...

- creates new class Validation.kt
- changes id of EditTexts in Sign In and Sign Up (there were the same id)
@AdrianPat AdrianPat added help wanted Extra attention is needed do_not_merge Do not merge this PR - the author needs to decide what to do next labels Mar 13, 2022
@Lucas-Fresko
Copy link
Contributor

Lucas-Fresko commented Mar 14, 2022

I don't think this should be a fragment, just a class with functions that can be used in SignInFragment and RegisterFragment.
I'd find the views inside the fragment and pass them into the functions as arguments so the same function can be used for any view.

Currently it can't find the views
Capture
.

@Lucas-Fresko
Copy link
Contributor

Lucas-Fresko commented Mar 17, 2022

You can remove the functions in the fragments and use the bind in onCreateView instead of findViewById, but it works either way.

Screenshot 2022-03-17 at 11 42 44

@AdrianPat AdrianPat removed help wanted Extra attention is needed do_not_merge Do not merge this PR - the author needs to decide what to do next labels Mar 17, 2022
@AdrianPat AdrianPat changed the title P2022-1557 Common validation (not working) P2022-1557 Common validation Mar 17, 2022
@kosiara
Copy link
Contributor

kosiara commented Mar 22, 2022

@AdrianPat
Actually it would be better to not only use bind as @Lucas-Fresko suggested
but also keep it in a variable and use it

var editTextLoginEmail : EditText? = null

override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View {
    editTextLoginEmail = bind. editTextLoginEmail
    }
    
    onCreate() { 
       setXXXXLIsterners()
    }
    
    
    setXXXXLIsterners() { 
      editTextLoginEmail.setXXXLIsterner(
         
            [.....]
         
         )
}

@Lucas-Fresko Lucas-Fresko merged commit 8131e4f into master Mar 25, 2022
@AdrianPat AdrianPat deleted the feature/P2022-1557-common-validation branch March 25, 2022 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants