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


Java PublishRelay类代码示例

本文整理汇总了Java中com.jakewharton.rxrelay.PublishRelay的典型用法代码示例。如果您正苦于以下问题:Java PublishRelay类的具体用法?Java PublishRelay怎么用?Java PublishRelay使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: SearchResultPresenter

import com.jakewharton.rxrelay.PublishRelay; //导入依赖的package包/类
public SearchResultPresenter(SearchView view, SearchAnalytics analytics,
    SearchNavigator navigator, CrashReport crashReport, Scheduler viewScheduler,
    SearchManager searchManager, PublishRelay<SearchAdResult> onAdClickRelay,
    PublishRelay<SearchAppResult> onItemViewClickRelay,
    PublishRelay<Pair<SearchAppResult, android.view.View>> onOpenPopupMenuClickRelay,
    boolean isMultiStoreSearch, String defaultStoreName, String defaultThemeName) {
  this.view = view;
  this.analytics = analytics;
  this.navigator = navigator;
  this.crashReport = crashReport;
  this.viewScheduler = viewScheduler;
  this.searchManager = searchManager;
  this.onAdClickRelay = onAdClickRelay;
  this.onItemViewClickRelay = onItemViewClickRelay;
  this.onOpenPopupMenuClickRelay = onOpenPopupMenuClickRelay;
  this.isMultiStoreSearch = isMultiStoreSearch;
  this.defaultStoreName = defaultStoreName;
  this.defaultThemeName = defaultThemeName;
}
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:20,代码来源:SearchResultPresenter.java

示例2: AccountNavigator

import com.jakewharton.rxrelay.PublishRelay; //导入依赖的package包/类
public AccountNavigator(FragmentNavigator fragmentNavigator, AptoideAccountManager accountManager,
    ActivityNavigator activityNavigator, LoginManager facebookLoginManager,
    CallbackManager callbackManager, GoogleApiClient client,
    PublishRelay<FacebookLoginResult> facebookLoginSubject, String defaultStore,
    String defaultTheme, String recoverPasswordUrl) {
  this.fragmentNavigator = fragmentNavigator;
  this.accountManager = accountManager;
  this.activityNavigator = activityNavigator;
  this.facebookLoginManager = facebookLoginManager;
  this.callbackManager = callbackManager;
  this.client = client;
  this.facebookLoginSubject = facebookLoginSubject;
  this.defaultStore = defaultStore;
  this.defaultTheme = defaultTheme;
  this.recoverPasswordUrl = recoverPasswordUrl;
}
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:17,代码来源:AccountNavigator.java

示例3: setupThemeSelector

import com.jakewharton.rxrelay.PublishRelay; //导入依赖的package包/类
public void setupThemeSelector() {

    themeSelectorView.setLayoutManager(
        new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false));
    PublishRelay<StoreTheme> storeThemePublishRelay = PublishRelay.create();
    themeSelectorAdapter =
        new ThemeSelectorViewAdapter(storeThemePublishRelay, StoreTheme.getThemesFromVersion(8));
    themeSelectorView.setAdapter(themeSelectorAdapter);

    themeSelectorAdapter.storeThemeSelection()
        .doOnNext(storeTheme -> currentModel.setStoreTheme(storeTheme))
        .compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
        .subscribe();

    themeSelectorView.addItemDecoration(new DividerItemDecoration(getContext(), 8,
        DividerItemDecoration.LEFT | DividerItemDecoration.RIGHT));

    themeSelectorAdapter.selectTheme(currentModel.getStoreTheme());
  }
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:20,代码来源:ManageStoreFragment.java

示例4: onCreate

import com.jakewharton.rxrelay.PublishRelay; //导入依赖的package包/类
@Override public void onCreate(@Nullable Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  final AptoideApplication application =
      (AptoideApplication) getContext().getApplicationContext();
  installedRepository = RepositoryFactory.getInstalledRepository(getContext());
  cancelClick = PublishRelay.create();
  postClick = PublishRelay.create();
  loginAction = PublishRelay.create();
  openUploaderButton = PublishRelay.create();
  SharedPreferences sharedPreferences =
      ((AptoideApplication) getContext().getApplicationContext()).getDefaultSharedPreferences();
  TokenInvalidator tokenInvalidator =
      ((AptoideApplication) getContext().getApplicationContext()).getTokenInvalidator();
  BodyInterceptor<BaseBody> bodyInterceptor =
      ((AptoideApplication) getContext().getApplicationContext()).getAccountSettingsBodyInterceptorPoolV7();
  OkHttpClient okHttpClient =
      ((AptoideApplication) getContext().getApplicationContext()).getDefaultClient();
  Converter.Factory converterFactory = WebService.getDefaultConverter();

  analytics = new PostAnalytics(Analytics.getInstance(),
      AppEventsLogger.newLogger(getContext().getApplicationContext()), bodyInterceptor,
      okHttpClient, converterFactory, tokenInvalidator, BuildConfig.APPLICATION_ID,
      sharedPreferences, application.getNavigationTracker());
  handleAnalytics();
  setHasOptionsMenu(true);
}
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:27,代码来源:PostFragment.java

