Inline the pnp feature flag.

This commit is contained in:
Greyson Parrelli
2024-02-06 14:01:38 -05:00
committed by Cody Henthorne
parent 8ad77ac7aa
commit c359ddf3c8
14 changed files with 29 additions and 142 deletions

View File

@@ -209,17 +209,15 @@ public class CreateProfileFragment extends LoggingFragment {
binding.profileDescriptionText.setLinkColor(ContextCompat.getColor(requireContext(), R.color.signal_colorPrimary));
binding.profileDescriptionText.setOnLinkClickListener(v -> CommunicationActions.openBrowserLink(requireContext(), getString(R.string.EditProfileFragment__support_link)));
if (FeatureFlags.phoneNumberPrivacy()) {
getParentFragmentManager().setFragmentResultListener(WhoCanFindMeByPhoneNumberFragment.REQUEST_KEY, getViewLifecycleOwner(), (requestKey, result) -> {
if (WhoCanFindMeByPhoneNumberFragment.REQUEST_KEY.equals(requestKey)) {
presentWhoCanFindMeDescription(SignalStore.phoneNumberPrivacy().getPhoneNumberDiscoverabilityMode());
}
});
getParentFragmentManager().setFragmentResultListener(WhoCanFindMeByPhoneNumberFragment.REQUEST_KEY, getViewLifecycleOwner(), (requestKey, result) -> {
if (WhoCanFindMeByPhoneNumberFragment.REQUEST_KEY.equals(requestKey)) {
presentWhoCanFindMeDescription(SignalStore.phoneNumberPrivacy().getPhoneNumberDiscoverabilityMode());
}
});
binding.whoCanFindMeContainer.setVisibility(View.VISIBLE);
binding.whoCanFindMeContainer.setOnClickListener(v -> SafeNavigation.safeNavigate(Navigation.findNavController(v), CreateProfileFragmentDirections.actionCreateProfileFragmentToPhoneNumberPrivacy()));
presentWhoCanFindMeDescription(SignalStore.phoneNumberPrivacy().getPhoneNumberDiscoverabilityMode());
}
binding.whoCanFindMeContainer.setVisibility(View.VISIBLE);
binding.whoCanFindMeContainer.setOnClickListener(v -> SafeNavigation.safeNavigate(Navigation.findNavController(v), CreateProfileFragmentDirections.actionCreateProfileFragmentToPhoneNumberPrivacy()));
presentWhoCanFindMeDescription(SignalStore.phoneNumberPrivacy().getPhoneNumberDiscoverabilityMode());
}
binding.finishButton.setOnClickListener(v -> {

View File

@@ -14,7 +14,6 @@ import org.thoughtcrime.securesms.components.settings.DSLSettingsFragment
import org.thoughtcrime.securesms.components.settings.DSLSettingsText
import org.thoughtcrime.securesms.components.settings.configure
import org.thoughtcrime.securesms.databinding.WhoCanFindMeByPhoneNumberFragmentBinding
import org.thoughtcrime.securesms.util.FeatureFlags
import org.thoughtcrime.securesms.util.adapter.mapping.MappingAdapter
/**
@@ -38,8 +37,6 @@ class WhoCanFindMeByPhoneNumberFragment : DSLSettingsFragment(
private val binding by ViewBinderDelegate(WhoCanFindMeByPhoneNumberFragmentBinding::bind)
override fun bindAdapter(adapter: MappingAdapter) {
require(FeatureFlags.phoneNumberPrivacy())
lifecycleDisposable += viewModel.state.subscribe {
adapter.submitList(getConfiguration(it).toMappingModelList())
}