Always ensure guide exists before saving step

1. Create New Guide
1. Enter some step content
1. Hit the plus to create a new step.
1. Hit "Yes" to save the current step.
1. Crash.

Now we always ensure that the guide exists before trying to save a step
and everything works itself out.
Step save dialog: Don't try to add a new step

This always caused an extra toast to be displayed which confuses the
user because the message conflicts with the dialog. A new step is added
after the step is saved by setting the flag so it was entirely
unnecessary.
Dozuki: Fix QR Code Scanner dependency

Just a simple copypasta error that resulted in Dozuki without the ZXing
library which renders the QR code scanner feature useless.
SSO login: Fix webview

I'm not sure what exactly what caused the issue, but the WebView used to
display OpenID/SSO login wasn't displaying any content.

I think it was ultimately a combination of the following:

 - Upgrading to 4.4 which uses Chrome for the default WebView client
 - Loading pages with insecure content
 - Layout width
 - Overriding the WebChromeClient
 - Not specifying a wide viewport

At any rate, this code is more consistent with the other WebView we use
for displaying Answers and no longer exhibits any of the aforementioned
problems.
Merge sso-signon--fix-webview (#206) into master

SSO login: Fix webview

I'm not sure what exactly what caused the issue, but the WebView used to
display OpenID/SSO login wasn't displaying any content.

I think it was ultimately a combination of the following:

 - Upgrading to 4.4 which uses Chrome for the default WebView client
 - Loading pages with insecure content
 - Layout width
 - Overriding the WebChromeClient
 - Not specifying a wide viewport

At any rate, this code is more consistent with the other WebView we use
for displaying Answers and no longer exhibits any of the aforementioned
problems.
Merge guide-edit--fix-missing-guide-step-add (#204) into master

Always ensure guide exists before saving step

1. Create New Guide
1. Enter some step content
1. Hit the plus to create a new step.
1. Hit "Yes" to save the current step.
1. Crash.

Now we always ensure that the guide exists before trying to save a step
and everything works itself out.
Merge dozuki--fix-qr-code-scanner-dependency (#205) into master

Dozuki: Fix QR Code Scanner dependency

Just a simple copypasta error that resulted in Dozuki without the ZXing
library which renders the QR code scanner feature useless.
IntentFilter: Fix guide view orientation crash

1. Navigate to a guide through the IntentFilterActivity (scan a QR code
   or view a guide/category/search URL).
1. Change orientation.
1. Crash

I couldn't ever fully track down the issue, but doing the above resulted
in a DeadEvent _before_ `onGuide` was eventually called. The DeadEvent
was retried when changing orientation which happens before onCreate.
This resulted in a crash because the ViewPager wasn't initialized yet.
Removing the call to `finish()` fixed the DeadEvent issue and
subsequently the orientation issue.
Merge intent-filter--fix-guide-view-orientation-crash (#208) into master

IntentFilter: Fix guide view orientation crash

1. Navigate to a guide through the IntentFilterActivity (scan a QR code
   or view a guide/category/search URL).
1. Change orientation.
1. Crash

I couldn't ever fully track down the issue, but doing the above resulted
in a DeadEvent _before_ `onGuide` was eventually called. The DeadEvent
was retried when changing orientation which happens before onCreate.
This resulted in a crash because the ViewPager wasn't initialized yet.
Removing the call to `finish()` fixed the DeadEvent issue and
subsequently the orientation issue.
Barcode scanner: Fix failing scan result parsing

1. Go to the Media Manager.
1. Add an image from the Gallery.
1. A "Failed to parse result" toast is displayed but everything works as
   expected.

This is caused by the ZXing library parsing the Activity result but
returning a null `IntentResult` because the request codes didn't match.
The app didn't crash because the parsing code is all wrapped in a
try/catch to swallow all errors because of the tricky reflection. This
fixes the bug which removes the awkward Toast.
Merge barcode-scanner--fix-result-parsing (#210) into master

Barcode scanner: Fix failing scan result parsing

1. Go to the Media Manager.
1. Add an image from the Gallery.
1. A "Failed to parse result" toast is displayed but everything works as
   expected.

This is caused by the ZXing library parsing the Activity result but
returning a null `IntentResult` because the request codes didn't match.
The app didn't crash because the parsing code is all wrapped in a
try/catch to swallow all errors because of the tricky reflection. This
fixes the bug which removes the awkward Toast.
Step edit: Fix focus-induced jumping

1. Open step edit on a step with lots of text.
1. Focus is given to the step title EditText which causes the view to
   jump down and hide the images.

The timing is especially awkward on this because everything is peachy
until ~0.5 seconds after the page is swiped over -- _then_ it jumps down
in a disorienting fashion.

Removing all focus-related attributes on the title fixed it while still
giving it the primary focus.
Merge step-edit--fix-focus-jumping (#211) into master

Step edit: Fix focus-induced jumping

1. Open step edit on a step with lots of text.
1. Focus is given to the step title EditText which causes the view to
   jump down and hide the images.

The timing is especially awkward on this because everything is peachy
until ~0.5 seconds after the page is swiped over -- _then_ it jumps down
in a disorienting fashion.

Removing all focus-related attributes on the title fixed it while still
giving it the primary focus.
Guide view: Fix restore fragment state crash

We've had several puzzling crash reports for a while:
`android.os.BadParcelableException: ClassNotFoundException when unmarshalling: android.support.v4.app.FragmentManagerState`

I finally reproduced it:

1. Enable `Settings` -> `Developer options` -> `Don't keep activities`.
1. Open guide view.
1. Click on a part or tool.
1. Hit back.
1. Swipe to other steps and back.
1. Go to 3.

In my experience it takes 2 tries to get it to crash. Turns out it's a
bug in the support library:
https://code.google.com/p/android/issues/detail?id=37484#c1

The upside is that it's an easy fix. The downside is that we have to
extend the class at `android.v4.app.FixedFragmentStatePagerAdapter` and
use that one in place of the default implementation.
Merge guide-view--fix-restore-fragment-state (#212) into master

Guide view: Fix restore fragment state crash

We've had several puzzling crash reports for a while:
`android.os.BadParcelableException: ClassNotFoundException when unmarshalling: android.support.v4.app.FragmentManagerState`

I finally reproduced it:

1. Enable `Settings` -> `Developer options` -> `Don't keep activities`.
1. Open guide view.
1. Click on a part or tool.
1. Hit back.
1. Swipe to other steps and back.
1. Go to 3.

In my experience it takes 2 tries to get it to crash. Turns out it's a
bug in the support library:
https://code.google.com/p/android/issues/detail?id=37484#c1

The upside is that it's an easy fix. The downside is that we have to
extend the class at `android.v4.app.FixedFragmentStatePagerAdapter` and
use that one in place of the default implementation.
Fix MediaFragment.getPath() NPE

From crash report in the PlayStore. ContentResolver.query() can return
`null` so we must guard against that.
Bump version codes for 2.4.1 release
Fix flavor extension

Turns out it didn't exactly work out like it was supposed to because
minSdkVersion is a function that must be called rather than a value that
needs to be assigned. It's easy enough to just conditionally include it
in the productFlavors definitions.
Fix accustream site name check
Merge branch 'master' into offline-guides