示例5: MitmRelay

import com.jakewharton.rxrelay.PublishRelay; //导入依赖的package包/类
private MitmRelay() {
	mRelayRequest = PublishRelay.<RequestEnvelope>create().toSerialized();
	mRelayResponse = PublishRelay.<ResponseEnvelope>create().toSerialized();

	mEnvelope = Observable
		.fromEmitter(emitter -> mRelayRequest.asObservable().subscribe(emitter::onNext), Emitter.BackpressureMode.BUFFER)
		.cast(RequestEnvelope.class)
		.flatMap(request -> Observable
			.fromEmitter(emitter -> mRelayResponse.asObservable().subscribe(emitter::onNext), Emitter.BackpressureMode.BUFFER)
			.cast(ResponseEnvelope.class)
			.filter(response -> Objects.equals(request.getRequestId(), response.getRequestId()))
			.map(response -> MitmEnvelope.create(request, response))
		)
		.share();
}
 
开发者ID:igoticecream,项目名称:Snorlax,代码行数:16,代码来源:MitmRelay.java

示例6: TemperatureSensor

import com.jakewharton.rxrelay.PublishRelay; //导入依赖的package包/类
private TemperatureSensor() {
    mConnectionRelay = BehaviorRelay.create();
    mEventCountRelay = BehaviorRelay.create();
    mEventRelay = PublishRelay.create();

    // Pre-load the Behaviour relays
    mConnectionRelay.call(ConnectionState.DISCONNECTED);
    mEventCountRelay.call(0);

    mHandler.postDelayed(mRunnable, 1000);
}
 
开发者ID:sureshjoshi,项目名称:rxandroid-examples,代码行数:12,代码来源:TemperatureSensor.java

示例7: AptoideAccountManager

import com.jakewharton.rxrelay.PublishRelay; //导入依赖的package包/类
private AptoideAccountManager(CredentialsValidator credentialsValidator,
    AccountPersistence accountPersistence, AccountService accountService,
    PublishRelay<Account> accountRelay, SignUpAdapterRegistry adapterRegistry) {
  this.credentialsValidator = credentialsValidator;
  this.accountPersistence = accountPersistence;
  this.accountService = accountService;
  this.accountRelay = accountRelay;
  this.adapterRegistry = adapterRegistry;
}
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:10,代码来源:AptoideAccountManager.java

示例8: build

import com.jakewharton.rxrelay.PublishRelay; //导入依赖的package包/类
public AptoideAccountManager build() {

      if (accountPersistence == null) {
        throw new IllegalArgumentException("AccountDataPersist is mandatory.");
      }

      if (accountService == null) {
        throw new IllegalArgumentException("AccountManagerService is mandatory.");
      }

      if (credentialsValidator == null) {
        credentialsValidator = new CredentialsValidator();
      }

      if (accountRelay == null) {
        accountRelay = PublishRelay.create();
      }

      final SignUpAdapterRegistry adapterRegistry =
          new SignUpAdapterRegistry(adapters, accountService);

      adapterRegistry.register(APTOIDE_SIGN_UP_TYPE,
          new AptoideSignUpAdapter(credentialsValidator));

      return new AptoideAccountManager(credentialsValidator, accountPersistence, accountService,
          accountRelay, adapterRegistry);
    }
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:28,代码来源:AptoideAccountManager.java

示例9: before

import com.jakewharton.rxrelay.PublishRelay; //导入依赖的package包/类
@Before public void before() {
  credentialsValidatorMock = mock(CredentialsValidator.class);
  dataPersistMock = mock(AccountPersistence.class);
  serviceMock = mock(AccountService.class);
  accountRelayMock = mock(PublishRelay.class);
  accountManager =
      new AptoideAccountManager.Builder().setCredentialsValidator(credentialsValidatorMock)
          .setAccountPersistence(dataPersistMock)
          .setAccountService(serviceMock)
          .setAccountRelay(accountRelayMock)
          .build();
}
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:13,代码来源:AptoideAccountManagerTest.java

示例10: build

