Java Code Examples for rx.android.schedulers.AndroidSchedulers#mainThread()

The following examples show how to use rx.android.schedulers.AndroidSchedulers#mainThread() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestAppModule.java    From DebugRank with Apache License 2.0 6 votes vote down vote up
@Override
IAppThreads providesAppThreads()
{
    //run everything on main thread for espresso tests
    return new IAppThreads()
    {
        @Override
        public Scheduler mainThread()
        {
            return AndroidSchedulers.mainThread();
        }

        @Override
        public Scheduler newThread()
        {
            return AndroidSchedulers.mainThread();
        }
    };
}
 
Example 2
Source File: UserSearchActivity.java    From GithubUsersSearchApp with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_user_search);
    userSearchPresenter = new UserSearchPresenter(Injection.provideUserRepo(), Schedulers.io(),
            AndroidSchedulers.mainThread());
    userSearchPresenter.attachView(this);

    toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    progressBar = (ProgressBar) findViewById(R.id.progress_bar);
    textViewErrorMessage = (TextView) findViewById(R.id.text_view_error_msg);
    recyclerViewUsers = (RecyclerView) findViewById(R.id.recycler_view_users);
    usersAdapter = new UsersAdapter(null, this);
    recyclerViewUsers.setAdapter(usersAdapter);

}
 
Example 3
Source File: FragmentModule.java    From aptoide-client-v8 with GNU General Public License v3.0 5 votes vote down vote up
@FragmentScope @Provides ListAppsMorePresenter providesListAppsMorePresenter(
    CrashReport crashReport, AppNavigator appNavigator,
    @Named("default") SharedPreferences sharedPreferences,
    ListAppsConfiguration listAppsConfiguration, ListAppsMoreManager listAppsMoreManager) {
  return new ListAppsMorePresenter((ListAppsMoreFragment) fragment,
      AndroidSchedulers.mainThread(), crashReport, appNavigator, sharedPreferences,
      listAppsConfiguration, listAppsMoreManager);
}
 
Example 4
Source File: FragmentModule.java    From aptoide-client-v8 with GNU General Public License v3.0 5 votes vote down vote up
@FragmentScope @Provides EarnAppcListPresenter provideEarnAppCoinsListPresenter(
    CrashReport crashReport, RewardAppCoinsAppsRepository rewardAppCoinsAppsRepository,
    AnalyticsManager analyticsManager, AppNavigator appNavigator,
    EarnAppcListConfiguration earnAppcListConfiguration, EarnAppcListManager earnAppcListManager,
    MoPubAdsManager moPubAdsManager, EarnAppcListAnalytics earnAppcListAnalytics) {
  return new EarnAppcListPresenter((EarnAppcListFragment) fragment,
      AndroidSchedulers.mainThread(), crashReport, rewardAppCoinsAppsRepository, analyticsManager,
      appNavigator, earnAppcListConfiguration, earnAppcListManager, new PermissionManager(),
      ((PermissionService) fragment.getContext()), moPubAdsManager, earnAppcListAnalytics);
}
 
Example 5
Source File: StoreFragment.java    From aptoide-client-v8 with GNU General Public License v3.0 5 votes vote down vote up
@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
  super.onViewCreated(view, savedInstanceState);
  if (bottomNavigationActivity != null) {
    bottomNavigationActivity.requestFocus(BOTTOM_NAVIGATION_ITEM);
  }
  final SuggestionCursorAdapter suggestionCursorAdapter =
      new SuggestionCursorAdapter(getContext());

  if (hasSearchFromStoreFragment()) {
    final Toolbar toolbar = getToolbar();
    final Observable<MenuItem> toolbarMenuItemClick = RxToolbar.itemClicks(toolbar)
        .publish()
        .autoConnect();

    appSearchSuggestionsView =
        new AppSearchSuggestionsView(this, RxView.clicks(toolbar), crashReport,
            suggestionCursorAdapter, PublishSubject.create(), toolbarMenuItemClick,
            searchAnalytics);

    final AptoideApplication application =
        (AptoideApplication) getContext().getApplicationContext();

    final SearchSuggestionsPresenter searchSuggestionsPresenter =
        new SearchSuggestionsPresenter(appSearchSuggestionsView,
            application.getSearchSuggestionManager(), AndroidSchedulers.mainThread(),
            suggestionCursorAdapter, crashReport, trendingManager, searchNavigator, false,
            searchAnalytics);

    attachPresenter(searchSuggestionsPresenter);

    handleOptionsItemSelected(toolbarMenuItemClick);
  }
}
 
