예제 #1
0
  public void startTwoObservable(View v) {
    RetainFactory.start(
            getFragmentManager(), initReadyToUserObservable(-11, -1), null, "NEGATIVE_PRINTER")
        .subscribe(buildPrintAction());

    RetainFactory.start(
            getFragmentManager(), initReadyToUserObservable(0, 10), null, "POSITIVE_PRINTER")
        .subscribe(buildPrintAction());
  }
예제 #2
0
 private void restartObservable(int count, String tag) {
   Observable<Integer> observable = initReadyToUserObservable(count);
   RetainFactory.restart(getFragmentManager(), observable, null, tag)
       .subscribe(
           buildPrintAction(),
           new Action1<Throwable>() {
             @Override
             public void call(Throwable throwable) {}
           },
           new Action0() {
             @Override
             public void call() {}
           });
 }
예제 #3
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_main);
   mRotateExample =
       RetainFactory.create(
           getFragmentManager(),
           initReadyToUserObservable(10),
           new EmptySubscriber<Integer>() {
             @Override
             public void onNext(Integer integer) {
               printInt(integer);
             }
           },
           "ROTATION_PRINTER");
 }
예제 #4
0
 private void startObservable(int count) {
   final String tag = "RESUMABLE_PRINTER";
   Observable<Integer> observable =
       initReadyToUserObservable(count)
           .doOnError(
               new Action1<Throwable>() {
                 @Override
                 public void call(Throwable throwable) {
                   restartObservable(11, tag);
                 }
               });
   RetainFactory.start(getFragmentManager(), observable, null, tag)
       .subscribe(
           buildPrintAction(),
           new Action1<Throwable>() {
             @Override
             public void call(Throwable throwable) {}
           },
           new Action0() {
             @Override
             public void call() {}
           });
 }
예제 #5
0
 public void restartObservable(View v) {
   RetainFactory.restart(getFragmentManager(), initReadyToUserObservable(-10, 0), null)
       .subscribe(buildPrintAction());
 }
예제 #6
0
 public void simpleRun(View v) {
   RetainFactory.start(getFragmentManager(), initReadyToUserObservable(10), null)
       .subscribe(buildPrintAction());
 }