-
Notifications
You must be signed in to change notification settings - Fork 551
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
fix: crash on sign up #1924
fix: crash on sign up #1924
Conversation
Need to solve #1920 with it. As both are due to text watcher.
.actionLoginToAuthPop(redirectedFrom = safeArgs.redirectedFrom, email = s.toString())) | ||
if (s.toString() != safeArgs.email) | ||
findNavController(rootView).navigate(LoginFragmentDirections | ||
.actionLoginToAuthPop(redirectedFrom = safeArgs.redirectedFrom, email = s.toString())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (BuildConfig.FLAVOR == PLAY_STORE_BUILD_FLAVOR) {
smartAuthViewModel.requestCredentials(SmartAuthUtil.getCredentialsClient(requireActivity()))
smartAuthViewModel.id
.nonNull()
.observe(viewLifecycleOwner, Observer {
email.text = SpannableStringBuilder(it)
})
smartAuthViewModel.password
.nonNull()
.observe(viewLifecycleOwner, Observer {
password.text = SpannableStringBuilder(it)
})
smartAuthViewModel.apiExceptionCodePair.nonNull().observe(viewLifecycleOwner, Observer {
SmartAuthUtil.handleResolvableApiException(
it.first, requireActivity(), it.second)
})
smartAuthViewModel.progress
.nonNull()
.observe(viewLifecycleOwner, Observer {
progressDialog.show(it)
})
}
Here it fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a workaround is to move this block of code
rootView.email.addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(s: Editable) {
if (s.toString() != safeArgs.email)
findNavController(rootView).navigate(LoginFragmentDirections
.actionLoginToAuthPop(redirectedFrom = safeArgs.redirectedFrom, email = s.toString()))
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) { /*Do Nothing*/ }
override fun onTextChanged(email: CharSequence, start: Int, before: Int, count: Int) { /*Do Nothing*/ }
})
into here
if (safeArgs.email.isNotEmpty()) {
rootView.email.text = SpannableStringBuilder(safeArgs.email)
// HERE <------------------------
} else if (BuildConfig.FLAVOR == PLAY_STORE_BUILD_FLAVOR) {
smartAuthViewModel.requestCredentials(SmartAuthUtil.getCredentialsClient(requireActivity()))
smartAuthViewModel.id
.nonNull()
.observe(viewLifecycleOwner, Observer {
email.text = SpannableStringBuilder(it)
Timber.d("DEBUGGING ${email.text.toString()}")
})
smartAuthViewModel.password
.nonNull()
.observe(viewLifecycleOwner, Observer {
password.text = SpannableStringBuilder(it)
})
smartAuthViewModel.apiExceptionCodePair.nonNull().observe(viewLifecycleOwner, Observer {
SmartAuthUtil.handleResolvableApiException(
it.first, requireActivity(), it.second)
})
smartAuthViewModel.progress
.nonNull()
.observe(viewLifecycleOwner, Observer {
progressDialog.show(it)
})
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. Do the changes and will test if both bugs will fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have pushed a new update, can you test it as I'm still struggling to set up the environment. Somehow, my device can't save credential with ApiException from Google API for saving credential
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
Details: - Move hint from TextInputEditText to TextInputLayout due to an Android bug that create a crash - Add check so that when clicking on Google Auth in LoginFragment, it doesn't redirect back to AuthFragment Fixes: #1922
Both solved. One little bug is there with smart auth, will solve that later. 👍 |
Writing Fixes and multiple issues on same line does not work |
@anhanh11001 Your commit closed #1922 |
Details:
Related issue:
https://stackoverflow.com/questions/45898228/android-attempt-to-invoke-virtual-method-void-android-view-view-getboundsonsc
Fixes: #1923
Fixes #1920