Skip to content

Use resource prefix for library resources #796

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 16 commits into from
Jul 20, 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
2 changes: 2 additions & 0 deletions auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ android {
targetSdkVersion targetSdk
versionCode 1
versionName "1.0"

resourcePrefix "fui_"
}

buildTypes {
Expand Down
6 changes: 6 additions & 0 deletions auth/lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<issue id="all">
<ignore path="src/main/res/values/com_crashlytics_export_strings.xml" />
</issue>
</lint>
28 changes: 14 additions & 14 deletions auth/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,38 +32,38 @@

<activity
android:name=".ui.email.RecoverPasswordActivity"
android:label="@string/title_recover_password_activity"
android:exported="false" />
android:label="@string/fui_title_recover_password_activity"
android:exported="false"/>

<activity
android:name=".ui.email.RegisterEmailActivity"
android:label="@string/sign_in_default"
android:exported="false" />
android:label="@string/fui_sign_in_default"
android:exported="false"/>

<activity
android:name=".ui.phone.PhoneVerificationActivity"
android:label="@string/sign_in_with_phone_number"
android:exported="false"
android:windowSoftInputMode="stateAlwaysVisible" />
android:label="@string/fui_sign_in_with_phone_number"
android:windowSoftInputMode="stateAlwaysVisible"
android:exported="false"/>

<activity
android:name=".ui.accountlink.WelcomeBackIdpPrompt"
android:label="@string/title_welcome_back_idp_prompt"
android:exported="false" />
android:label="@string/fui_title_welcome_back_idp_prompt"
android:exported="false"/>

<activity
android:name=".ui.accountlink.WelcomeBackPasswordPrompt"
android:label="@string/title_welcome_back_password_prompt"
android:exported="false" />
android:label="@string/fui_title_welcome_back_password_prompt"
android:exported="false"/>

<activity
android:name=".ui.idp.AuthMethodPickerActivity"
android:label="@string/default_toolbar_title"
android:exported="false" />
android:label="@string/fui_default_toolbar_title"
android:exported="false"/>

<activity
android:name="com.facebook.FacebookActivity"
android:label="@string/app_name"
android:label="@string/fui_app_name"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
tools:ignore="MissingRegistered" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public EmailProvider(Activity activity, FlowParameters flowParameters) {

@Override
public String getName(Context context) {
return context.getString(R.string.provider_name_email);
return context.getString(R.string.fui_provider_name_email);
}

@Override
@LayoutRes
public int getButtonLayout() {
return R.layout.provider_button_email;
return R.layout.fui_provider_button_email;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ public static AuthCredential createAuthCredential(IdpResponse response) {

@Override
public String getName(Context context) {
return context.getString(R.string.idp_name_facebook);
return context.getString(R.string.fui_idp_name_facebook);
}

@Override
@LayoutRes
public int getButtonLayout() {
return R.layout.idp_button_facebook;
return R.layout.fui_idp_button_facebook;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ private GoogleSignInOptions getSignInOptions(@Nullable String email) {

@Override
public String getName(Context context) {
return context.getString(R.string.idp_name_google);
return context.getString(R.string.fui_idp_name_google);
}

@Override
@LayoutRes
public int getButtonLayout() {
return R.layout.idp_button_google;
return R.layout.fui_idp_button_google;
}

@Override
Expand Down Expand Up @@ -128,7 +128,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
Toast.makeText(
mActivity,
mActivity.getString(
R.string.signed_in_with_specific_account,
R.string.fui_signed_in_with_specific_account,
result.getSignInAccount().getEmail()),
Toast.LENGTH_SHORT).show();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ public PhoneProvider(Activity activity, FlowParameters parameters) {

@Override
public String getName(Context context) {
return context.getString(R.string.provider_name_phone);
return context.getString(R.string.fui_provider_name_phone);
}

@Override
@LayoutRes
public int getButtonLayout() {
return R.layout.provider_button_phone;
return R.layout.fui_provider_button_phone;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ private static void signOut() throws IllegalStateException {

@Override
public String getName(Context context) {
return context.getString(R.string.idp_name_twitter);
return context.getString(R.string.fui_idp_name_twitter);
}

@Override
@LayoutRes
public int getButtonLayout() {
return R.layout.idp_button_twitter;
return R.layout.fui_idp_button_twitter;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static Intent createIntent(
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.welcome_back_idp_prompt_layout);
setContentView(R.layout.fui_welcome_back_idp_prompt_layout);

IdpResponse newUserIdpResponse = IdpResponse.fromResultIntent(getIntent());
mPrevCredential = ProviderUtils.getAuthCredential(newUserIdpResponse);
Expand Down Expand Up @@ -118,14 +118,14 @@ protected void onCreate(Bundle savedInstanceState) {
findViewById(R.id.welcome_back_idp_button).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
getDialogHolder().showLoadingDialog(R.string.progress_dialog_signing_in);
getDialogHolder().showLoadingDialog(R.string.fui_progress_dialog_signing_in);
mIdpProvider.startLogin(WelcomeBackIdpPrompt.this);
}
});
}

private String getIdpPromptString(String email) {
return getString(R.string.welcome_back_idp_prompt, email, mIdpProvider.getName(this));
return getString(R.string.fui_welcome_back_idp_prompt, email, mIdpProvider.getName(this));
}

@Override
Expand Down Expand Up @@ -191,7 +191,7 @@ public void onFailure() {
}

private void finishWithError() {
Toast.makeText(this, R.string.general_error, Toast.LENGTH_LONG).show();
Toast.makeText(this, R.string.fui_general_error, Toast.LENGTH_LONG).show();
finish(ResultCodes.CANCELED, IdpResponse.getErrorCodeIntent(ErrorCodes.UNKNOWN_ERROR));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static Intent createIntent(
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.welcome_back_password_prompt_layout);
setContentView(R.layout.fui_welcome_back_password_prompt_layout);

// Show keyboard
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
Expand All @@ -93,7 +93,7 @@ protected void onCreate(Bundle savedInstanceState) {
ImeHelper.setImeOnDoneListener(mPasswordField, this);

// Create welcome back text with email bolded.
String bodyText = getString(R.string.welcome_back_password_prompt_body, mEmail);
String bodyText = getString(R.string.fui_welcome_back_password_prompt_body, mEmail);

SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(bodyText);
int emailStart = bodyText.indexOf(mEmail);
Expand Down Expand Up @@ -136,12 +136,12 @@ private void validateAndSignIn() {
private void validateAndSignIn(final String email, final String password) {
// Check for null or empty password
if (TextUtils.isEmpty(password)) {
mPasswordLayout.setError(getString(R.string.required_field));
mPasswordLayout.setError(getString(R.string.fui_required_field));
return;
} else {
mPasswordLayout.setError(null);
}
getDialogHolder().showLoadingDialog(R.string.progress_dialog_signing_in);
getDialogHolder().showLoadingDialog(R.string.fui_progress_dialog_signing_in);

final FirebaseAuth firebaseAuth = getAuthHelper().getFirebaseAuth();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static CheckEmailFragment newInstance(@NonNull FlowParameters flowParamet
public View onCreateView(LayoutInflater inflater,
@Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.check_email_layout, container, false);
View v = inflater.inflate(R.layout.fui_check_email_layout, container, false);

// Email field and validator
mEmailLayout = (TextInputLayout) v.findViewById(R.id.email_layout);
Expand Down Expand Up @@ -179,7 +179,7 @@ private void validateAndProceed() {
}

private void checkAccountExists(@NonNull final String email) {
getDialogHolder().showLoadingDialog(R.string.progress_dialog_checking_accounts);
getDialogHolder().showLoadingDialog(R.string.fui_progress_dialog_checking_accounts);

// Get name from SmartLock, if possible
String name = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public PreambleHandler(Context context, FlowParameters parameters, @StringRes in
mContext = context;
mFlowParameters = parameters;
mButtonText = buttonText;
mLinkSpan = new ForegroundColorSpan(ContextCompat.getColor(mContext, R.color.linkColor));
mLinkSpan = new ForegroundColorSpan(ContextCompat.getColor(mContext, R.color.fui_linkColor));

setupCreateAccountPreamble();
}
Expand All @@ -54,8 +54,8 @@ private void setupCreateAccountPreamble() {
mBuilder = new SpannableStringBuilder(withTargets);

replaceTarget(BTN_TARGET, mButtonText);
replaceUrlTarget(TOS_TARGET, R.string.terms_of_service, mFlowParameters.termsOfServiceUrl);
replaceUrlTarget(PP_TARGET, R.string.privacy_policy, mFlowParameters.privacyPolicyUrl);
replaceUrlTarget(TOS_TARGET, R.string.fui_terms_of_service, mFlowParameters.termsOfServiceUrl);
replaceUrlTarget(PP_TARGET, R.string.fui_privacy_policy, mFlowParameters.privacyPolicyUrl);
}

private void replaceTarget(String target, @StringRes int replacementRes) {
Expand Down Expand Up @@ -84,13 +84,13 @@ private String getPreambleStringWithTargets() {
boolean hasPp = !TextUtils.isEmpty(mFlowParameters.privacyPolicyUrl);

if (hasTos && hasPp) {
return mContext.getString(R.string.create_account_preamble_tos_and_pp,
return mContext.getString(R.string.fui_create_account_preamble_tos_and_pp,
BTN_TARGET, TOS_TARGET, PP_TARGET);
} else if (hasTos) {
return mContext.getString(R.string.create_account_preamble_tos_only,
return mContext.getString(R.string.fui_create_account_preamble_tos_only,
BTN_TARGET, TOS_TARGET);
} else if (hasPp) {
return mContext.getString(R.string.create_account_preamble_pp_only,
return mContext.getString(R.string.fui_create_account_preamble_pp_only,
BTN_TARGET, PP_TARGET);
} else {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static Intent createIntent(Context context, FlowParameters flowParams, St
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.forgot_password_layout);
setContentView(R.layout.fui_forgot_password_layout);

mEmailFieldValidator =
new EmailFieldValidator((TextInputLayout) findViewById(R.id.email_layout));
Expand Down Expand Up @@ -86,7 +86,7 @@ public void onFailure(@NonNull Exception e) {

if (e instanceof FirebaseAuthInvalidUserException) {
// No FirebaseUser exists with this email address, show error.
mEmailEditText.setError(getString(R.string.error_email_does_not_exist));
mEmailEditText.setError(getString(R.string.fui_error_email_does_not_exist));
}
}
});
Expand All @@ -96,7 +96,7 @@ public void onFailure(@NonNull Exception e) {
public void onClick(View view) {
if (view.getId() == R.id.button_done) {
if (mEmailFieldValidator.validate(mEmailEditText.getText())) {
getDialogHolder().showLoadingDialog(R.string.progress_dialog_sending);
getDialogHolder().showLoadingDialog(R.string.fui_progress_dialog_sending);
next(mEmailEditText.getText().toString());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public static void show(String email, FragmentManager manager) {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
return new AlertDialog.Builder(getContext())
.setTitle(R.string.title_confirm_recover_password)
.setMessage(getString(R.string.confirm_recovery_body,
.setTitle(R.string.fui_title_confirm_recover_password)
.setMessage(getString(R.string.fui_confirm_recovery_body,
getArguments().getString(ExtraConstants.EXTRA_EMAIL)))
.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static Intent createIntent(Context context, FlowParameters flowParams, St
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register_email);
setContentView(R.layout.fui_activity_register_email);

if (savedInstanceState != null) {
return;
Expand Down Expand Up @@ -134,12 +134,12 @@ public void onNewUser(User user) {

ft.disallowAddToBackStack().commit();
} else {
emailLayout.setError(getString(R.string.error_email_does_not_exist));
emailLayout.setError(getString(R.string.fui_error_email_does_not_exist));
}
}

private void setSlideAnimation() {
// Make the next activity slide in
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
overridePendingTransition(R.anim.fui_slide_in_right, R.anim.fui_slide_out_left);
}
}
Loading