diff --git a/app/src/main/java/org/thoughtcrime/securesms/profiles/manage/EditProfileFragment.kt b/app/src/main/java/org/thoughtcrime/securesms/profiles/manage/EditProfileFragment.kt index 525e5c3af2..efbf1cc631 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/profiles/manage/EditProfileFragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/profiles/manage/EditProfileFragment.kt @@ -126,28 +126,6 @@ class EditProfileFragment : LoggingFragment() { AvatarPreviewActivity.createTransitionBundle(requireActivity(), binding.manageProfileAvatar) ) } - - if (SignalStore.account().username != null && SignalStore.account().usernameSyncState != AccountValues.UsernameSyncState.USERNAME_AND_LINK_CORRUPTED) { - binding.usernameLinkContainer.setOnClickListener { - findNavController().safeNavigate(EditProfileFragmentDirections.actionManageProfileFragmentToUsernameLinkFragment()) - } - - if (SignalStore.account().usernameSyncState == AccountValues.UsernameSyncState.LINK_CORRUPTED) { - binding.linkErrorIndicator.visibility = View.VISIBLE - } else { - binding.linkErrorIndicator.visibility = View.GONE - } - - if (SignalStore.tooltips().showProfileSettingsQrCodeTooltop()) { - binding.usernameLinkTooltip.visibility = View.VISIBLE - binding.linkTooltipCloseButton.setOnClickListener { - binding.usernameLinkTooltip.visibility = View.GONE - SignalStore.tooltips().markProfileSettingsQrCodeTooltipSeen() - } - } - } else { - binding.usernameLinkContainer.visibility = View.GONE - } } private fun initializeViewModel() { @@ -241,6 +219,31 @@ class EditProfileFragment : LoggingFragment() { } else { binding.usernameErrorIndicator.visibility = View.GONE } + + if (SignalStore.account().username != null && SignalStore.account().usernameSyncState != AccountValues.UsernameSyncState.USERNAME_AND_LINK_CORRUPTED) { + binding.usernameLinkContainer.setOnClickListener { + findNavController().safeNavigate(EditProfileFragmentDirections.actionManageProfileFragmentToUsernameLinkFragment()) + } + + if (SignalStore.account().usernameSyncState == AccountValues.UsernameSyncState.LINK_CORRUPTED) { + binding.linkErrorIndicator.visibility = View.VISIBLE + } else { + binding.linkErrorIndicator.visibility = View.GONE + } + + if (SignalStore.tooltips().showProfileSettingsQrCodeTooltop()) { + binding.usernameLinkTooltip.visibility = View.VISIBLE + binding.linkTooltipCloseButton.setOnClickListener { + binding.usernameLinkTooltip.visibility = View.GONE + SignalStore.tooltips().markProfileSettingsQrCodeTooltipSeen() + } + } + + binding.usernameInfoText.setText(R.string.ManageProfileFragment__your_username) + } else { + binding.usernameLinkContainer.visibility = View.GONE + binding.usernameInfoText.setText(R.string.ManageProfileFragment__username_footer_no_username) + } } private fun presentAbout(about: String?) { diff --git a/app/src/main/res/layout/edit_profile_fragment.xml b/app/src/main/res/layout/edit_profile_fragment.xml index dc2c9e1c97..567dde5385 100644 --- a/app/src/main/res/layout/edit_profile_fragment.xml +++ b/app/src/main/res/layout/edit_profile_fragment.xml @@ -12,8 +12,7 @@ + android:layout_height="wrap_content"> - Your username, QR code and link aren\'t visible on your profile. Only share your username with people you trust. + + People can now message you using your optional username so you don\'t have to give out your phone number. Profile name Username About