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

@@ -28,7 +28,8 @@ import org.whispersystems.textsecure.util.PhoneNumberFormatter;
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
*
@@ -53,6 +54,7 @@ public class RegistrationActivity extends SherlockActivity {
actionBar.setTitle(getString(R.string.RegistrationActivity_connect_with_textsecure));
initializeResources();
initializeSpinner();
initializeNumber();
}
@@ -71,8 +73,15 @@ public class RegistrationActivity extends SherlockActivity {
this.number = (TextView)findViewById(R.id.number);
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.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
setCountryDisplay(getString(R.string.RegistrationActivity_select_your_country));
this.countrySpinner.setAdapter(this.countrySpinnerAdapter);
@@ -86,13 +95,8 @@ public class RegistrationActivity extends SherlockActivity {
return true;
}
});
this.countryCode.addTextChangedListener(new CountryCodeChangedListener());
this.number.addTextChangedListener(new NumberChangedListener());
this.createButton.setOnClickListener(new CreateButtonListener());
}
private void initializeNumber() {
String localNumber = ((TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE))
.getLine1Number();

View File

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