mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 08:39:22 +01:00
Refresh username in onResume and utilize imeAction.
This commit is contained in:
@@ -132,6 +132,12 @@ public class EditProfileFragment extends LoggingFragment {
|
||||
initializeUsername();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
viewModel.refreshUsername();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
outState.putByteArray(AVATAR_STATE, viewModel.getAvatarSnapshot());
|
||||
|
||||
@@ -37,8 +37,6 @@ class EditProfileViewModel extends ViewModel {
|
||||
this.repository = repository;
|
||||
this.groupId = groupId;
|
||||
|
||||
repository.getCurrentUsername(internalUsername::postValue);
|
||||
|
||||
if (!hasInstanceState) {
|
||||
if (groupId != null) {
|
||||
repository.getCurrentDisplayName(originalDisplayName::setValue);
|
||||
@@ -110,6 +108,10 @@ class EditProfileViewModel extends ViewModel {
|
||||
internalAvatar.setValue(avatar);
|
||||
}
|
||||
|
||||
public void refreshUsername() {
|
||||
repository.getCurrentUsername(internalUsername::postValue);
|
||||
}
|
||||
|
||||
public void submitProfile(Consumer<EditProfileRepository.UploadResult> uploadResultConsumer) {
|
||||
ProfileName profileName = isGroup() ? ProfileName.EMPTY : internalProfileName.getValue();
|
||||
String displayName = isGroup() ? givenName.getValue() : "";
|
||||
|
||||
Reference in New Issue
Block a user