Search in sources :

Example 1 with ActionBarProvider

use of com.bluelinelabs.conductor.demo.ActionBarProvider in project Conductor by bluelinelabs.

the class RxLifecycle2Controller method onAttach.

@Override
protected void onAttach(@NonNull View view) {
    super.onAttach(view);
    Log.i(TAG, "onAttach() called");
    (((ActionBarProvider) getActivity()).getSupportActionBar()).setTitle("RxLifecycle2 Demo");
    Observable.interval(1, TimeUnit.SECONDS).doOnDispose(new Action() {

        @Override
        public void run() {
            Log.i(TAG, "Disposing from onAttach()");
        }
    }).compose(this.<Long>bindUntilEvent(ControllerEvent.DETACH)).subscribe(new Consumer<Long>() {

        @Override
        public void accept(Long num) {
            Log.i(TAG, "Started in onAttach(), running until onDetach(): " + num);
        }
    });
}
Also used : Action(io.reactivex.functions.Action) ActionBarProvider(com.bluelinelabs.conductor.demo.ActionBarProvider)

Example 2 with ActionBarProvider

use of com.bluelinelabs.conductor.demo.ActionBarProvider in project Conductor by bluelinelabs.

the class RxLifecycleController method onAttach.

@Override
protected void onAttach(@NonNull View view) {
    super.onAttach(view);
    Log.i(TAG, "onAttach() called");
    (((ActionBarProvider) getActivity()).getSupportActionBar()).setTitle("RxLifecycle Demo");
    Observable.interval(1, TimeUnit.SECONDS).doOnUnsubscribe(new Action0() {

        @Override
        public void call() {
            Log.i(TAG, "Unsubscribing from onAttach()");
        }
    }).compose(this.<Long>bindUntilEvent(ControllerEvent.DETACH)).subscribe(new Action1<Long>() {

        @Override
        public void call(Long num) {
            Log.i(TAG, "Started in onAttach(), running until onDetach(): " + num);
        }
    });
}
Also used : Action0(rx.functions.Action0) ActionBarProvider(com.bluelinelabs.conductor.demo.ActionBarProvider)

Example 3 with ActionBarProvider

use of com.bluelinelabs.conductor.demo.ActionBarProvider in project Conductor by bluelinelabs.

the class AutodisposeController method onAttach.

@Override
protected void onAttach(@NonNull View view) {
    super.onAttach(view);
    Log.i(TAG, "onAttach() called");
    (((ActionBarProvider) getActivity()).getSupportActionBar()).setTitle("Autodispose Demo");
    Observable.interval(1, TimeUnit.SECONDS).doOnDispose(new Action() {

        @Override
        public void run() {
            Log.i(TAG, "Disposing from onAttach()");
        }
    }).to(new ObservableScoper<Long>(scopeProvider)).subscribe(new Consumer<Long>() {

        @Override
        public void accept(Long num) {
            Log.i(TAG, "Started in onAttach(), running until onDetach(): " + num);
        }
    });
}
Also used : Action(io.reactivex.functions.Action) ActionBarProvider(com.bluelinelabs.conductor.demo.ActionBarProvider) ObservableScoper(com.uber.autodispose.ObservableScoper)

Aggregations

ActionBarProvider (com.bluelinelabs.conductor.demo.ActionBarProvider)3 Action (io.reactivex.functions.Action)2 ObservableScoper (com.uber.autodispose.ObservableScoper)1 Action0 (rx.functions.Action0)1