Fix country picker reproducible builds bug.

This commit is contained in:
Cody Henthorne 2025-01-14 11:24:32 -05:00
parent f4ed8e29f4
commit eff2bf429d
5 changed files with 6 additions and 29 deletions

View file

@ -3,7 +3,7 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
package org.thoughtcrime.securesms.registration.fragments; package org.thoughtcrime.securesms.components.settings.app.changenumber;
import android.os.Bundle; import android.os.Bundle;
import android.text.Editable; import android.text.Editable;
@ -25,13 +25,12 @@ import androidx.loader.content.Loader;
import androidx.navigation.fragment.NavHostFragment; import androidx.navigation.fragment.NavHostFragment;
import org.thoughtcrime.securesms.R; import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.components.settings.app.changenumber.ChangeNumberViewModel;
import org.thoughtcrime.securesms.database.loaders.CountryListLoader; import org.thoughtcrime.securesms.database.loaders.CountryListLoader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Map; import java.util.Map;
public final class CountryPickerFragment extends ListFragment implements LoaderManager.LoaderCallbacks<ArrayList<Map<String, String>>> { public final class ChangeNumberCountryPickerFragment extends ListFragment implements LoaderManager.LoaderCallbacks<ArrayList<Map<String, String>>> {
public static final String KEY_COUNTRY = "country"; public static final String KEY_COUNTRY = "country";
public static final String KEY_COUNTRY_CODE = "country_code"; public static final String KEY_COUNTRY_CODE = "country_code";
@ -50,7 +49,7 @@ public final class CountryPickerFragment extends ListFragment implements LoaderM
super.onViewCreated(view, savedInstanceState); super.onViewCreated(view, savedInstanceState);
if (getArguments() != null) { if (getArguments() != null) {
CountryPickerFragmentArgs arguments = CountryPickerFragmentArgs.fromBundle(requireArguments()); ChangeNumberCountryPickerFragmentArgs arguments = ChangeNumberCountryPickerFragmentArgs.fromBundle(requireArguments());
resultKey = arguments.getResultKey(); resultKey = arguments.getResultKey();
} }

View file

@ -18,7 +18,6 @@ import org.thoughtcrime.securesms.LoggingFragment
import org.thoughtcrime.securesms.R import org.thoughtcrime.securesms.R
import org.thoughtcrime.securesms.components.ViewBinderDelegate import org.thoughtcrime.securesms.components.ViewBinderDelegate
import org.thoughtcrime.securesms.databinding.FragmentChangeNumberEnterPhoneNumberBinding import org.thoughtcrime.securesms.databinding.FragmentChangeNumberEnterPhoneNumberBinding
import org.thoughtcrime.securesms.registration.fragments.CountryPickerFragment
import org.thoughtcrime.securesms.registration.util.ChangeNumberInputController import org.thoughtcrime.securesms.registration.util.ChangeNumberInputController
import org.thoughtcrime.securesms.util.Dialogs import org.thoughtcrime.securesms.util.Dialogs
import org.thoughtcrime.securesms.util.navigation.safeNavigate import org.thoughtcrime.securesms.util.navigation.safeNavigate
@ -110,11 +109,11 @@ class ChangeNumberEnterPhoneNumberFragment : LoggingFragment(R.layout.fragment_c
) )
parentFragmentManager.setFragmentResultListener(OLD_NUMBER_COUNTRY_SELECT, this) { _: String, bundle: Bundle -> parentFragmentManager.setFragmentResultListener(OLD_NUMBER_COUNTRY_SELECT, this) { _: String, bundle: Bundle ->
viewModel.setOldCountry(bundle.getInt(CountryPickerFragment.KEY_COUNTRY_CODE), bundle.getString(CountryPickerFragment.KEY_COUNTRY)) viewModel.setOldCountry(bundle.getInt(ChangeNumberCountryPickerFragment.KEY_COUNTRY_CODE), bundle.getString(ChangeNumberCountryPickerFragment.KEY_COUNTRY))
} }
parentFragmentManager.setFragmentResultListener(NEW_NUMBER_COUNTRY_SELECT, this) { _: String, bundle: Bundle -> parentFragmentManager.setFragmentResultListener(NEW_NUMBER_COUNTRY_SELECT, this) { _: String, bundle: Bundle ->
viewModel.setNewCountry(bundle.getInt(CountryPickerFragment.KEY_COUNTRY_CODE), bundle.getString(CountryPickerFragment.KEY_COUNTRY)) viewModel.setNewCountry(bundle.getInt(ChangeNumberCountryPickerFragment.KEY_COUNTRY_CODE), bundle.getString(ChangeNumberCountryPickerFragment.KEY_COUNTRY))
} }
viewModel.liveOldNumberState.observe(viewLifecycleOwner, oldController::updateNumber) viewModel.liveOldNumberState.observe(viewLifecycleOwner, oldController::updateNumber)

View file

@ -58,7 +58,7 @@
<fragment <fragment
android:id="@+id/countryPickerFragment" android:id="@+id/countryPickerFragment"
android:name="org.thoughtcrime.securesms.registration.fragments.CountryPickerFragment" android:name="org.thoughtcrime.securesms.components.settings.app.changenumber.ChangeNumberCountryPickerFragment"
tools:layout="@layout/fragment_registration_country_picker"> tools:layout="@layout/fragment_registration_country_picker">
<argument <argument
@ -170,13 +170,4 @@
android:name="org.thoughtcrime.securesms.components.settings.app.changenumber.ChangeNumberPinDiffersFragment" android:name="org.thoughtcrime.securesms.components.settings.app.changenumber.ChangeNumberPinDiffersFragment"
tools:layout="@layout/fragment_change_number_pin_differs" /> tools:layout="@layout/fragment_change_number_pin_differs" />
<action
android:id="@+id/action_pop_app_settings_change_number"
app:enterAnim="@anim/fragment_open_enter"
app:exitAnim="@anim/fragment_open_exit"
app:popEnterAnim="@anim/fragment_close_enter"
app:popExitAnim="@anim/fragment_close_exit"
app:popUpTo="@id/changePhoneNumberFragment"
app:popUpToInclusive="true" />
</navigation> </navigation>

View file

@ -119,12 +119,6 @@
</fragment> </fragment>
<fragment
android:id="@+id/countryPickerFragment"
android:name="org.thoughtcrime.securesms.registration.fragments.CountryPickerFragment"
android:label="fragment_country_picker"
tools:layout="@layout/fragment_registration_country_picker" />
<fragment <fragment
android:id="@+id/enterCodeFragment" android:id="@+id/enterCodeFragment"
android:name="org.thoughtcrime.securesms.registration.ui.entercode.EnterCodeFragment" android:name="org.thoughtcrime.securesms.registration.ui.entercode.EnterCodeFragment"

View file

@ -202,12 +202,6 @@
</fragment> </fragment>
<fragment
android:id="@+id/countryPickerFragment"
android:name="org.thoughtcrime.securesms.registration.fragments.CountryPickerFragment"
android:label="fragment_country_picker"
tools:layout="@layout/fragment_registration_country_picker" />
<fragment <fragment
android:id="@+id/enterCodeFragment" android:id="@+id/enterCodeFragment"
android:name="org.thoughtcrime.securesms.registrationv3.ui.entercode.EnterCodeFragment" android:name="org.thoughtcrime.securesms.registrationv3.ui.entercode.EnterCodeFragment"