Skip to content

Complete rewrite/refactor of email sign in flow #418

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 15 commits into from
Dec 6, 2016
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
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
public class AuthUiActivity extends AppCompatActivity {
private static final String UNCHANGED_CONFIG_VALUE = "CHANGE-ME";
private static final String GOOGLE_TOS_URL = "https://www.google.com/policies/terms/";
private static final String FIREBASE_TOS_URL = "https://www.firebase.com/terms/terms-of-service.html";
private static final String FIREBASE_TOS_URL = "https://firebase.google.com/terms/";
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed this was using the old Firebase.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, good catch :-)

private static final int RC_SIGN_IN = 100;

@BindView(R.id.default_theme)
Expand Down
3 changes: 2 additions & 1 deletion auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ android {

dependencies {
compile "com.android.support:design:$support_library_version"
compile "com.android.support:customtabs:$support_library_version"

compile "com.google.firebase:firebase-auth:$firebase_version"
compile "com.google.android.gms:play-services-auth:$firebase_version"

Expand All @@ -46,7 +48,6 @@ dependencies {

// The following libraries are needed to prevent incompatibilities with the facebook
// library when updating com.android.support libraries:
compile "com.android.support:customtabs:$support_library_version"
compile "com.android.support:cardview-v7:$support_library_version"


Expand Down
12 changes: 0 additions & 12 deletions auth/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@
android:exported="false"
android:theme="@style/Theme.AppCompat.NoActionBar"/>

<activity
android:name=".ui.email.EmailHintContainerActivity"
android:label="@string/default_toolbar_title"
android:exported="false"
android:theme="@style/Theme.AppCompat.NoActionBar"/>

<activity
android:name=".ui.email.RecoverPasswordActivity"
android:label="@string/title_recover_password_activity"
Expand All @@ -43,12 +37,6 @@
android:exported="false"
android:theme="@style/FirebaseUI"/>

<activity
android:name=".ui.email.SignInNoPasswordActivity"
android:label="@string/title_sign_in_no_password_activity"
android:exported="false"
android:theme="@style/FirebaseUI"/>

<activity
android:name=".ui.email.SignInActivity"
android:label="@string/title_sign_in_activity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ public ActivityHelper(AppCompatBase activity, Intent intent) {
mActivity = activity;
}

public void configureTheme() {
mActivity.setTheme(getFlowParams().themeId);
}

public void startActivityForResult(Intent intent, int requestCode) {
mActivity.startActivityForResult(intent, requestCode);
}
Expand Down
6 changes: 1 addition & 5 deletions auth/src/main/java/com/firebase/ui/auth/ui/BaseHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,14 @@

public class BaseHelper {
protected Context mContext;
protected ProgressDialog mProgressDialog;
private final FlowParameters mFlowParams;
private ProgressDialog mProgressDialog;

public BaseHelper(Context context, FlowParameters parameters) {
mContext = context;
mFlowParams = parameters;
}

public void configureTheme() {
mContext.setTheme(mFlowParams.themeId);
}

public FlowParameters getFlowParams() {
return mFlowParams;
}
Expand Down
17 changes: 12 additions & 5 deletions auth/src/main/java/com/firebase/ui/auth/ui/FragmentHelper.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.firebase.ui.auth.ui;

import android.app.ProgressDialog;
import android.content.Intent;
import android.content.IntentSender;
import android.os.Bundle;
Expand All @@ -9,7 +10,7 @@ public class FragmentHelper extends BaseHelper {
private Fragment mFragment;

public FragmentHelper(Fragment fragment) {
super(fragment.getContext(), (FlowParameters) fragment.getArguments()
super(fragment.getContext().getApplicationContext(), (FlowParameters) fragment.getArguments()
.getParcelable(ExtraConstants.EXTRA_FLOW_PARAMS));
mFragment = fragment;
}
Expand All @@ -18,14 +19,20 @@ public void finish(int resultCode, Intent intent) {
finishActivity(mFragment.getActivity(), resultCode, intent);
}

public static Bundle getFlowParamsBundle(FlowParameters params) {
Bundle bundle = new Bundle();
bundle.putParcelable(ExtraConstants.EXTRA_FLOW_PARAMS, params);
return bundle;
@Override
public void showLoadingDialog(String message) {
dismissDialog();
mProgressDialog = ProgressDialog.show(mFragment.getContext(), "", message, true);
}

public void startIntentSenderForResult(IntentSender sender, int requestCode)
throws IntentSender.SendIntentException {
mFragment.startIntentSenderForResult(sender, requestCode, null, 0, 0, 0, null);
}

public static Bundle getFlowParamsBundle(FlowParameters params) {
Bundle bundle = new Bundle();
bundle.putParcelable(ExtraConstants.EXTRA_FLOW_PARAMS, params);
return bundle;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public void onSuccess(AuthResult authResult) {
});
}
})
.addOnFailureListener(new OnFailureListener() {
.addOnFailureListener(this, new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
mActivityHelper.dismissDialog();
Expand Down

This file was deleted.

This file was deleted.

Loading