本文整理汇总了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;
}
示例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;
}
示例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());
}
示例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);
}
示例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();
}
示例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);
}
示例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;
}
示例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);
}
示例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();
}
示例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);
}
示例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();
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}