Skip to content

Commit

Permalink
Create setters for loginText and logoutText to make LoginButton more …
Browse files Browse the repository at this point in the history
…customizable (#543)

Summary:
I've found myself in situations where I have to take login/logout texts from an external source. Even though Facebook provides a lot of translations in project resources and also allow us to set these texts via xml attributes, I haven't found a solution for setting these texts programmatically.
Pull Request resolved: #543

Reviewed By: codytwinton

Differential Revision: D14408595

Pulled By: jingping2015

fbshipit-source-id: c640f0cb7f1c7fe2add8e8f2c0df775d9eefd44a
  • Loading branch information
ferglezt authored and facebook-github-bot committed Mar 12, 2019
1 parent f495c83 commit e4e6000
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,16 @@ public LoginButton(Context context, AttributeSet attrs, int defStyle) {
AnalyticsEvents.EVENT_LOGIN_BUTTON_DID_TAP);
}

public void setLoginText(String loginText) {
this.loginText = loginText;
setButtonText();
}

public void setLogoutText(String logoutText) {
this.logoutText = logoutText;
setButtonText();
}

/**
* Sets the default audience to use when the user logs in.
* This value is only useful when specifying publish permissions for the native
Expand Down

0 comments on commit e4e6000

Please sign in to comment.