diff --git a/res/layout/registration_activity.xml b/res/layout/registration_activity.xml index 737aeb2ca..31e1b164b 100644 --- a/res/layout/registration_activity.xml +++ b/res/layout/registration_activity.xml @@ -34,20 +34,21 @@ android:background="@color/signal_primary" android:gravity="center" android:padding="16dp" - android:text="Login to Delta Chat" + android:text="@string/RegistrationActivity_header" android:textColor="@color/white" android:textSize="20sp" android:textStyle="bold" /> @@ -83,7 +84,7 @@ Sometimes IMAP needs to be enabled in the web frontend. Consult your email provi android:id="@+id/email_text" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="Email address" + android:hint="@string/email_address" android:inputType="textEmailAddress" /> @@ -101,7 +102,7 @@ Sometimes IMAP needs to be enabled in the web frontend. Consult your email provi android:id="@+id/password_text" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="Password" + android:hint="@string/password" android:inputType="textPassword" /> @@ -119,7 +120,7 @@ Sometimes IMAP needs to be enabled in the web frontend. Consult your email provi android:layout_width="wrap_content" android:layout_height="48dp" android:gravity="center" - android:text="Advanced" + android:text="@string/advanced" android:textColor="@color/blue_400" app:layout_constraintEnd_toStartOf="@+id/advanced_icon" app:layout_constraintHorizontal_chainStyle="packed" @@ -130,6 +131,7 @@ Sometimes IMAP needs to be enabled in the web frontend. Consult your email provi android:id="@+id/advanced_icon" android:layout_width="40dp" android:layout_height="40dp" + android:contentDescription="@string/icon" android:padding="8dp" android:src="@drawable/ic_menu_remove_holo_light" android:tint="@color/blue_400" @@ -144,7 +146,7 @@ Sometimes IMAP needs to be enabled in the web frontend. Consult your email provi android:layout_width="wrap_content" android:layout_height="24dp" android:gravity="center" - android:text="Inbox" + android:text="@string/RegistrationActivity_inbox" app:layout_constraintStart_toStartOf="@id/guideline_root_start" app:layout_constraintTop_toBottomOf="@id/advanced_text" /> @@ -160,7 +162,7 @@ Sometimes IMAP needs to be enabled in the web frontend. Consult your email provi android:id="@+id/imap_login_text" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="IMAP login-name" + android:hint="@string/RegistrationActivity_imap_login" android:inputType="text" /> @@ -178,7 +180,7 @@ Sometimes IMAP needs to be enabled in the web frontend. Consult your email provi android:id="@+id/imap_server_text" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="IMAP server" + android:hint="@string/RegistrationActivity_imap_server" android:inputType="number" /> @@ -196,7 +198,7 @@ Sometimes IMAP needs to be enabled in the web frontend. Consult your email provi android:id="@+id/imap_port_text" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="IMAP port" + android:hint="@string/RegistrationActivity_imap_port" android:inputType="number" /> @@ -206,7 +208,7 @@ Sometimes IMAP needs to be enabled in the web frontend. Consult your email provi style="@style/TextAppearance.AppCompat.Caption" android:layout_width="0dp" android:layout_height="wrap_content" - android:text="IMAP Security" + android:text="@string/RegistrationActivity_imap_security" app:layout_constraintEnd_toEndOf="@id/guideline_root_end" app:layout_constraintStart_toStartOf="@id/guideline_root_start" app:layout_constraintTop_toBottomOf="@id/imap_port" /> @@ -231,7 +233,7 @@ Sometimes IMAP needs to be enabled in the web frontend. Consult your email provi android:layout_width="wrap_content" android:layout_height="24dp" android:gravity="center" - android:text="Outbox" + android:text="@string/RegistrationActivity_outbox" app:layout_constraintStart_toStartOf="@id/guideline_root_start" app:layout_constraintTop_toBottomOf="@id/outbox_view_spacer_top" /> @@ -247,7 +249,7 @@ Sometimes IMAP needs to be enabled in the web frontend. Consult your email provi android:id="@+id/smtp_login_text" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="SMTP login-name" + android:hint="@string/RegistrationActivity_smtp_login" android:inputType="textPassword" /> @@ -265,7 +267,7 @@ Sometimes IMAP needs to be enabled in the web frontend. Consult your email provi android:id="@+id/smtp_password_text" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="SMTP Password" + android:hint="@string/RegistrationActivity_smtp_password" android:inputType="textPassword" /> @@ -283,7 +285,7 @@ Sometimes IMAP needs to be enabled in the web frontend. Consult your email provi android:id="@+id/smtp_server_text" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="SMTP server" + android:hint="@string/RegistrationActivity_smtp_server" android:inputType="text" /> @@ -301,7 +303,7 @@ Sometimes IMAP needs to be enabled in the web frontend. Consult your email provi android:id="@+id/smtp_port_text" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="SMTP port" + android:hint="@string/RegistrationActivity_smtp_port" android:inputType="number" /> @@ -311,7 +313,7 @@ Sometimes IMAP needs to be enabled in the web frontend. Consult your email provi style="@style/TextAppearance.AppCompat.Caption" android:layout_width="0dp" android:layout_height="wrap_content" - android:text="SMTP Security" + android:text="@string/RegistrationActivity_smtp_security" app:layout_constraintEnd_toEndOf="@id/guideline_root_end" app:layout_constraintStart_toStartOf="@id/guideline_root_start" app:layout_constraintTop_toBottomOf="@id/smtp_port" /> diff --git a/res/values/strings.xml b/res/values/strings.xml index 7f63926c8..c0a1d4cec 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1370,20 +1370,47 @@ About - - Delta Chat - The messenger with the broadest audience in the world. Free and independent. - Independent - There is no Delta Chat server. The app only uses your mail server. - Fast - Push messages in seconds.
Rapid interface.
- Powerful - Unlimited chats, images, videos, audio messages and more. Multi-client capable. - Free - Delta Chat is free forever.
Open-source. No ads. No subscription. No vendor lock-in.
- Encrypted - Encrypted with all common algorithms. Messages stay on your servers. - Trustworthy - Delta Chat is safe for business use, compatible and standards-based. + Delta Chat + The messenger with the broadest audience in the world. Free and independent. + Independent + There is no Delta Chat server. The app only uses your mail server. + Fast + Push messages in seconds.
Rapid interface.
+ Powerful + Unlimited chats, images, videos, audio messages and more. Multi-client capable. + Free + Delta Chat is free forever.
Open-source. No ads. No subscription. No vendor lock-in.
+ Encrypted + Encrypted with all common algorithms. Messages stay on your servers. + Trustworthy + Delta Chat is safe for business use, compatible and standards-based. + + Login to Delta Chat + For known email providers additional settings are setup automatically. Sometimes IMAP needs to be enabled in the web frontend. Consult your email provider or friends for help. + Inbox + IMAP login-name + IMAP server + IMAP port + IMAP Security + Outbox + SMTP login-name + SMTP Password + SMTP server + SMTP port + SMTP Security + GMail information + For GMail Accounts you need to create an App-Password if you have 2FA enabled. If this setting is not available, you need to enable Less Secure Apps. + Please enter a valid email address + Please enter a valid server / IP address + Please enter a valid port (1–65535) + Delta Chat needs access to your contacts and media in order to connect with friends and send files + Please enter a valid email address and a password + + + Email address + Password + Advanced + icon + Loading … diff --git a/src/org/thoughtcrime/securesms/RegistrationActivity.java b/src/org/thoughtcrime/securesms/RegistrationActivity.java index 8c94c6fc5..69e78ef6e 100644 --- a/src/org/thoughtcrime/securesms/RegistrationActivity.java +++ b/src/org/thoughtcrime/securesms/RegistrationActivity.java @@ -19,6 +19,7 @@ import android.widget.Toast; import com.dd.CircularProgressButton; import org.thoughtcrime.securesms.permissions.Permissions; +import org.thoughtcrime.securesms.util.Dialogs; /** * The register account activity. Prompts ths user for their registration information @@ -46,7 +47,8 @@ public class RegistrationActivity extends BaseActionBarActivity { private Group advancedGroup; private ImageView advancedIcon; private ProgressDialog progressDialog; - private TextView subHeaderText; + private boolean gmailDialogShown; + @Override public void onCreate(Bundle bundle) { @@ -67,7 +69,6 @@ public class RegistrationActivity extends BaseActionBarActivity { passwordInput = findViewById(R.id.password_text); advancedGroup = findViewById(R.id.advanced_group); advancedIcon = findViewById(R.id.advanced_icon); - subHeaderText = findViewById(R.id.sub_header); CircularProgressButton loginButton = findViewById(R.id.register_button); TextView advancedTextView = findViewById(R.id.advanced_text); TextInputEditText imapServerInput = findViewById(R.id.imap_server_text); @@ -104,15 +105,14 @@ public class RegistrationActivity extends BaseActionBarActivity { } private void verifyEmail(TextInputEditText view) { - String error = "Please enter a valid email address"; + String error = getString(R.string.RegistrationActivity_error_mail); String email = view.getText().toString(); if (!matchesEmailPattern(email)) { view.setError(error); } - if (!TextUtils.isEmpty(email) && isGmail(email)) { - subHeaderText.setText("For GMail Accounts you need to create an App-Password if you have 2FA enabled. If this setting is not available, you need to enable Less Secure Apps"); - } else { - subHeaderText.setText("For known email providers additional settings are setup automatically. Sometimes IMAP needs to be enabled in the web frontend. Consult your email provider or friends for help."); + if (!TextUtils.isEmpty(email) && isGmail(email) && !gmailDialogShown) { + gmailDialogShown = true; + Dialogs.showInfoDialog(this, getString(R.string.RegistrationActivity_dialog_gmail_title), getString(R.string.RegistrationActivity_dialog_gmail_text)); } } @@ -121,11 +121,11 @@ public class RegistrationActivity extends BaseActionBarActivity { } private boolean isGmail(String email) { - return email != null && (email.contains("@gmail.") || email.contains("@googlemail.")); + return email != null && (email.toLowerCase().contains("@gmail.") || email.toLowerCase().contains("@googlemail.")); } private void verifyServer(TextInputEditText view) { - String error = "Please enter a valid server / IP address"; + String error = getString(R.string.RegistrationActivity_error_server); String server = view.getText().toString(); if (!TextUtils.isEmpty(server) && !Patterns.DOMAIN_NAME.matcher(server).matches() && !Patterns.IP_ADDRESS.matcher(server).matches() @@ -135,7 +135,7 @@ public class RegistrationActivity extends BaseActionBarActivity { } private void verifyPort(TextInputEditText view) { - String error = "Please enter a valid port (1-65535)"; + String error = getString(R.string.RegistrationActivity_error_port); String portString = view.getText().toString(); if (!portString.isEmpty()) { try { @@ -166,14 +166,14 @@ public class RegistrationActivity extends BaseActionBarActivity { .request(Manifest.permission.WRITE_CONTACTS, Manifest.permission.READ_CONTACTS, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE) .ifNecessary() - .withRationaleDialog("Delta Chat needs access to your contacts and media in order to connect with friends and send files", + .withRationaleDialog(getString(R.string.RegistrationActivity_dialog_permission_text), R.drawable.ic_contacts_white_48dp, R.drawable.ic_folder_white_48dp) .execute(); } private void onLogin() { if (!verifyRequiredFields()) { - Toast.makeText(this, "Please enter a valid email address and a password", Toast.LENGTH_LONG).show(); + Toast.makeText(this, R.string.RegistrationActivity_error_required_fields, Toast.LENGTH_LONG).show(); return; } setupConfig(); @@ -184,13 +184,11 @@ public class RegistrationActivity extends BaseActionBarActivity { } progressDialog = new ProgressDialog(this); - progressDialog.setMessage("Loading ..."); + progressDialog.setMessage(getString(R.string.loading)); progressDialog.setCanceledOnTouchOutside(false); progressDialog.setCancelable(false); - progressDialog.setButton(DialogInterface.BUTTON_NEGATIVE, "Cancel", (dialog, which) -> stopLoginProcess()); + progressDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getString(android.R.string.cancel), (dialog, which) -> stopLoginProcess()); progressDialog.show(); - - // TODO start configuration process via bindings } private boolean verifyRequiredFields() { diff --git a/src/org/thoughtcrime/securesms/WelcomeActivity.java b/src/org/thoughtcrime/securesms/WelcomeActivity.java index adc407f3f..51ab0d27a 100644 --- a/src/org/thoughtcrime/securesms/WelcomeActivity.java +++ b/src/org/thoughtcrime/securesms/WelcomeActivity.java @@ -34,9 +34,9 @@ public class WelcomeActivity extends BaseActionBarActivity { private int icons[] = new int[]{R.drawable.intro1, R.drawable.intro2, R.drawable.intro3, R.drawable.intro4, R.drawable.intro5, R.drawable.intro6, R.drawable.intro7}; - private int titles[] = new int[]{R.string.Intro1Headline, R.string.Intro2Headline, R.string.Intro3Headline, R.string.Intro4Headline, R.string.Intro5Headline, R.string.Intro6Headline, R.string.Intro7Headline}; + private int titles[] = new int[]{R.string.WelcomeActivity_intro1_headline, R.string.WelcomeActivity_intro2_headline, R.string.WelcomeActivity_intro3_headline, R.string.WelcomeActivity_intro4_headline, R.string.WelcomeActivity_intro5_headline, R.string.WelcomeActivity_intro6_headline, R.string.WelcomeActivity_intro7_headline}; - private int messages[] = new int[]{R.string.Intro1Message, R.string.Intro2Message, R.string.Intro3Message, R.string.Intro4Message, R.string.Intro5Message, R.string.Intro6Message, R.string.Intro7Message}; + private int messages[] = new int[]{R.string.WelcomeActivity_intro1_message, R.string.WelcomeActivity_intro2_message, R.string.WelcomeActivity_intro3_message, R.string.WelcomeActivity_intro4_message, R.string.WelcomeActivity_intro5_message, R.string.WelcomeActivity_intro6_message, R.string.WelcomeActivity_intro7_message}; WelcomePagerAdapter(Context context) { this.context = context;