Fix observeOn() invocation order.

It should be called before lift() so that the operator can observe it on the main thread.
This change also adds some test for other bindXx() variants to get better coverage.
Refactoring OperatorViewDetachedFromWindowFirst

1. Renaming to OnSubscribeViewDetachedFromWindowFirst.java
2. Adding tests to assert the desired behaviour
3. Refactoring to avoid the "instantiate and forget" approach
within OnSubscribe.call(..)

Signed-off-by: David Marques <dpsmarques@gmail.com>
Making OnSubscribeViewDetachedFromWindowFirst.java package protected

Moving OnSubscribeViewDetachedFromWindowFirstTest.java to the right
package so the test can access the target class.

Signed-off-by: David Marques <dpsmarques@gmail.com>
Making style fixes and removing usage of junit.* classes.

Signed-off-by: David Marques <dpsmarques@gmail.com>
Added LifecycleEvent enum

Can be used for all the major Activity and Fragment events.
Added OperatorSubscribeUntil and tests

The issue with takeUntil() is that it calls onComplete() in the parent; that
is not exactly the behavior we want, so this should take its place.
Added LifecycleObserver and tests

- Added bindUntilLifecycleEvent(), which automatically unsubscribes when a
  particular LifecycleEvent is emitted by a lifecycle.

- Added bindActivityLifecycle() and bindFragmentLifecycle(), which figure out
  when you want to bind a subscription until.
fixup! Added OperatorSubscribeUntil and tests
fixup! Added LifecycleObserver and tests
fixup! Added OperatorSubscribeUntil and tests
Rename OnSubscribe subclasses to OnSubscribeXx

This aligns RxJava convention.
Merge pull request #67 from omo/observeon-first

Fix observeOn() invocation order.
Merge pull request #77 from omo/onsubscribe

Rename OnSubscribe subclasses to OnSubscribeXx
fixup! Added LifecycleObserver and tests
Implementing an OnSubscribe that emits a Cursor as it moves to next.

This commit removes CursorIterableAdapter.java and implements the
Cursor navigation and safe closing in one place.

The option to use doOnTerminate(..) will not work as well to close
the Cursor since downstream operators while emiting errors would
not pass through the operator closing the Cursor.

Signed-off-by: David Marques <dpsmarques@gmail.com>
Merge pull request #76 from dpsm/feature/cursor

Adding support to create self closing Observables from Cursors
Merge pull request #70 from dpsm/0.x

Refactoring OperatorViewDetachedFromWindowFirst
Merge pull request #75 from dlew/dlew/lifecycle-observable

Added LifecycleObservable binds