Example 6
Source File: ActivityModule.java    From aptoide-client-v8 with GNU General Public License v3.0 5 votes vote down vote up
@ActivityScope @Provides WalletInstallPresenter providesWalletInstallPresenter(
    WalletInstallConfiguration configuration, WalletInstallNavigator walletInstallNavigator,
    WalletInstallManager walletInstallManager, WalletInstallAnalytics walletInstallAnalytics,
    MoPubAdsManager moPubAdsManager) {
  return new WalletInstallPresenter((WalletInstallView) view, walletInstallManager,
      walletInstallNavigator, new PermissionManager(), ((PermissionService) activity),
      AndroidSchedulers.mainThread(), Schedulers.io(), configuration, walletInstallAnalytics,
      moPubAdsManager);
}
 
Example 7
Source File: FragmentModule.java    From aptoide-client-v8 with GNU General Public License v3.0 5 votes vote down vote up
@FragmentScope @Provides ImagePickerPresenter provideImagePickerPresenter(
    AccountPermissionProvider accountPermissionProvider, PhotoFileGenerator photoFileGenerator,
    ImageValidator imageValidator, UriToPathResolver uriToPathResolver,
    ImagePickerNavigator imagePickerNavigator) {
  return new ImagePickerPresenter((ImagePickerView) fragment, CrashReport.getInstance(),
      accountPermissionProvider, photoFileGenerator, imageValidator,
      AndroidSchedulers.mainThread(), uriToPathResolver, imagePickerNavigator,
      fragment.getActivity()
          .getContentResolver(), ImageLoader.with(fragment.getContext()), Schedulers.io());
}
 
Example 8
Source File: FragmentModule.java    From aptoide-client-v8 with GNU General Public License v3.0 5 votes vote down vote up
@FragmentScope @Provides SearchResultPresenter provideSearchResultPresenter(
    SearchAnalytics searchAnalytics, SearchNavigator searchNavigator, SearchManager searchManager,
    TrendingManager trendingManager, SearchSuggestionManager searchSuggestionManager,
    BottomNavigationMapper bottomNavigationMapper) {
  return new SearchResultPresenter((SearchResultView) fragment, searchAnalytics, searchNavigator,
      CrashReport.getInstance(), AndroidSchedulers.mainThread(), searchManager, trendingManager,
      searchSuggestionManager, (AptoideBottomNavigator) fragment.getActivity(),
      bottomNavigationMapper, Schedulers.io());
}
 
Example 9
Source File: DonateDialogFragment.java    From aptoide-client-v8 with GNU General Public License v3.0 5 votes vote down vote up
@Override public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  ((MainActivity) getContext()).getActivityComponent()
      .inject(this);
  packageName = getArguments().getString(PACKAGE_NAME);
  presenter = new DonateDialogPresenter(this, walletService, new CompositeSubscription(),
      AndroidSchedulers.mainThread(), appNavigator, donationsAnalytics);
  textUpdate = true;
  sliderUpdate = true;
  handleValueInputFiltering();
}
 
Example 10
Source File: FragmentModule.java    From aptoide-client-v8 with GNU General Public License v3.0 5 votes vote down vote up
@FragmentScope @Provides ClaimPromotionDialogPresenter providesClaimPromotionDialogPresenter(
    ClaimPromotionsManager claimPromotionsManager, PromotionsAnalytics promotionsAnalytics,
    ClaimPromotionsNavigator navigator) {
  return new ClaimPromotionDialogPresenter((ClaimPromotionDialogView) fragment,
      new CompositeSubscription(), AndroidSchedulers.mainThread(), claimPromotionsManager,
      promotionsAnalytics, navigator);
}
 
