replacing the way error is shown from editText to editTextLayout #876
Open
cdhiraj40 wants to merge 4 commits intoenviroCar:developfrom
Open
replacing the way error is shown from editText to editTextLayout #876cdhiraj40 wants to merge 4 commits intoenviroCar:developfrom
cdhiraj40 wants to merge 4 commits intoenviroCar:developfrom
Conversation
cdhiraj40
commented
Dec 15, 2021
| style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" | ||
| android:layout_width="0dp" | ||
| android:layout_height="40dp" | ||
| android:layout_height="wrap_content" |
Contributor
Author
There was a problem hiding this comment.
the layout_height is changed to wrap_content because the layout needs to be big enough, to show the error.
more information: https://stackoverflow.com/a/44831214
see the below comments on this answer :)
cdhiraj40
commented
Dec 15, 2021
| // check for valid password | ||
| if (password == null || password.isEmpty() || password.equals("")) { | ||
| this.passwordEditText.setError(getString(R.string.error_field_required), errorPassword); | ||
| if (password == null || password.isEmpty()) { |
Contributor
Author
There was a problem hiding this comment.
password.equals("") was removed cause password.isEmpty() was already checking the same here.
the same reason for below removal of username.equals("")
cdhiraj40
commented
Dec 17, 2021
| app:layout_constraintTop_toBottomOf="@+id/textView6" | ||
| app:layout_constraintWidth_max="500dp"> | ||
| app:layout_constraintWidth_max="500dp" | ||
| app:endIconMode="custom"> |
Contributor
Author
There was a problem hiding this comment.
Added this to them which doesn't have any end icon so after making their height wrap_content, they all still have a similar height. As the height changes to wrap_content after an error is shown, via this they all have same height even before error shows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #875
files to be changed: