Skip to content
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

Dialog util #28

Merged
merged 4 commits into from Feb 1, 2016
Merged

Dialog util #28

merged 4 commits into from Feb 1, 2016

Conversation

btkelly
Copy link
Owner

@btkelly btkelly commented Feb 1, 2016

  • Added dialog util that can be used to easily show dialogs related to the bootstrap check.
  • Added a simple logging class that still needs the LogLevel connected and set from the Gandalf installer.
  • Added the ability to set the package name from the Gandalf installer

@pr-bot
Copy link
Collaborator

pr-bot commented Feb 1, 2016

PMD Reporter Violations:

Violation: UseUtilityClass
Help: http://pmd.sourceforge.net/snapshot/pmd-java/rules/java/design.html#UseUtilityClass
Class: io.github.btkelly.gandalf.utils.LoggerUtil.java - Line: 23
All methods are static. Consider using a utility class instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.

Checkstyle Reporter Violations:

Violation: com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck
Class: io.github.btkelly.gandalf.Gandalf.java - Line: 66
Line is longer than 150 characters (found 155).

Violation: com.puppycrawl.tools.checkstyle.checks.design.HideUtilityClassConstructorCheck
Class: io.github.btkelly.gandalf.utils.LoggerUtil.java - Line: 23
Utility classes should not have a public or default constructor.

@pr-bot
Copy link
Collaborator

pr-bot commented Feb 1, 2016

Congrats! No 💩 code found, this PR is safe to merge.

@stkent stkent self-assigned this Feb 1, 2016
@stkent
Copy link
Collaborator

stkent commented Feb 1, 2016

Does this PR aim to completely resolve #6?

protected void onStop() {
super.onStop();
MockWebServerUtil.setMockBootstrapRes(this, R.raw.no_action_bootstrap);
System.exit(0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's going on here? What's the effect of this call?

Copy link
Owner Author

Choose a reason for hiding this comment

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

This is to fix the issue where you are stuck with the force update call as you are always blocked when trying to get into the app. This allows you to see each scenario once and on restart it will revert back to no action where you can again select which one to simulate.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, smart! Might be worth throwing a comment in here with that^ explanation.

@btkelly
Copy link
Owner Author

btkelly commented Feb 1, 2016

I would say yes, but as you can see in the code I changed it a bit from my original requirement of it being dumb. Seemed like a better interaction to have it save the user responses and react to clicks.

@@ -65,7 +67,7 @@ public void run() {
MockResponse mockResponse = new MockResponse();
mockResponse.setResponseCode(200);
mockResponse.setBody(mockBootstrapJsonBody);
mockResponse.setBodyDelay(4, TimeUnit.SECONDS);
mockResponse.setBodyDelay(2, TimeUnit.SECONDS);
Copy link
Collaborator

Choose a reason for hiding this comment

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

What factors influence a good choice for this number?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Nothing really, I just wanted to show that what could be done like a progress spinner while the call is loading. 4 seemed too long while I was testing, got sick of waiting.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, makes sense!

@pr-bot
Copy link
Collaborator

pr-bot commented Feb 1, 2016

Congrats! No 💩 code found, this PR is safe to merge.

@stkent
Copy link
Collaborator

stkent commented Feb 1, 2016

Approved

Approved with PullApprove

jsibbold added a commit that referenced this pull request Feb 1, 2016
@jsibbold jsibbold merged commit 65ccf0d into master Feb 1, 2016
@btkelly btkelly deleted the dialog-util branch February 10, 2016 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants