当前位置: 首页>>代码示例>>Java>>正文


Java Subscriptions.from方法代码示例

本文整理汇总了Java中rx.subscriptions.Subscriptions.from方法的典型用法代码示例。如果您正苦于以下问题:Java Subscriptions.from方法的具体用法?Java Subscriptions.from怎么用?Java Subscriptions.from使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rx.subscriptions.Subscriptions的用法示例。


在下文中一共展示了Subscriptions.from方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: bindView

import rx.subscriptions.Subscriptions; //导入方法依赖的package包/类
private void bindView(int position, @NonNull PlenCodeUnitView view) {
    mSubscriptionMap.remove(view);
    mSubscriptionMap.remove(position);
    PlenCodeUnit unit = getItem(position);
    if (isBlankRow(unit)) {
        view.bindBlankRow();
        return;
    }

    Subscription subscription = Subscriptions.from(
            view.bind(mMotionMap.asObservable().map(m -> m.get(unit.getMotionId())),
                    Observable.just(unit.getLoopCount())),
            view.programUnit().asObservable()
                    .skipWhile(u -> !Objects.equals(u, unit))
                    .subscribe(u -> setUnit(position, u)));
    mSubscriptionMap.put(view, subscription);
    mSubscriptionMap.put(position, subscription);
}
 
开发者ID:plenprojectcompany,项目名称:plen-Scenography_Android,代码行数:19,代码来源:PlenProgramAdapter.java

示例2: onResume

import rx.subscriptions.Subscriptions; //导入方法依赖的package包/类
@Override
protected void onResume() {
    super.onResume();
    onPauseSubs = Subscriptions.from();
    // refresh if needed
    boolean needsRefreshing = !members.hasTotal();
    long updatesFromTime;
    if (needsRefreshing) {
        refresh(true);
        updatesFromTime = -1;  // if refreshing anyway, no need to observe past events
    } else {
        updatesFromTime = Math.max(pausedElapsedRealtime, savedElapsedRealtime);
    }

    // start listening to event broadcasts.
    onPauseSubs.add(memberUpdates.observable(updatesFromTime)
            // debounce so we don't show snackbar for each update emitted in succession
            .debounce(100, TimeUnit.MILLISECONDS)
            .observeOn(uiScheduler)
            .subscribe(update -> showRefreshBar()));
}
 
开发者ID:meetup,项目名称:DataSyncDemo,代码行数:22,代码来源:ViewMembers.java

示例3: doEnable

import rx.subscriptions.Subscriptions; //导入方法依赖的package包/类
@Override
protected void doEnable() {
	hudTools.show(hud);
	app.getInputManager().addRawInputListener(inputMapper.rawInputListener);

	inputSub = Subscriptions.from(
		controls.exit.value.subscribe((v) -> {
			if (!v) pm.onNext(Pages.Welcome);
		})
		, inputMapper.last.subscribe((v) -> spawnEvent(v))
		, controls.action1.value.subscribe((v) -> action1(v))
		, controls.action2.value.subscribe((v) -> action2(v))
		, controls.action3.value.subscribe((v) -> action3(v))
		, controls.action4.value.subscribe((v) -> action4(v))
		, controls.moveX.value.subscribe((v) -> {c4t.speedX = v * 0.5f;})
		, controls.moveZ.value.subscribe((v) -> {c4t.speedZ = v * -0.5f;})
	);
	spawnScene();
}
 
开发者ID:davidB,项目名称:jme3_skel,代码行数:20,代码来源:PageInGame.java

示例4: onBind

import rx.subscriptions.Subscriptions; //导入方法依赖的package包/类
@Override
protected Subscription onBind() {
  viewModel = viewModelHolder.get();
  commentListViewModel = CommentListViewModel.create(getContext());
  commentListViewModel.setArticleId(getArticleId());

  return Subscriptions.from(
      commentListViewModel,
      listAdapter.bind(commentListViewModel.items()),
      emptyText.bind(commentListViewModel.isEmpty(), RxActions.setVisibility()),
      progressBar.bind(commentListViewModel.isLoading(), RxActions.setVisibility()),
      authorText.bind(viewModel.authorName(), RxActions.setText()),
      authorImage.bind(viewModel.authorThumbnailUrl(), loadThumbnailAction()),
      tagList.bind(viewModel.tags())
  );
}
 
开发者ID:ogaclejapan,项目名称:Qiitanium,代码行数:17,代码来源:ArticleAboutFragment.java

示例5: bind

import rx.subscriptions.Subscriptions; //导入方法依赖的package包/类
@NonNull
public Subscription bind(@NonNull Observable<PlenProgram> program) {
    return Subscriptions.from(
            mMotionMap.bind(program
                    .map(PlenProgram::getMotionMap)
                    .filter(map -> !mMotionMap.get().map(map::equals).orElse(false))),
            mSequence.bind(program
                    .map(PlenProgram::getSequence)
                    .filter(seq -> !seq.equals(stageWithoutBlankRow()))));
}
 
开发者ID:plenprojectcompany,项目名称:plen-Scenography_Android,代码行数:11,代码来源:PlenProgramAdapter.java

示例6: bind

import rx.subscriptions.Subscriptions; //导入方法依赖的package包/类
@NonNull
public Subscription bind(@NonNull Observable<PlenMotion> motion, @NonNull Observable<Integer> loopCount) {
    setVisibility(VISIBLE);

    mLoopCountView.setText(String.valueOf(ReadOnlyProperty.create(loopCount).get()
            .orElse(getContext().getResources().getInteger(R.integer.motion_loop_default))));

    Subscription subscription = Subscriptions.from(
            mPlenMotionView.bind(motion),
            mLoopCount.bind(loopCount));
    mSubscriptions.add(subscription);

    return subscription;
}
 
开发者ID:plenprojectcompany,项目名称:plen-Scenography_Android,代码行数:15,代码来源:PlenCodeUnitView.java

示例7: bindBidirectional

import rx.subscriptions.Subscriptions; //导入方法依赖的package包/类
@NonNull
public static <T> Subscription bindBidirectional(@NonNull Property<T> p1, @NonNull Property<T> p2) {
    if (p1 == p2) {
        return Subscriptions.unsubscribed();
    }
    Subscription s1 = p1.bind(p2);
    Subscription s2 = p2.bind(p1);
    return Subscriptions.from(s1, s2);
}
 
开发者ID:plenprojectcompany,项目名称:plen-Scenography_Android,代码行数:10,代码来源:Property.java

示例8: onCreate

import rx.subscriptions.Subscriptions; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    subs = Subscriptions.from();
    savedElapsedRealtime = -1L;
    if (savedInstanceState != null) {
        savedElapsedRealtime = savedInstanceState.getLong(EXTRA_ELAPSED_REALTIME, -1L);
    }
}
 
开发者ID:meetup,项目名称:DataSyncDemo,代码行数:10,代码来源:BaseActivity.java

示例9: onConnect

import rx.subscriptions.Subscriptions; //导入方法依赖的package包/类
@Override
protected Subscription onConnect() {
    return Subscriptions.from(super.onConnect(),

        channel(SINGLE_RESTARTABLE_ID, DeliveryMethod.SINGLE, new ExampleSingleObservableFactory())
            .subscribe(RxNotification.split(
                value -> {
                    log("SINGLE: onNext " + value);
                    onNext(value);
                },
                throwable -> log("SINGLE: onError " + throwable))));
}
 
开发者ID:konmik,项目名称:satellite,代码行数:13,代码来源:SingleConnectionActivity.java

示例10: onConnect

import rx.subscriptions.Subscriptions; //导入方法依赖的package包/类
@Override
protected Subscription onConnect() {
    return Subscriptions.from(super.onConnect(),

        Observable.interval(500, 500, TimeUnit.MILLISECONDS, mainThread())
            .subscribe(ignored -> {
                StringBuilder builder = new StringBuilder();
                builder.append("connections:\n");
                for (String key : ReconnectableMap.INSTANCE.keys())
                    builder.append(key).append("\n");
                TextView report = (TextView)findViewById(R.id.stationReport);
                report.setText(builder.toString());
            }));
}
 
开发者ID:konmik,项目名称:satellite,代码行数:15,代码来源:BaseLaunchActivity.java

示例11: onConnect

import rx.subscriptions.Subscriptions; //导入方法依赖的package包/类
@Override
protected Subscription onConnect() {
    return Subscriptions.from(super.onConnect(),

        channel(REPLAY_RESTARTABLE_ID, DeliveryMethod.REPLAY, new ExampleReplayObservableFactory())
            .subscribe(RxNotification.split(
                value -> {
                    log("REPLAY: onNext " + value);
                    onNext(value);
                },
                throwable -> log("REPLAY: onError " + throwable))));
}
 
开发者ID:konmik,项目名称:satellite,代码行数:13,代码来源:ReplayConnectionActivity.java

示例12: onConnect

import rx.subscriptions.Subscriptions; //导入方法依赖的package包/类
@Override
protected Subscription onConnect() {
    return Subscriptions.from(super.onConnect(),

        channel(CHANNEL_ID, DeliveryMethod.LATEST, new ExampleCacheObservableFactory())
            .subscribe(RxNotification.split(
                value -> {
                    log("CACHE: onNext " + value);
                    onNext(value);
                },
                throwable -> log("CACHE: onError " + throwable))));
}
 
开发者ID:konmik,项目名称:satellite,代码行数:13,代码来源:CacheConnectionActivity.java

示例13: doEnable

import rx.subscriptions.Subscriptions; //导入方法依赖的package包/类
@Override
protected void doEnable() {
	prevCursorVisible = app.getInputManager().isCursorVisible();
	app.getInputManager().setCursorVisible(true);
	app.getInputManager().addRawInputListener(inputMapper.rawInputListener);
	hudTools.show(hud);

	FxPlatformExecutor.runOnFxApplication(() -> {
		HudWelcome p = hud.controller;
		p.play.onActionProperty().set((v) -> {
			app.enqueue(()-> {
				pm.onNext(Pages.InGame);
				return true;
			});
		});
		p.settings.onActionProperty().set((v) -> {
			app.enqueue(()-> {
				pm.onNext(Pages.Settings);
				return true;
			});
		});
		p.quit.onActionProperty().set((v) -> {
			app.enqueue(()->{
				app.stop();
				return true;
			});
		});
	});

	inputSub = Subscriptions.from(
		commands.exit.value.subscribe((v) -> {
			if (!v) hud.controller.quit.fire();
		})
	);
}
 
开发者ID:davidB,项目名称:jme3_skel,代码行数:36,代码来源:PageWelcome.java

示例14: onBind

import rx.subscriptions.Subscriptions; //导入方法依赖的package包/类
@Override
protected Subscription onBind() {
  return Subscriptions.from(
      viewModel,
      listAdapter.bind(viewModel.items()),
      progressBar.bind(viewModel.isLoading(), RxActions.setVisibility())
  );
}
 
开发者ID:ogaclejapan,项目名称:Qiitanium,代码行数:9,代码来源:TagListFragment.java

示例15: onBind

import rx.subscriptions.Subscriptions; //导入方法依赖的package包/类
@Override
protected Subscription onBind() {
  viewModel = viewModelHolder.get();

  return Subscriptions.from(
      viewModel,
      webView.bind(viewModel.contentHtml(), RxActions.loadDataWithBaseURL()),
      progressBar.bind(isLoading, RxActions.setVisibility())
  );
}
 
开发者ID:ogaclejapan,项目名称:Qiitanium,代码行数:11,代码来源:ArticleFragment.java


注:本文中的rx.subscriptions.Subscriptions.from方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。