mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 13:08:46 +00:00
Rename profile fragments so they make sense.
This commit is contained in:
@@ -963,7 +963,7 @@
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||
android:exported="false"/>
|
||||
|
||||
<activity android:name=".profiles.edit.EditProfileActivity"
|
||||
<activity android:name=".profiles.edit.CreateProfileActivity"
|
||||
android:theme="@style/TextSecure.LightRegistrationTheme"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize"
|
||||
android:exported="false"/>
|
||||
@@ -973,7 +973,7 @@
|
||||
android:windowSoftInputMode="stateVisible|adjustResize"
|
||||
android:exported="false"/>
|
||||
|
||||
<activity android:name=".profiles.manage.ManageProfileActivity"
|
||||
<activity android:name=".profiles.manage.EditProfileActivity"
|
||||
android:theme="@style/TextSecure.LightTheme"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize"
|
||||
android:exported="false"/>
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.thoughtcrime.securesms.lock.v2.CreateSvrPinActivity;
|
||||
import org.thoughtcrime.securesms.migrations.ApplicationMigrationActivity;
|
||||
import org.thoughtcrime.securesms.migrations.ApplicationMigrations;
|
||||
import org.thoughtcrime.securesms.pin.PinRestoreActivity;
|
||||
import org.thoughtcrime.securesms.profiles.edit.EditProfileActivity;
|
||||
import org.thoughtcrime.securesms.profiles.edit.CreateProfileActivity;
|
||||
import org.thoughtcrime.securesms.push.SignalServiceNetworkAccess;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.registration.RegistrationNavigationActivity;
|
||||
@@ -228,7 +228,7 @@ public abstract class PassphraseRequiredActivity extends BaseActivity implements
|
||||
}
|
||||
|
||||
private Intent getCreateProfileNameIntent() {
|
||||
Intent intent = EditProfileActivity.getIntentForUserProfile(this);
|
||||
Intent intent = CreateProfileActivity.getIntentForUserProfile(this);
|
||||
return getRoutedIntent(intent, getIntent());
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ import org.thoughtcrime.securesms.groups.ui.managegroup.dialogs.GroupsLearnMoreB
|
||||
import org.thoughtcrime.securesms.groups.ui.migration.GroupsV1MigrationInitiationBottomSheetDialogFragment
|
||||
import org.thoughtcrime.securesms.mediaoverview.MediaOverviewActivity
|
||||
import org.thoughtcrime.securesms.mediapreview.MediaIntentFactory
|
||||
import org.thoughtcrime.securesms.profiles.edit.EditProfileActivity
|
||||
import org.thoughtcrime.securesms.profiles.edit.CreateProfileActivity
|
||||
import org.thoughtcrime.securesms.recipients.Recipient
|
||||
import org.thoughtcrime.securesms.recipients.RecipientExporter
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId
|
||||
@@ -199,7 +199,7 @@ class ConversationSettingsFragment : DSLSettingsFragment(
|
||||
val args = ConversationSettingsFragmentArgs.fromBundle(requireArguments())
|
||||
val groupId = args.groupId as ParcelableGroupId
|
||||
|
||||
startActivity(EditProfileActivity.getIntentForGroupProfile(requireActivity(), requireNotNull(ParcelableGroupId.get(groupId))))
|
||||
startActivity(CreateProfileActivity.getIntentForGroupProfile(requireActivity(), requireNotNull(ParcelableGroupId.get(groupId))))
|
||||
true
|
||||
} else {
|
||||
super.onOptionsItemSelected(item)
|
||||
@@ -351,7 +351,7 @@ class ConversationSettingsFragment : DSLSettingsFragment(
|
||||
descriptionShouldLinkify = groupState.groupDescriptionShouldLinkify,
|
||||
canEditGroupAttributes = groupState.canEditGroupAttributes,
|
||||
onEditGroupDescription = {
|
||||
startActivity(EditProfileActivity.getIntentForGroupProfile(requireActivity(), groupState.groupId))
|
||||
startActivity(CreateProfileActivity.getIntentForGroupProfile(requireActivity(), groupState.groupId))
|
||||
},
|
||||
onViewGroupDescription = {
|
||||
GroupDescriptionDialog.show(childFragmentManager, groupState.groupId, null, groupState.groupDescriptionShouldLinkify)
|
||||
|
||||
@@ -153,7 +153,7 @@ import org.thoughtcrime.securesms.mms.GlideApp;
|
||||
import org.thoughtcrime.securesms.notifications.MarkReadReceiver;
|
||||
import org.thoughtcrime.securesms.notifications.profiles.NotificationProfile;
|
||||
import org.thoughtcrime.securesms.permissions.Permissions;
|
||||
import org.thoughtcrime.securesms.profiles.manage.ManageProfileActivity;
|
||||
import org.thoughtcrime.securesms.profiles.manage.EditProfileActivity;
|
||||
import org.thoughtcrime.securesms.ratelimit.RecaptchaProofBottomSheetFragment;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
@@ -795,7 +795,7 @@ public class ConversationListFragment extends MainFragment implements ActionMode
|
||||
} else if (reminderActionId == R.id.reminder_action_cds_permanent_error_learn_more) {
|
||||
CdsPermanentErrorBottomSheet.show(getChildFragmentManager());
|
||||
} else if (reminderActionId == R.id.reminder_action_fix_username) {
|
||||
startActivity(ManageProfileActivity.getIntentForUsernameEdit(requireContext()));
|
||||
startActivity(EditProfileActivity.getIntentForUsernameEdit(requireContext()));
|
||||
} else if (reminderActionId == R.id.reminder_action_re_register) {
|
||||
startActivity(RegistrationNavigationActivity.newIntentForReRegistration(requireContext()));
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.thoughtcrime.securesms.mms.GlideApp;
|
||||
import org.thoughtcrime.securesms.notifications.NotificationChannels;
|
||||
import org.thoughtcrime.securesms.notifications.TurnOnNotificationsBottomSheet;
|
||||
import org.thoughtcrime.securesms.profiles.AvatarHelper;
|
||||
import org.thoughtcrime.securesms.profiles.manage.ManageProfileActivity;
|
||||
import org.thoughtcrime.securesms.profiles.manage.EditProfileActivity;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
import org.thoughtcrime.securesms.util.LocaleFeatureFlags;
|
||||
@@ -252,7 +252,7 @@ public final class Megaphones {
|
||||
.setImage(R.drawable.ic_add_a_profile_megaphone_image)
|
||||
.setBody(R.string.AddAProfilePhotoMegaphone__choose_a_look_and_color)
|
||||
.setActionButton(R.string.AddAProfilePhotoMegaphone__add_photo, (megaphone, listener) -> {
|
||||
listener.onMegaphoneNavigationRequested(ManageProfileActivity.getIntentForAvatarEdit(context));
|
||||
listener.onMegaphoneNavigationRequested(EditProfileActivity.getIntentForAvatarEdit(context));
|
||||
listener.onMegaphoneCompleted(Event.ADD_A_PROFILE_PHOTO);
|
||||
})
|
||||
.setSecondaryButton(R.string.AddAProfilePhotoMegaphone__not_now, (megaphone, listener) -> {
|
||||
@@ -383,7 +383,7 @@ public final class Megaphones {
|
||||
.setBody(R.string.SetUpYourUsername__usernames_let_others)
|
||||
.setImage(R.drawable.usernames_64)
|
||||
.setActionButton(R.string.SetUpYourUsername__continue, (megaphone, controller) -> {
|
||||
controller.onMegaphoneNavigationRequested(ManageProfileActivity.getIntentForUsernameEdit(context));
|
||||
controller.onMegaphoneNavigationRequested(EditProfileActivity.getIntentForUsernameEdit(context));
|
||||
})
|
||||
.setSecondaryButton(R.string.SetUpYourUsername__not_now, (megaphone, controller) -> {
|
||||
controller.onMegaphoneCompleted(Event.SET_UP_YOUR_USERNAME);
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.databinding.OnboardingMegaphoneCardBinding;
|
||||
import org.thoughtcrime.securesms.groups.ui.creategroup.CreateGroupActivity;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.profiles.manage.ManageProfileActivity;
|
||||
import org.thoughtcrime.securesms.profiles.manage.EditProfileActivity;
|
||||
import org.thoughtcrime.securesms.wallpaper.ChatWallpaperActivity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -300,7 +300,7 @@ public class OnboardingMegaphoneView extends FrameLayout {
|
||||
|
||||
@Override
|
||||
void onActionClicked(@NonNull MegaphoneActionController controller) {
|
||||
controller.onMegaphoneNavigationRequested(ManageProfileActivity.getIntentForAvatarEdit(controller.getMegaphoneActivity()));
|
||||
controller.onMegaphoneNavigationRequested(EditProfileActivity.getIntentForAvatarEdit(controller.getMegaphoneActivity()));
|
||||
SignalStore.onboarding().setShowAddPhoto(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.lock.v2.SvrConstants;
|
||||
import org.thoughtcrime.securesms.lock.v2.PinKeyboardType;
|
||||
import org.thoughtcrime.securesms.profiles.AvatarHelper;
|
||||
import org.thoughtcrime.securesms.profiles.edit.EditProfileActivity;
|
||||
import org.thoughtcrime.securesms.profiles.edit.CreateProfileActivity;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.registration.RegistrationUtil;
|
||||
import org.thoughtcrime.securesms.registration.fragments.RegistrationViewDelegate;
|
||||
@@ -238,7 +238,7 @@ public class PinRestoreEntryFragment extends LoggingFragment {
|
||||
|
||||
if (Recipient.self().getProfileName().isEmpty() || !AvatarHelper.hasAvatar(activity, Recipient.self().getId())) {
|
||||
final Intent main = MainActivity.clearTop(activity);
|
||||
final Intent profile = EditProfileActivity.getIntentForUserProfile(activity);
|
||||
final Intent profile = CreateProfileActivity.getIntentForUserProfile(activity);
|
||||
|
||||
profile.putExtra("next_intent", main);
|
||||
startActivity(profile);
|
||||
|
||||
@@ -19,7 +19,7 @@ import org.thoughtcrime.securesms.util.DynamicTheme;
|
||||
/**
|
||||
* Shows editing screen for your profile during registration. Also handles group name editing.
|
||||
*/
|
||||
public class EditProfileActivity extends BaseActivity implements EditProfileFragment.Controller {
|
||||
public class CreateProfileActivity extends BaseActivity implements CreateProfileFragment.Controller {
|
||||
|
||||
public static final String NEXT_INTENT = "next_intent";
|
||||
public static final String EXCLUDE_SYSTEM = "exclude_system";
|
||||
@@ -30,16 +30,16 @@ public class EditProfileActivity extends BaseActivity implements EditProfileFrag
|
||||
private final DynamicTheme dynamicTheme = new DynamicRegistrationTheme();
|
||||
|
||||
public static @NonNull Intent getIntentForUserProfile(@NonNull Context context) {
|
||||
Intent intent = new Intent(context, EditProfileActivity.class);
|
||||
intent.putExtra(EditProfileActivity.SHOW_TOOLBAR, false);
|
||||
Intent intent = new Intent(context, CreateProfileActivity.class);
|
||||
intent.putExtra(CreateProfileActivity.SHOW_TOOLBAR, false);
|
||||
return intent;
|
||||
}
|
||||
|
||||
public static @NonNull Intent getIntentForGroupProfile(@NonNull Context context, @NonNull GroupId groupId) {
|
||||
Intent intent = new Intent(context, EditProfileActivity.class);
|
||||
intent.putExtra(EditProfileActivity.SHOW_TOOLBAR, true);
|
||||
intent.putExtra(EditProfileActivity.GROUP_ID, groupId.toString());
|
||||
intent.putExtra(EditProfileActivity.NEXT_BUTTON_TEXT, R.string.save);
|
||||
Intent intent = new Intent(context, CreateProfileActivity.class);
|
||||
intent.putExtra(CreateProfileActivity.SHOW_TOOLBAR, true);
|
||||
intent.putExtra(CreateProfileActivity.GROUP_ID, groupId.toString());
|
||||
intent.putExtra(CreateProfileActivity.NEXT_BUTTON_TEXT, R.string.save);
|
||||
return intent;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class EditProfileActivity extends BaseActivity implements EditProfileFrag
|
||||
|
||||
dynamicTheme.onCreate(this);
|
||||
|
||||
setContentView(R.layout.profile_create_activity);
|
||||
setContentView(R.layout.create_profile_activity);
|
||||
|
||||
if (bundle == null) {
|
||||
NavHostFragment fragment = NavHostFragment.create(R.navigation.edit_profile, getIntent().getExtras());
|
||||
@@ -60,7 +60,7 @@ public class EditProfileActivity extends BaseActivity implements EditProfileFrag
|
||||
|
||||
getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) {
|
||||
@Override public void handleOnBackPressed() {
|
||||
if (!Navigation.findNavController(EditProfileActivity.this, R.id.fragment_container).popBackStack()) {
|
||||
if (!Navigation.findNavController(CreateProfileActivity.this, R.id.fragment_container).popBackStack()) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ import org.thoughtcrime.securesms.LoggingFragment;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.avatar.Avatars;
|
||||
import org.thoughtcrime.securesms.avatar.picker.AvatarPickerFragment;
|
||||
import org.thoughtcrime.securesms.databinding.ProfileCreateFragmentBinding;
|
||||
import org.thoughtcrime.securesms.databinding.CreateProfileFragmentBinding;
|
||||
import org.thoughtcrime.securesms.groups.GroupId;
|
||||
import org.thoughtcrime.securesms.groups.ParcelableGroupId;
|
||||
import org.thoughtcrime.securesms.keyvalue.PhoneNumberPrivacyValues;
|
||||
@@ -49,25 +49,25 @@ import org.thoughtcrime.securesms.util.text.AfterTextChanged;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import static org.thoughtcrime.securesms.profiles.edit.EditProfileActivity.EXCLUDE_SYSTEM;
|
||||
import static org.thoughtcrime.securesms.profiles.edit.EditProfileActivity.GROUP_ID;
|
||||
import static org.thoughtcrime.securesms.profiles.edit.EditProfileActivity.NEXT_BUTTON_TEXT;
|
||||
import static org.thoughtcrime.securesms.profiles.edit.EditProfileActivity.NEXT_INTENT;
|
||||
import static org.thoughtcrime.securesms.profiles.edit.EditProfileActivity.SHOW_TOOLBAR;
|
||||
import static org.thoughtcrime.securesms.profiles.edit.CreateProfileActivity.EXCLUDE_SYSTEM;
|
||||
import static org.thoughtcrime.securesms.profiles.edit.CreateProfileActivity.GROUP_ID;
|
||||
import static org.thoughtcrime.securesms.profiles.edit.CreateProfileActivity.NEXT_BUTTON_TEXT;
|
||||
import static org.thoughtcrime.securesms.profiles.edit.CreateProfileActivity.NEXT_INTENT;
|
||||
import static org.thoughtcrime.securesms.profiles.edit.CreateProfileActivity.SHOW_TOOLBAR;
|
||||
|
||||
/**
|
||||
* Used for profile creation during registration.
|
||||
*/
|
||||
public class EditProfileFragment extends LoggingFragment {
|
||||
public class CreateProfileFragment extends LoggingFragment {
|
||||
|
||||
private static final String TAG = Log.tag(EditProfileFragment.class);
|
||||
private static final String TAG = Log.tag(CreateProfileFragment.class);
|
||||
private static final int MAX_DESCRIPTION_GLYPHS = 480;
|
||||
private static final int MAX_DESCRIPTION_BYTES = 8192;
|
||||
|
||||
private Intent nextIntent;
|
||||
|
||||
private EditProfileViewModel viewModel;
|
||||
private ProfileCreateFragmentBinding binding;
|
||||
private CreateProfileFragmentBinding binding;
|
||||
|
||||
private Controller controller;
|
||||
|
||||
@@ -84,7 +84,7 @@ public class EditProfileFragment extends LoggingFragment {
|
||||
|
||||
@Override
|
||||
public @Nullable View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
binding = ProfileCreateFragmentBinding.inflate(inflater, container, false);
|
||||
binding = CreateProfileFragmentBinding.inflate(inflater, container, false);
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ public class EditProfileFragment extends LoggingFragment {
|
||||
if (avatarBytes != null) {
|
||||
viewModel.setAvatarMedia(media);
|
||||
viewModel.setAvatar(avatarBytes);
|
||||
GlideApp.with(EditProfileFragment.this)
|
||||
GlideApp.with(CreateProfileFragment.this)
|
||||
.load(avatarBytes)
|
||||
.skipMemoryCache(true)
|
||||
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
||||
@@ -217,7 +217,7 @@ public class EditProfileFragment extends LoggingFragment {
|
||||
});
|
||||
|
||||
binding.whoCanFindMeContainer.setVisibility(View.VISIBLE);
|
||||
binding.whoCanFindMeContainer.setOnClickListener(v -> SafeNavigation.safeNavigate(Navigation.findNavController(v), EditProfileFragmentDirections.actionCreateProfileFragmentToPhoneNumberPrivacy()));
|
||||
binding.whoCanFindMeContainer.setOnClickListener(v -> SafeNavigation.safeNavigate(Navigation.findNavController(v), CreateProfileFragmentDirections.actionCreateProfileFragmentToPhoneNumberPrivacy()));
|
||||
presentWhoCanFindMeDescription(SignalStore.phoneNumberPrivacy().getPhoneNumberListingMode());
|
||||
}
|
||||
}
|
||||
@@ -299,9 +299,9 @@ public class EditProfileFragment extends LoggingFragment {
|
||||
private void startAvatarSelection() {
|
||||
if (viewModel.isGroup()) {
|
||||
Parcelable groupId = ParcelableGroupId.from(viewModel.getGroupId());
|
||||
SafeNavigation.safeNavigate(Navigation.findNavController(requireView()), EditProfileFragmentDirections.actionCreateProfileFragmentToAvatarPicker((ParcelableGroupId) groupId, viewModel.getAvatarMedia()));
|
||||
SafeNavigation.safeNavigate(Navigation.findNavController(requireView()), CreateProfileFragmentDirections.actionCreateProfileFragmentToAvatarPicker((ParcelableGroupId) groupId, viewModel.getAvatarMedia()));
|
||||
} else {
|
||||
SafeNavigation.safeNavigate(Navigation.findNavController(requireView()), EditProfileFragmentDirections.actionCreateProfileFragmentToAvatarPicker(null, null));
|
||||
SafeNavigation.safeNavigate(Navigation.findNavController(requireView()), CreateProfileFragmentDirections.actionCreateProfileFragmentToAvatarPicker(null, null));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ import java.util.Optional;
|
||||
/**
|
||||
* Let's you edit the 'About' section of your profile.
|
||||
*/
|
||||
public class EditAboutFragment extends Fragment implements ManageProfileActivity.EmojiController {
|
||||
public class EditAboutFragment extends Fragment implements EditProfileActivity.EmojiController {
|
||||
|
||||
public static final int ABOUT_MAX_GLYPHS = 140;
|
||||
public static final int ABOUT_LIMIT_DISPLAY_THRESHOLD = 120;
|
||||
|
||||
@@ -20,9 +20,9 @@ import org.thoughtcrime.securesms.util.DynamicTheme;
|
||||
import org.thoughtcrime.securesms.util.navigation.SafeNavigation;
|
||||
|
||||
/**
|
||||
* Activity that manages the local user's profile, as accessed via the settings.
|
||||
* Activity for editing your profile after you're already registered.
|
||||
*/
|
||||
public class ManageProfileActivity extends PassphraseRequiredActivity implements ReactWithAnyEmojiBottomSheetDialogFragment.Callback {
|
||||
public class EditProfileActivity extends PassphraseRequiredActivity implements ReactWithAnyEmojiBottomSheetDialogFragment.Callback {
|
||||
|
||||
public static final int RESULT_BECOME_A_SUSTAINER = 12382;
|
||||
|
||||
@@ -32,17 +32,17 @@ public class ManageProfileActivity extends PassphraseRequiredActivity implements
|
||||
public static final String START_AT_AVATAR = "start_at_avatar";
|
||||
|
||||
public static @NonNull Intent getIntent(@NonNull Context context) {
|
||||
return new Intent(context, ManageProfileActivity.class);
|
||||
return new Intent(context, EditProfileActivity.class);
|
||||
}
|
||||
|
||||
public static @NonNull Intent getIntentForUsernameEdit(@NonNull Context context) {
|
||||
Intent intent = new Intent(context, ManageProfileActivity.class);
|
||||
Intent intent = new Intent(context, EditProfileActivity.class);
|
||||
intent.putExtra(START_AT_USERNAME, true);
|
||||
return intent;
|
||||
}
|
||||
|
||||
public static @NonNull Intent getIntentForAvatarEdit(@NonNull Context context) {
|
||||
Intent intent = new Intent(context, ManageProfileActivity.class);
|
||||
Intent intent = new Intent(context, EditProfileActivity.class);
|
||||
intent.putExtra(START_AT_AVATAR, true);
|
||||
return intent;
|
||||
}
|
||||
@@ -51,7 +51,7 @@ public class ManageProfileActivity extends PassphraseRequiredActivity implements
|
||||
public void onCreate(Bundle bundle, boolean ready) {
|
||||
dynamicTheme.onCreate(this);
|
||||
|
||||
setContentView(R.layout.manage_profile_activity);
|
||||
setContentView(R.layout.edit_profile_activity);
|
||||
|
||||
if (bundle == null) {
|
||||
Bundle extras = getIntent().getExtras();
|
||||
@@ -65,16 +65,16 @@ public class ManageProfileActivity extends PassphraseRequiredActivity implements
|
||||
|
||||
if (extras != null && extras.getBoolean(START_AT_USERNAME, false)) {
|
||||
if (SignalStore.uiHints().hasSeenUsernameEducation()) {
|
||||
NavDirections action = ManageProfileFragmentDirections.actionManageUsername();
|
||||
NavDirections action = EditProfileFragmentDirections.actionManageUsername();
|
||||
SafeNavigation.safeNavigate(navController, action);
|
||||
} else {
|
||||
NavDirections action = ManageProfileFragmentDirections.actionManageProfileFragmentToUsernameEducationFragment();
|
||||
NavDirections action = EditProfileFragmentDirections.actionManageProfileFragmentToUsernameEducationFragment();
|
||||
SafeNavigation.safeNavigate(navController, action);
|
||||
}
|
||||
}
|
||||
|
||||
if (extras != null && extras.getBoolean(START_AT_AVATAR, false)) {
|
||||
NavDirections action = ManageProfileFragmentDirections.actionManageProfileFragmentToAvatarPicker(null, null);
|
||||
NavDirections action = EditProfileFragmentDirections.actionManageProfileFragmentToAvatarPicker(null, null);
|
||||
SafeNavigation.safeNavigate(navController, action);
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ import org.thoughtcrime.securesms.badges.models.Badge;
|
||||
import org.thoughtcrime.securesms.badges.self.none.BecomeASustainerFragment;
|
||||
import org.thoughtcrime.securesms.components.emoji.EmojiTextView;
|
||||
import org.thoughtcrime.securesms.components.emoji.EmojiUtil;
|
||||
import org.thoughtcrime.securesms.databinding.ManageProfileFragmentBinding;
|
||||
import org.thoughtcrime.securesms.databinding.EditProfileFragmentBinding;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.mediasend.Media;
|
||||
import org.thoughtcrime.securesms.profiles.ProfileName;
|
||||
@@ -50,18 +50,21 @@ import java.util.Optional;
|
||||
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
|
||||
public class ManageProfileFragment extends LoggingFragment {
|
||||
/**
|
||||
* Fragment for editing your profile after you're already registered.
|
||||
*/
|
||||
public class EditProfileFragment extends LoggingFragment {
|
||||
|
||||
private static final String TAG = Log.tag(ManageProfileFragment.class);
|
||||
private static final String TAG = Log.tag(EditProfileFragment.class);
|
||||
|
||||
private AlertDialog avatarProgress;
|
||||
private ManageProfileViewModel viewModel;
|
||||
private ManageProfileFragmentBinding binding;
|
||||
private LifecycleDisposable disposables;
|
||||
private AlertDialog avatarProgress;
|
||||
private ManageProfileViewModel viewModel;
|
||||
private EditProfileFragmentBinding binding;
|
||||
private LifecycleDisposable disposables;
|
||||
|
||||
@Override
|
||||
public @Nullable View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
binding = ManageProfileFragmentBinding.inflate(inflater, container, false);
|
||||
binding = EditProfileFragmentBinding.inflate(inflater, container, false);
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
@@ -86,7 +89,7 @@ public class ManageProfileFragment extends LoggingFragment {
|
||||
binding.manageProfileEditPhoto.setOnClickListener(v -> onEditAvatarClicked());
|
||||
|
||||
binding.manageProfileNameContainer.setOnClickListener(v -> {
|
||||
SafeNavigation.safeNavigate(Navigation.findNavController(v), ManageProfileFragmentDirections.actionManageProfileName());
|
||||
SafeNavigation.safeNavigate(Navigation.findNavController(v), EditProfileFragmentDirections.actionManageProfileName());
|
||||
});
|
||||
|
||||
binding.manageProfileUsernameContainer.setOnClickListener(v -> {
|
||||
@@ -96,7 +99,7 @@ public class ManageProfileFragment extends LoggingFragment {
|
||||
.setItems(R.array.username_edit_entries, (d, w) -> {
|
||||
switch (w) {
|
||||
case 0:
|
||||
SafeNavigation.safeNavigate(Navigation.findNavController(v), ManageProfileFragmentDirections.actionManageUsername());
|
||||
SafeNavigation.safeNavigate(Navigation.findNavController(v), EditProfileFragmentDirections.actionManageUsername());
|
||||
break;
|
||||
case 1:
|
||||
displayConfirmUsernameDeletionDialog();
|
||||
@@ -107,15 +110,15 @@ public class ManageProfileFragment extends LoggingFragment {
|
||||
})
|
||||
.show();
|
||||
} else {
|
||||
SafeNavigation.safeNavigate(Navigation.findNavController(v), ManageProfileFragmentDirections.actionManageUsername());
|
||||
SafeNavigation.safeNavigate(Navigation.findNavController(v), EditProfileFragmentDirections.actionManageUsername());
|
||||
}
|
||||
} else {
|
||||
SafeNavigation.safeNavigate(Navigation.findNavController(v), ManageProfileFragmentDirections.actionManageProfileFragmentToUsernameEducationFragment());
|
||||
SafeNavigation.safeNavigate(Navigation.findNavController(v), EditProfileFragmentDirections.actionManageProfileFragmentToUsernameEducationFragment());
|
||||
}
|
||||
});
|
||||
|
||||
binding.manageProfileAboutContainer.setOnClickListener(v -> {
|
||||
SafeNavigation.safeNavigate(Navigation.findNavController(v), ManageProfileFragmentDirections.actionManageAbout());
|
||||
SafeNavigation.safeNavigate(Navigation.findNavController(v), EditProfileFragmentDirections.actionManageAbout());
|
||||
});
|
||||
|
||||
getParentFragmentManager().setFragmentResultListener(AvatarPickerFragment.REQUEST_KEY_SELECT_AVATAR, getViewLifecycleOwner(), (key, bundle) -> {
|
||||
@@ -138,7 +141,7 @@ public class ManageProfileFragment extends LoggingFragment {
|
||||
if (Recipient.self().getBadges().isEmpty()) {
|
||||
BecomeASustainerFragment.show(getParentFragmentManager());
|
||||
} else {
|
||||
SafeNavigation.safeNavigate(Navigation.findNavController(v), ManageProfileFragmentDirections.actionManageProfileFragmentToBadgeManageFragment());
|
||||
SafeNavigation.safeNavigate(Navigation.findNavController(v), EditProfileFragmentDirections.actionManageProfileFragmentToBadgeManageFragment());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -148,7 +151,7 @@ public class ManageProfileFragment extends LoggingFragment {
|
||||
});
|
||||
|
||||
binding.manageProfileUsernameShare.setOnClickListener(v -> {
|
||||
SafeNavigation.safeNavigate(Navigation.findNavController(v), ManageProfileFragmentDirections.actionManageProfileFragmentToShareUsernameDialog());
|
||||
SafeNavigation.safeNavigate(Navigation.findNavController(v), EditProfileFragmentDirections.actionManageProfileFragmentToShareUsernameDialog());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -289,7 +292,7 @@ public class ManageProfileFragment extends LoggingFragment {
|
||||
}
|
||||
|
||||
private void onEditAvatarClicked() {
|
||||
SafeNavigation.safeNavigate(Navigation.findNavController(requireView()), ManageProfileFragmentDirections.actionManageProfileFragmentToAvatarPicker(null, null));
|
||||
SafeNavigation.safeNavigate(Navigation.findNavController(requireView()), EditProfileFragmentDirections.actionManageProfileFragmentToAvatarPicker(null, null));
|
||||
}
|
||||
|
||||
private void displayConfirmUsernameDeletionDialog() {
|
||||
@@ -19,7 +19,7 @@ import org.thoughtcrime.securesms.keyvalue.SignalStore
|
||||
import org.thoughtcrime.securesms.lock.v2.CreateSvrPinActivity
|
||||
import org.thoughtcrime.securesms.pin.PinRestoreActivity
|
||||
import org.thoughtcrime.securesms.profiles.AvatarHelper
|
||||
import org.thoughtcrime.securesms.profiles.edit.EditProfileActivity
|
||||
import org.thoughtcrime.securesms.profiles.edit.CreateProfileActivity
|
||||
import org.thoughtcrime.securesms.recipients.Recipient
|
||||
import org.thoughtcrime.securesms.registration.RegistrationUtil
|
||||
import org.thoughtcrime.securesms.registration.viewmodel.RegistrationViewModel
|
||||
@@ -70,7 +70,7 @@ class RegistrationCompleteFragment : LoggingFragment() {
|
||||
}
|
||||
|
||||
if (needsProfile) {
|
||||
startIntent = chainIntents(EditProfileActivity.getIntentForUserProfile(activity), startIntent)
|
||||
startIntent = chainIntents(CreateProfileActivity.getIntentForUserProfile(activity), startIntent)
|
||||
}
|
||||
|
||||
activity.startActivity(startIntent)
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
android:id="@+id/fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".profiles.edit.EditProfileActivity" />
|
||||
tools:context=".profiles.edit.CreateProfileActivity" />
|
||||
@@ -5,7 +5,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".profiles.edit.EditProfileActivity">
|
||||
tools:context=".profiles.edit.CreateProfileActivity">
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/nav_host_fragment"
|
||||
@@ -144,7 +144,7 @@
|
||||
|
||||
<activity
|
||||
android:id="@+id/manageProfileActivity"
|
||||
android:name="org.thoughtcrime.securesms.profiles.manage.ManageProfileActivity"
|
||||
android:name="org.thoughtcrime.securesms.profiles.manage.EditProfileActivity"
|
||||
android:label="manage_profile_activity" />
|
||||
|
||||
<!-- region Account Settings and subpages -->
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
<fragment
|
||||
android:id="@+id/createProfileFragment"
|
||||
android:name="org.thoughtcrime.securesms.profiles.edit.EditProfileFragment"
|
||||
android:name="org.thoughtcrime.securesms.profiles.edit.CreateProfileFragment"
|
||||
android:label="fragment_create_profile"
|
||||
tools:layout="@layout/profile_create_fragment">
|
||||
tools:layout="@layout/create_profile_fragment">
|
||||
|
||||
<action
|
||||
android:id="@+id/action_createProfileFragment_to_avatar_picker"
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
<fragment
|
||||
android:id="@+id/manageProfileFragment"
|
||||
android:name="org.thoughtcrime.securesms.profiles.manage.ManageProfileFragment"
|
||||
android:name="org.thoughtcrime.securesms.profiles.manage.EditProfileFragment"
|
||||
android:label="fragment_manage_profile"
|
||||
tools:layout="@layout/manage_profile_fragment">
|
||||
tools:layout="@layout/edit_profile_fragment">
|
||||
|
||||
<action
|
||||
android:id="@+id/action_manageUsername"
|
||||
|
||||
Reference in New Issue
Block a user