Skip to content

Use native string formatter #475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ dependencies {
compile "com.android.support:cardview-v7:$support_library_version"

testCompile 'junit:junit:4.12'
//noinspection GradleDynamicVersion
testCompile 'org.mockito:mockito-core:2.3.+'
//noinspection NewerVersionAvailable, GradleDynamicVersion
testCompile 'org.mockito:mockito-core:2.5.+'
testCompile 'org.robolectric:robolectric:3.1.4'
// See https://github.com/robolectric/robolectric/issues/1932#issuecomment-219796474
testCompile 'org.khronos:opengl-api:gl1.1-android-2.1_r1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ public void onClick(View view) {
}

private String getIdpPromptString(String email) {
String promptStringTemplate = getResources().getString(R.string.welcome_back_idp_prompt);
return String.format(promptStringTemplate, email, mIdpProvider.getName(this));
return getResources().getString(R.string.welcome_back_idp_prompt,
email,
mIdpProvider.getName(this));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ protected void onCreate(Bundle savedInstanceState) {
mPasswordField = (EditText) findViewById(R.id.password);

// Create welcome back text with email bolded
String bodyText = getResources().getString(R.string.welcome_back_password_prompt_body);
bodyText = String.format(bodyText, mEmail);
String bodyText = getResources().getString(R.string.welcome_back_password_prompt_body, mEmail);
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(bodyText);
int emailStart = bodyText.indexOf(mEmail);
spannableStringBuilder.setSpan(new StyleSpan(Typeface.BOLD),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public class RecoveryEmailSentDialog extends BaseDialog {
public Dialog onCreateDialog(Bundle savedInstanceState) {
return new AlertDialog.Builder(getContext(), R.style.FirebaseUI_Dialog)
.setTitle(R.string.title_confirm_recover_password_activity)
.setMessage(String.format(getString(R.string.confirm_recovery_body),
getArguments().getString(ExtraConstants.EXTRA_EMAIL)))
.setMessage(getString(R.string.confirm_recovery_body,
getArguments().getString(ExtraConstants.EXTRA_EMAIL)))
.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface anInterface) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ public class PasswordFieldValidator extends BaseValidator {
public PasswordFieldValidator(TextInputLayout errorContainer, int minLength) {
super(errorContainer);
mMinLength = minLength;
String template = mErrorContainer.getResources()
.getQuantityString(R.plurals.password_length, minLength);
mErrorMessage = String.format(template, mMinLength);
mErrorMessage = mErrorContainer.getResources()
.getQuantityString(R.plurals.password_length, minLength, mMinLength);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:2.3.0-alpha2'
classpath 'com.android.tools.build:gradle:2.3.0-beta1'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'io.fabric.tools:gradle:1.+'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
Expand Down
2 changes: 1 addition & 1 deletion library/quality/quality.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ task pmd(type: Pmd) {

android {
lintOptions {
disable 'InvalidPackage'
disable 'InvalidPackage', 'RestrictedApi'
baseline file("$configDir/lint-baseline.xml")
checkAllWarnings true
warningsAsErrors true
Expand Down