import com.jakewharton.rxrelay.PublishRelay; //导入依赖的package包/类
public RxAlertDialog build() {
  final AlertDialog dialog = builder.create();
  final CancelEvent cancelEvent = new CancelEvent(PublishRelay.create());
  final DismissEvent dismissEvent = new DismissEvent(PublishRelay.create());
  dialog.setOnCancelListener(cancelEvent);
  dialog.setOnDismissListener(dismissEvent);
  return new RxAlertDialog(dialog, view, positiveClick, negativeClick, cancelEvent,
      dismissEvent);
}
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:10,代码来源:RxAlertDialog.java

示例11: onCreate

import com.jakewharton.rxrelay.PublishRelay; //导入依赖的package包/类
@Override public void onCreate(@Nullable Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  errorMapper = new AccountErrorMapper(getContext(), new ErrorsMapper());
  accountManager =
      ((AptoideApplication) getContext().getApplicationContext()).getAccountManager();
  requestCode = getArguments().getInt(FragmentNavigator.REQUEST_CODE_EXTRA);
  backButtonPress = PublishRelay.create();
}
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:9,代码来源:NotLoggedInShareFragment.java

示例12: ShareAppHelper

import com.jakewharton.rxrelay.PublishRelay; //导入依赖的package包/类
public ShareAppHelper(InstalledRepository installedRepository,
    AptoideAccountManager accountManager, AccountNavigator accountNavigator, Activity activity,
    SpotAndShareAnalytics spotAndShareAnalytics, TimelineAnalytics timelineAnalytics,
    PublishRelay installAppRelay, SharedPreferences sharedPreferences,
    boolean createStoreUserPrivacyEnabled) {
  this.installedRepository = installedRepository;
  this.accountManager = accountManager;
  this.accountNavigator = accountNavigator;
  this.activity = activity;
  this.spotAndShareAnalytics = spotAndShareAnalytics;
  this.timelineAnalytics = timelineAnalytics;
  this.sharedPreferences = sharedPreferences;
  this.installAppRelay = installAppRelay;
  this.createStoreUserPrivacyEnabled = createStoreUserPrivacyEnabled;
}
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:16,代码来源:ShareAppHelper.java

示例13: showInstallSnackbar

import com.jakewharton.rxrelay.PublishRelay; //导入依赖的package包/类
private void showInstallSnackbar(PublishRelay installAppRelay) {
  ShowMessage.asSnack(activity, R.string.appview_message_install_before_share_spotandshare,
      R.string.appview_button_install_before_share_spotandshare, new View.OnClickListener() {
        @Override public void onClick(View v) {
          installAppRelay.call(null);
        }
      }, Snackbar.LENGTH_INDEFINITE);
}
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:9,代码来源:ShareAppHelper.java

示例14: getRootInstallationRetryHandler

import com.jakewharton.rxrelay.PublishRelay; //导入依赖的package包/类
public RootInstallationRetryHandler getRootInstallationRetryHandler() {
  if (rootInstallationRetryHandler == null) {

    Intent retryActionIntent = new Intent(this, RootInstallNotificationEventReceiver.class);
    retryActionIntent.setAction(RootInstallNotificationEventReceiver.ROOT_INSTALL_RETRY_ACTION);
    PendingIntent retryPendingIntent =
        PendingIntent.getBroadcast(this, 2, retryActionIntent, PendingIntent.FLAG_UPDATE_CURRENT);

    NotificationCompat.Action action =
        new NotificationCompat.Action(R.drawable.ic_refresh_black_24dp,
            getString(R.string.generalscreen_short_root_install_timeout_error_action),
            retryPendingIntent);

    PendingIntent deleteAction = PendingIntent.getBroadcast(this, 3, retryActionIntent.setAction(
        RootInstallNotificationEventReceiver.ROOT_INSTALL_DISMISS_ACTION),
        PendingIntent.FLAG_UPDATE_CURRENT);

    int notificationId = 230498;
    rootInstallationRetryHandler =
        new RootInstallationRetryHandler(notificationId, getSystemNotificationShower(),
            getInstallManager(InstallerFactory.ROLLBACK), PublishRelay.create(), 0, this,
            new RootInstallErrorNotificationFactory(notificationId,
                BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher), action,
                deleteAction));
  }
  return rootInstallationRetryHandler;
}
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:28,代码来源:AptoideApplication.java

示例15: SearchResultViewHolder

import com.jakewharton.rxrelay.PublishRelay; //导入依赖的package包/类
public SearchResultViewHolder(View itemView, PublishRelay<SearchAppResult> onItemViewClick,
    PublishRelay<Pair<SearchAppResult, android.view.View>> onOpenPopupMenuClick) {
  super(itemView);
  this.onItemViewClick = onItemViewClick;
  this.onOpenPopupMenuClick = onOpenPopupMenuClick;
  bindViews(itemView);
}
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:8,代码来源:SearchResultViewHolder.java


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