Skip to content
Browse files

Make sure that the click listener gets attached to the login buttons

  • Loading branch information...
1 parent 3188f4d commit 6fc5132fb6a9dad68032a47b41c7f85908b17966 @UD4Y UD4Y committed
View
16 library/src/main/java/com/firebase/ui/auth/core/AuthProviderType.java
@@ -6,20 +6,22 @@
import java.lang.reflect.InvocationTargetException;
public enum AuthProviderType {
- GOOGLE ("google", "google.GoogleAuthProvider", R.id.google_button),
- FACEBOOK("facebook", "facebook.FacebookAuthProvider", R.id.facebook_button),
- TWITTER ("twitter", "twitter.TwitterAuthProvider", R.id.twitter_button),
- PASSWORD("password", "password.PasswordAuthProvider", R.id.password_section);
+ GOOGLE ("google", "google.GoogleAuthProvider", R.id.google_button, R.id.google_button),
+ FACEBOOK("facebook", "facebook.FacebookAuthProvider", R.id.facebook_button, R.id.facebook_button),
+ TWITTER ("twitter", "twitter.TwitterAuthProvider", R.id.twitter_button, R.id.twitter_button),
+ PASSWORD("password", "password.PasswordAuthProvider", R.id.password_section, R.id.password_button);
private final static String AUTH_PACKAGE = "com.firebase.ui.auth.";
private final String mName;
private final String mProviderName;
private final int mViewId;
+ private final int mButtonId;
- AuthProviderType(String name, String providerName, int viewId) {
+ AuthProviderType(String name, String providerName, int viewId, int buttonId) {
this.mName = name;
this.mProviderName = providerName;
this.mViewId = viewId;
+ this.mButtonId = buttonId;
}
public String getName() {
@@ -29,6 +31,10 @@ public int getViewId() {
return mViewId;
}
+ public int getButtonId() {
+ return mButtonId;
+ }
+
public FirebaseAuthProvider createProvider(Context context, Firebase ref, TokenAuthHandler handler) {
try {
Class<? extends FirebaseAuthProvider> clazz = (Class<? extends FirebaseAuthProvider>) Class.forName(AUTH_PACKAGE+mProviderName);
View
2 library/src/main/java/com/firebase/ui/auth/core/FirebaseLoginDialog.java
@@ -64,7 +64,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
for (AuthProviderType providerType : AuthProviderType.values()) {
if (mEnabledProvidersByType.keySet().contains(providerType)) {
- showLoginOption(mEnabledProvidersByType.get(providerType), providerType.getViewId());
+ showLoginOption(mEnabledProvidersByType.get(providerType), providerType.getButtonId());
}
else {
mView.findViewById(providerType.getViewId()).setVisibility(View.GONE);

0 comments on commit 6fc5132

Please sign in to comment.
Something went wrong with that request. Please try again.