GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Kill BaseHelper and friends by samtstern · Pull Request #777 · firebase/FirebaseUI-Android

Conversation

@samtstern

@samtstern samtstern commented Jun 26, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

See #776

Steps:

  1. Kill ActivityHelper and FragmentHelper, make everything a BaseHelper
  2. Help Fragments and Activities manage their own FlowParameters and ProgressDialog
  3. Separate out all factory-type responsibilities of the helpers (getFirebaseAuth(), etc) into a dedicated class for that.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

WillieCubed reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
samtstern added 5 commits June 26, 2017 14:40
@samtstern
Kill ActivityHelper, move functionality to BaseHelper
bfd2fe1
Change-Id: I07599baa47fba0c0415ebec2a37b7a8ed011e0a2
@samtstern
Move ProgressDialog responsibilities
4c1da34
Change-Id: Ie4e60c4346f5ff5cea2ea7474765c6857bd85e03
@samtstern
Kill FragmentHelper
e53b548
Change-Id: I216e2e6d605fb0b3750ddd198e954597db89c1d2
@samtstern
Kill BaseHelper
46bae95
Change-Id: Id3c6e12f3da3fde438aa6da27e9033b30233e6d0
@samtstern
Make tests pass
e553caf
Change-Id: I9d7a4545a171274d5d704d9ac9f704cbaf364238
@samtstern samtstern changed the title [WIP] Kill BaseHelper and friends Kill BaseHelper and friends Jun 27, 2017
samtstern added 2 commits June 27, 2017 09:04
@samtstern
Make findbugs pass
3f74728
Change-Id: I850923fe00efd0be31c75196e917440ca6602708
@samtstern
Remove ActivityUtils
78bc555
Change-Id: I3b126f4e08cd359f7e1910cd086176159097650b
SUPERCILEX
SUPERCILEX reviewed Jun 27, 2017
View reviewed changes

@SUPERCILEX SUPERCILEX left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

@samtstern Awesome refactor!!! 😄 Just left a few comments.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread auth/src/main/java/com/firebase/ui/auth/ui/DialogBase.java Outdated
import android.view.ContextThemeWrapper;

@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class DialogBase extends DialogFragment {

@SUPERCILEX SUPERCILEX Jun 27, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

@samtstern Could we just get rid of this class? The only dialog using it is the RecoveryEmailSentDialog and it doesn't use any of this. I also noticed that there's dead code in the RecoveryEmailSentDialog:

public static void show(String email, FlowParameters parameters, FragmentManager manager) {
    // We never use the flow params
    bundle.putParcelable(ExtraConstants.EXTRA_FLOW_PARAMS, parameters);
}

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@samtstern samtstern Jun 27, 2017

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Good catch!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread auth/src/main/java/com/firebase/ui/auth/ui/FragmentBase.java Outdated
public class FragmentBase extends Fragment {
protected FragmentHelper mHelper;

protected FlowParameters mFlowParameters;

@SUPERCILEX SUPERCILEX Jun 27, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Shouldn't the flow params be private since we have a getter to handle initialization?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread auth/src/main/java/com/firebase/ui/auth/ui/HelperActivityBase.java Outdated
public class HelperActivityBase extends AppCompatActivity {

protected ActivityHelper mActivityHelper;
protected FlowParameters mFlowParameters;

@SUPERCILEX SUPERCILEX Jun 27, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Same.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread auth/src/main/java/com/firebase/ui/auth/ui/HelperActivityBase.java Outdated

protected ActivityHelper mActivityHelper;
protected FlowParameters mFlowParameters;
protected ProgressDialogHolder mProgressDialogHolder;

@SUPERCILEX SUPERCILEX Jun 27, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

It looks like the dialog can also be private since you have a getter. Or we could remove the getter, seems easier and would be more consistent with the other code you've written.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread auth/src/main/java/com/firebase/ui/auth/ui/email/RecoveryEmailSentDialog.java Outdated
public static void show(String email, FlowParameters parameters, FragmentManager manager) {
RecoveryEmailSentDialog result = new RecoveryEmailSentDialog();
Bundle bundle = new Bundle();
bundle.putParcelable(ExtraConstants.EXTRA_FLOW_PARAMS, parameters);

@SUPERCILEX SUPERCILEX Jun 27, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Oh, just noticed you added the flow params. Yeah, lol. We should just kill DialogBase since we aren't using any of it and it's forcing us to add dead code to the RecoveryEmailSentDialog.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread auth/src/main/java/com/firebase/ui/auth/util/AuthInstances.java
return Auth.CredentialsApi;
}

public static FirebaseUser getCurrentUser(FlowParameters parameters) {

@SUPERCILEX SUPERCILEX Jun 27, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

@samtstern We should probably mark this as @Nullable.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@samtstern
Removed unused class, fix member visibility
7be3ae2
Change-Id: Ib07cea70703f6f7fdc2b47e5c9aab43f764350cf
@samtstern

samtstern commented Jun 27, 2017

Copy link
Copy Markdown
Contributor Author

@SUPERCILEX thanks for the comments! Think I fixed them all.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@SUPERCILEX

SUPERCILEX commented Jun 27, 2017

Copy link
Copy Markdown
Contributor

@samtstern LGTM! 😄

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@samtstern
samtstern merged commit b9a2fa4 into version-2.1.0-dev Jun 27, 2017
@samtstern
samtstern deleted the helper-refactor branch July 18, 2017 18:41
@WillieCubed WillieCubed mentioned this pull request Aug 14, 2017
Crashlytics reporting crash at ActivityHelper.java line 38 #657
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@SUPERCILEX SUPERCILEX SUPERCILEX left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@samtstern @SUPERCILEX
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.