diff --git a/res/layout/registration_activity.xml b/res/layout/registration_activity.xml index 71139f8d1a..a8554e29e6 100644 --- a/res/layout/registration_activity.xml +++ b/res/layout/registration_activity.xml @@ -185,6 +185,15 @@ android:textColor="@color/gray50" android:text="@android:string/cancel"/> + + - - - - - - - + diff --git a/res/values/strings.xml b/res/values/strings.xml index 72d0a142c3..2cff514c5b 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -559,6 +559,8 @@ I understand Play Services Error Google Play Services is updating or temporarily unavailable. Please try again. + Terms & Privacy Policy + Unable to open this link. No web browser found. More information Less information Signal needs access to your contacts and media in order to connect with friends, exchange messages, and make secure calls diff --git a/src/org/thoughtcrime/securesms/RegistrationActivity.java b/src/org/thoughtcrime/securesms/RegistrationActivity.java index 3076ad182e..21538ee090 100644 --- a/src/org/thoughtcrime/securesms/RegistrationActivity.java +++ b/src/org/thoughtcrime/securesms/RegistrationActivity.java @@ -3,11 +3,13 @@ package org.thoughtcrime.securesms; import android.Manifest; import android.animation.Animator; import android.annotation.SuppressLint; +import android.content.ActivityNotFoundException; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.graphics.Color; +import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.support.annotation.NonNull; @@ -118,6 +120,7 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif private TextView countryCode; private TextView number; private CircularProgressButton createButton; + private TextView termsLinkView; private TextView informationView; private TextView informationToggleText; private TextView title; @@ -183,7 +186,7 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif private void initializeResources() { TextView skipButton = findViewById(R.id.skip_button); TextView restoreSkipButton = findViewById(R.id.skip_restore_button); - View informationToggle = findViewById(R.id.information_link_container); + View termsLinkView = findViewById(R.id.terms_label); this.countrySpinner = findViewById(R.id.country_spinner); this.countryCode = findViewById(R.id.country_code); @@ -219,9 +222,10 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif this.number.addTextChangedListener(new NumberChangedListener()); this.createButton.setOnClickListener(v -> handleRegister()); this.callMeCountDownView.setOnClickListener(v -> handlePhoneCallRequest()); - skipButton.setOnClickListener(v -> handleCancel()); - informationToggle.setOnClickListener(new InformationToggleListener()); + skipButton.setOnClickListener(v -> handleCancel()); + informationToggleText.setOnClickListener(new InformationToggleListener()); + termsLinkView.setOnClickListener(this::onTermsLinkClicked); restoreSkipButton.setOnClickListener(v -> displayInitialView(true)); if (getIntent().getBooleanExtra(RE_REGISTRATION_EXTRA, false)) { @@ -984,6 +988,15 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif } } + private void onTermsLinkClicked(View v) { + try { + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://signal.org/legal")); + startActivity(intent); + } catch (ActivityNotFoundException e) { + Toast.makeText(this, R.string.RegistrationActivity_no_browser, Toast.LENGTH_SHORT).show(); + } + } + @Subscribe(threadMode = ThreadMode.MAIN) public void onEvent(FullBackupBase.BackupEvent event) { if (event.getCount() == 0) restoreBackupProgress.setText(R.string.RegistrationActivity_checking);