Example 11
Source File: FragmentModule.java    From aptoide-client-v8 with GNU General Public License v3.0 5 votes vote down vote up
@FragmentScope @Provides MoreBundlePresenter providesGetStoreWidgetsPresenter(
    MoreBundleManager moreBundleManager, CrashReport crashReport, HomeNavigator homeNavigator,
    AdMapper adMapper, BundleEvent bundleEvent, HomeAnalytics homeAnalytics,
    ChipManager chipManager) {
  return new MoreBundlePresenter((MoreBundleView) fragment, moreBundleManager,
      AndroidSchedulers.mainThread(), crashReport, homeNavigator, adMapper, bundleEvent,
      homeAnalytics, chipManager);
}
 
Example 12
Source File: FragmentModule.java    From aptoide-client-v8 with GNU General Public License v3.0 5 votes vote down vote up
@FragmentScope @Provides AppCoinsInfoPresenter providesAppCoinsInfoPresenter(
    AppCoinsInfoNavigator appCoinsInfoNavigator, InstallManager installManager,
    CrashReport crashReport, ExternalNavigator externalNavigator) {
  return new AppCoinsInfoPresenter((AppCoinsInfoView) fragment, appCoinsInfoNavigator,
      installManager, crashReport, AppCoinsInfoNavigator.APPC_WALLET_PACKAGE_NAME,
      AndroidSchedulers.mainThread(), externalNavigator);
}
 
Example 13
Source File: FragmentModule.java    From aptoide-client-v8 with GNU General Public License v3.0 5 votes vote down vote up
@FragmentScope @Provides EditorialPresenter providesEditorialPresenter(
    EditorialManager editorialManager, CrashReport crashReport,
    EditorialAnalytics editorialAnalytics, EditorialNavigator editorialNavigator,
    UserFeedbackAnalytics userFeedbackAnalytics, MoPubAdsManager moPubAdsManager) {
  return new EditorialPresenter((EditorialView) fragment, editorialManager,
      AndroidSchedulers.mainThread(), crashReport, new PermissionManager(),
      ((PermissionService) fragment.getContext()), editorialAnalytics, editorialNavigator,
      userFeedbackAnalytics, moPubAdsManager);
}
 
Example 14
Source File: UIThread.java    From outlay with Apache License 2.0 4 votes vote down vote up
@Override
public Scheduler getScheduler() {
    return AndroidSchedulers.mainThread();
}
 
Example 15
Source File: AppModule.java    From Game-of-Thrones with Apache License 2.0 4 votes vote down vote up
@Provides
@UiThread
public Scheduler provideExecutor() {
  return AndroidSchedulers.mainThread();
}
 
Example 16
Source File: UtilsModule.java    From SampleApp with Apache License 2.0 4 votes vote down vote up
@Provides
@Singleton
@Named(ValueConstants.MAIN_THREAD)
public Scheduler getMainThread() {
    return AndroidSchedulers.mainThread();
}
 
Example 17
Source File: SchedulerProvider.java    From ESeal with Apache License 2.0 4 votes vote down vote up
@NonNull
@Override
public Scheduler ui() {
    return AndroidSchedulers.mainThread();
}
 
Example 18
Source File: FragmentModule.java    From aptoide-client-v8 with GNU General Public License v3.0 4 votes vote down vote up
@FragmentScope @Provides SendMagicLinkPresenter provideSendMagicLinkPresenter(
    AptoideAccountManager accountManager, SendMagicLinkNavigator navigator,
    AgentPersistence agentPersitence) {
  return new SendMagicLinkPresenter((MagicLinkView) fragment, accountManager, navigator,
      AndroidSchedulers.mainThread(), agentPersitence);
}
 
Example 19
Source File: AppSchedulerProvider.java    From fyber_mobile_offers with MIT License 4 votes vote down vote up
@Override
public Scheduler mainThread() {
    return AndroidSchedulers.mainThread();
}
 
Example 20
Source File: AndroidAppThreads.java    From DebugRank with Apache License 2.0 4 votes vote down vote up
@Override
public Scheduler mainThread()
{
    return AndroidSchedulers.mainThread();
}