Skip to content

Commit

Permalink
fix: edit text retention in EditProfileFragment (#1257)
Browse files Browse the repository at this point in the history
Details:
I checked if the EditText already contains text -> if it is than it shouldn't reset the text when rotating

This fix the issue of #652
  • Loading branch information
anhanh11001 authored and iamareebjamal committed Mar 11, 2019
1 parent 3956e04 commit 52feb1c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,12 @@ class EditProfileFragment : Fragment() {
userFirstName = it.firstName.nullToEmpty()
userLastName = it.lastName.nullToEmpty()
val imageUrl = it.avatarUrl.nullToEmpty()
rootView.firstName.setText(userFirstName)
rootView.lastName.setText(userLastName)
if (rootView.firstName.text.isBlank()) {
rootView.firstName.setText(userFirstName)
}
if (rootView.lastName.text.isBlank()) {
rootView.lastName.setText(userLastName)
}
if (!imageUrl.isEmpty()) {
val drawable = requireDrawable(requireContext(), R.drawable.ic_account_circle_grey)
Picasso.get()
Expand Down

0 comments on commit 52feb1c

Please sign in to comment.