Skip to content

Show the SMS rates warning even without ToS/PP #1563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class CheckPhoneNumberFragment extends FragmentBase implements View.OnCli
private TextInputLayout mPhoneInputLayout;
private EditText mPhoneEditText;
private TextView mSmsTermsText;
private TextView mFooterText;


public static CheckPhoneNumberFragment newInstance(Bundle params) {
Expand Down Expand Up @@ -81,6 +82,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
mPhoneInputLayout = view.findViewById(R.id.phone_layout);
mPhoneEditText = view.findViewById(R.id.phone_number);
mSmsTermsText = view.findViewById(R.id.send_sms_tos);
mFooterText = view.findViewById(R.id.email_footer_tos_and_pp_text);

mSmsTermsText.setText(getString(R.string.fui_sms_terms_of_service,
getString(R.string.fui_verify_phone_number)));
Expand All @@ -97,7 +99,7 @@ public void onDonePressed() {
});
mSubmitButton.setOnClickListener(this);

setupPrivacyDisclosures(view.<TextView>findViewById(R.id.email_footer_tos_and_pp_text));
setupPrivacyDisclosures();
setupCountrySpinner();
}

Expand Down Expand Up @@ -171,17 +173,20 @@ private String getPseudoValidPhoneNumber() {
everythingElse, mCountryListSpinner.getSelectedCountryInfo());
}

private void setupPrivacyDisclosures(TextView footerText) {
private void setupPrivacyDisclosures() {
FlowParameters params = getFlowParams();

if (!params.shouldShowProviderChoice()) {
boolean termsAndPrivacyUrlsProvided = params.isTermsOfServiceUrlProvided()
&& params.isPrivacyPolicyUrlProvided();

if (!params.shouldShowProviderChoice() && termsAndPrivacyUrlsProvided) {
PrivacyDisclosureUtils.setupTermsOfServiceAndPrivacyPolicySmsText(requireContext(),
params,
mSmsTermsText);
} else {
PrivacyDisclosureUtils.setupTermsOfServiceFooter(requireContext(),
params,
footerText);
mFooterText);

String verifyText = getString(R.string.fui_verify_phone_number);
mSmsTermsText.setText(getString(R.string.fui_sms_terms_of_service, verifyText));
Expand Down