Update username description string in edit profile screen.

This commit is contained in:
Greyson Parrelli 2024-02-13 09:39:30 -05:00 committed by Cody Henthorne
parent 7530d44d28
commit 54a1b97167
3 changed files with 29 additions and 25 deletions

View file

@ -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?) {

View file

@ -12,8 +12,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true">
android:layout_height="wrap_content">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
@ -339,7 +338,7 @@
app:layout_constraintTop_toBottomOf="@+id/manage_profile_badges_container"
app:layout_constraintVertical_bias="1.0" />
<org.thoughtcrime.securesms.util.views.LearnMoreTextView
<TextView
android:id="@+id/username_info_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View file

@ -1063,6 +1063,8 @@
<!-- ManageProfileFragment -->
<!-- Explanation text about usernames etc displayed underneath buttons to view and edit username etc -->
<string name="ManageProfileFragment__your_username">Your username, QR code and link aren\'t visible on your profile. Only share your username with people you trust.</string>
<!-- Explanation text about usernames etc displayed underneath buttons to view and edit username etc, shown when you have no username -->
<string name="ManageProfileFragment__username_footer_no_username">People can now message you using your optional username so you don\'t have to give out your phone number. </string>
<string name="ManageProfileFragment_profile_name">Profile name</string>
<string name="ManageProfileFragment_username">Username</string>
<string name="ManageProfileFragment_about">About</string>