Added error message-shows and mail_successful/mail_failed to the error messages.

This commit is contained in:
Niels Zwemmer
2017-06-28 11:13:39 +02:00
parent 16c3b727fc
commit 3aab463143
3 changed files with 5 additions and 4 deletions

View File

@@ -146,7 +146,7 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
try {
photoFile = createImageFile();
} catch (IOException ex) {
Toast.makeText(getActivity(), getString(R.string.image_save_error), Toast.LENGTH_LONG);
Toast.makeText(getActivity(), getString(R.string.image_save_error), Toast.LENGTH_LONG).show();
}
if (photoFile != null) {
Uri photoURI = FileProvider.getUriForFile(getActivity(),
@@ -213,8 +213,8 @@ public class ProfileFragment extends Fragment implements View.OnClickListener {
@Override
public void onComplete(@NonNull Task<Void> task) {
Toast.makeText(getActivity(), task.isSuccessful()
? "An e-mail was sent, please follow its instructions."
: "An error occurred, please check internet connection.",
? getString(R.string.mail_successful)
: getString(R.string.mail_failed),
Toast.LENGTH_SHORT).show();
}
});

View File

@@ -31,4 +31,5 @@
<string name="update_profile_pic_error">Het updaten van de profielfoto is mislukt. Controleer uw internetverbinding.</string>
<string name="upload_profile_pic">Profielfoto aan het uploaden…</string>
<string name="niet_slecht">"\"Niet slecht.\"s "</string>
<string name="mail_success">An e-mail was sent, please follow its instructions.</string>
</resources>

View File

@@ -29,5 +29,5 @@
<string name="mail_failed">An error occurred. Please check internet connection.</string>
<string name="image_save_error">Saving image to storage failed. Please make sure there is space available on the device.</string>
<string name="update_profile_pic_error">Updating the profile picture failed. Please check network connection.</string>
<string name="upload_profile_pic">Uploading profile picture...</string>
<string name="upload_profile_pic">Uploading profile picture</string>
</resources>