Strings and slight cleanup

This commit is contained in:
Moxie Marlinspike 2013-07-10 17:54:38 -07:00
parent 26dadfcb7a
commit 0ed9da9a2c
4 changed files with 27 additions and 15 deletions

View File

@ -9,7 +9,7 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_menu_search_holo_light" android:drawableLeft="@drawable/ic_menu_search_holo_light"
android:hint="Search" /> android:hint="@string/country_selection_fragment__search" />
<ListView android:id="@android:id/list" <ListView android:id="@android:id/list"
android:layout_width="fill_parent" android:layout_width="fill_parent"
@ -23,7 +23,5 @@
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:gravity="center" android:gravity="center"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Loading countries..." /> android:text="@string/country_selection_fragment__loading_countries" />
</LinearLayout> </LinearLayout>

View File

@ -237,6 +237,11 @@
<string name="RegistrationProgressActivity_youve_already_requested_a_voice_call">You\'ve already recently requested a voice call. You can request another in 20 minutes.</string> <string name="RegistrationProgressActivity_youve_already_requested_a_voice_call">You\'ve already recently requested a voice call. You can request another in 20 minutes.</string>
<string name="RegistrationProgressActivity_verifying_voice_code">Verifying voice code...</string> <string name="RegistrationProgressActivity_verifying_voice_code">Verifying voice code...</string>
<!-- RegistrationService -->
<string name="RegistrationService_registration_complete">Registration Complete</string>
<string name="RegistrationService_textsecure_registration_has_successfully_completed">TextSecure registration has successfully completed.</string>
<string name="RegistrationService_registration_error">Registration Error</string>
<string name="RegistrationService_textsecure_registration_has_encountered_a_problem">TextSecure registration has encountered a problem.</string>
<!-- VerifyIdentityActivity --> <!-- VerifyIdentityActivity -->
<string name="VerifyIdentityActivity_you_do_not_have_an_identity_key">You do not have an identity key.</string> <string name="VerifyIdentityActivity_you_do_not_have_an_identity_key">You do not have an identity key.</string>
@ -370,7 +375,11 @@
<!-- conversation_fragment_cab --> <!-- conversation_fragment_cab -->
<string name="conversation_fragment_cab__batch_selection_mode">Batch Selection Mode</string> <string name="conversation_fragment_cab__batch_selection_mode">Batch Selection Mode</string>
<!-- country_selection_fragment -->
<string name="country_selection_fragment__loading_countries">Loading countries...</string>
<string name="country_selection_fragment__search">Search</string>
<!-- create_passphrase_activity --> <!-- create_passphrase_activity -->
<string name="create_passphrase_activity__please_choose_a_passphrase_that_will_be_used_to_locally_encrypt_your_data_this_should_be_a_strong_passphrase">Please choose a passphrase that will be used to locally encrypt your data.\n\nThis should be a strong passphrase.</string> <string name="create_passphrase_activity__please_choose_a_passphrase_that_will_be_used_to_locally_encrypt_your_data_this_should_be_a_strong_passphrase">Please choose a passphrase that will be used to locally encrypt your data.\n\nThis should be a strong passphrase.</string>
<string name="create_passphrase_activity__passphrase">PASSPHRASE:</string> <string name="create_passphrase_activity__passphrase">PASSPHRASE:</string>

View File

@ -28,7 +28,8 @@ import org.whispersystems.textsecure.util.PhoneNumberFormatter;
import org.whispersystems.textsecure.util.Util; import org.whispersystems.textsecure.util.Util;
/** /**
* The register account activity. Begins the account registration process. * The register account activity. Prompts ths user for their registration information
* and begins the account registration process.
* *
* @author Moxie Marlinspike * @author Moxie Marlinspike
* *
@ -53,6 +54,7 @@ public class RegistrationActivity extends SherlockActivity {
actionBar.setTitle(getString(R.string.RegistrationActivity_connect_with_textsecure)); actionBar.setTitle(getString(R.string.RegistrationActivity_connect_with_textsecure));
initializeResources(); initializeResources();
initializeSpinner();
initializeNumber(); initializeNumber();
} }
@ -71,8 +73,15 @@ public class RegistrationActivity extends SherlockActivity {
this.number = (TextView)findViewById(R.id.number); this.number = (TextView)findViewById(R.id.number);
this.createButton = (Button)findViewById(R.id.registerButton); this.createButton = (Button)findViewById(R.id.registerButton);
this.countryCode.addTextChangedListener(new CountryCodeChangedListener());
this.number.addTextChangedListener(new NumberChangedListener());
this.createButton.setOnClickListener(new CreateButtonListener());
}
private void initializeSpinner() {
this.countrySpinnerAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item); this.countrySpinnerAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item);
this.countrySpinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); this.countrySpinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
setCountryDisplay(getString(R.string.RegistrationActivity_select_your_country)); setCountryDisplay(getString(R.string.RegistrationActivity_select_your_country));
this.countrySpinner.setAdapter(this.countrySpinnerAdapter); this.countrySpinner.setAdapter(this.countrySpinnerAdapter);
@ -86,13 +95,8 @@ public class RegistrationActivity extends SherlockActivity {
return true; return true;
} }
}); });
this.countryCode.addTextChangedListener(new CountryCodeChangedListener());
this.number.addTextChangedListener(new NumberChangedListener());
this.createButton.setOnClickListener(new CreateButtonListener());
} }
private void initializeNumber() { private void initializeNumber() {
String localNumber = ((TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE)) String localNumber = ((TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE))
.getLine1Number(); .getLine1Number();

View File

@ -15,6 +15,7 @@ import android.util.Log;
import com.google.android.gcm.GCMRegistrar; import com.google.android.gcm.GCMRegistrar;
import org.thoughtcrime.securesms.ApplicationPreferencesActivity; import org.thoughtcrime.securesms.ApplicationPreferencesActivity;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.gcm.GcmIntentService; import org.thoughtcrime.securesms.gcm.GcmIntentService;
import org.thoughtcrime.securesms.gcm.GcmRegistrationTimeoutException; import org.thoughtcrime.securesms.gcm.GcmRegistrationTimeoutException;
import org.whispersystems.textsecure.push.PushServiceSocket; import org.whispersystems.textsecure.push.PushServiceSocket;
@ -327,11 +328,11 @@ public class RegistrationService extends Service {
intent.setAction(REGISTRATION_EVENT); intent.setAction(REGISTRATION_EVENT);
if (success) { if (success) {
intent.putExtra(NOTIFICATION_TITLE, "Registration Complete"); intent.putExtra(NOTIFICATION_TITLE, getString(R.string.RegistrationService_registration_complete));
intent.putExtra(NOTIFICATION_TEXT, "TextSecure registration has successfully completed."); intent.putExtra(NOTIFICATION_TEXT, getString(R.string.RegistrationService_textsecure_registration_has_successfully_completed));
} else { } else {
intent.putExtra(NOTIFICATION_TITLE, "Registration Error"); intent.putExtra(NOTIFICATION_TITLE, getString(R.string.RegistrationService_registration_error));
intent.putExtra(NOTIFICATION_TEXT, "TextSecure registration has encountered a problem."); intent.putExtra(NOTIFICATION_TEXT, getString(R.string.RegistrationService_textsecure_registration_has_encountered_a_problem));
} }
this.sendOrderedBroadcast(intent, null); this.sendOrderedBroadcast(intent, null);