Exemplo n.º 1
0
 @Provides
 @Singleton
 @ScalpelWireframeEnabled
 Preference<Boolean> provideScalpelWireframeEnabled(RxSharedPreferences preferences) {
   return preferences.getBoolean(
       "debug_scalpel_wireframe_drawer", DEFAULT_SCALPEL_WIREFRAME_ENABLED);
 }
Exemplo n.º 2
0
 @Provides
 @Singleton
 @AccessToken
 Preference<String> provideAccessToken(
     RxSharedPreferences prefs, @ApiEndpoint Preference<String> endpoint) {
   // Return an endpoint-specific preference.
   return prefs.getString("access-token-" + endpoint.get());
 }
Exemplo n.º 3
0
 private void subscribeToChanges() {
   RxSharedPreferences prefs =
       RxSharedPreferences.create(PreferenceManager.getDefaultSharedPreferences(mAppContext));
   Preference<Integer> lastPage = prefs.getInteger(Constants.PREF_LAST_PAGE);
   Observable.merge(
           mBookmarkModel.tagsObservable(),
           mBookmarkModel.bookmarksObservable(),
           lastPage.asObservable())
       .observeOn(AndroidSchedulers.mainThread())
       .subscribe(
           new Action1<Object>() {
             @Override
             public void call(Object o) {
               if (mFragment != null) {
                 requestData(false);
               } else {
                 mCachedData = null;
               }
             }
           });
 }
Exemplo n.º 4
0
 @Provides
 @Singleton
 @NetworkFailurePercent
 Preference<Integer> provideNetworkFailurePercent(RxSharedPreferences preferences) {
   return preferences.getInteger("debug_network_failure_percent", 3);
 }
Exemplo n.º 5
0
 @Provides
 @Singleton
 @NetworkDelay
 Preference<Long> provideNetworkDelay(RxSharedPreferences preferences) {
   return preferences.getLong("debug_network_delay", 2000l);
 }
Exemplo n.º 6
0
 @Provides
 @Singleton
 @ApiEndpoint
 Preference<String> provideEndpointPreference(RxSharedPreferences preferences) {
   return preferences.getString("debug_endpoint", ApiEndpoints.MOCK_MODE.url);
 }
Exemplo n.º 7
0
 @Provides
 @Singleton
 RxSharedPreferences provideRxSharedPreferences(SharedPreferences prefs) {
   return RxSharedPreferences.create(prefs);
 }
Exemplo n.º 8
0
 @Provides
 @Singleton
 @SeenDebugDrawer
 Preference<Boolean> provideSeenDebugDrawer(RxSharedPreferences preferences) {
   return preferences.getBoolean("debug_seen_debug_drawer", DEFAULT_SEEN_DEBUG_DRAWER);
 }
Exemplo n.º 9
0
 @Provides
 @Singleton
 @ScalpelEnabled
 Preference<Boolean> provideScalpelEnabled(RxSharedPreferences preferences) {
   return preferences.getBoolean("debug_scalpel_enabled", DEFAULT_SCALPEL_ENABLED);
 }
Exemplo n.º 10
0
 @Provides
 @Singleton
 @PixelGridEnabled
 Preference<Boolean> providePixelGridEnabled(RxSharedPreferences preferences) {
   return preferences.getBoolean("debug_pixel_grid_enabled", DEFAULT_PIXEL_GRID_ENABLED);
 }
Exemplo n.º 11
0
 @Provides
 @Singleton
 @PixelRatioEnabled
 Preference<Boolean> providePixelRatioEnabled(RxSharedPreferences preferences) {
   return preferences.getBoolean("debug_pixel_ratio_enabled", DEFAULT_PIXEL_RATIO_ENABLED);
 }
Exemplo n.º 12
0
 @Provides
 @Singleton
 @PicassoDebugging
 Preference<Boolean> providePicassoDebugging(RxSharedPreferences preferences) {
   return preferences.getBoolean("debug_picasso_debugging", DEFAULT_PICASSO_DEBUGGING);
 }
Exemplo n.º 13
0
 @Provides
 @Singleton
 @AnimationSpeed
 Preference<Integer> provideAnimationSpeed(RxSharedPreferences preferences) {
   return preferences.getInteger("debug_animation_speed", DEFAULT_ANIMATION_SPEED);
 }
Exemplo n.º 14
0
 @Provides
 @Singleton
 @CaptureIntents
 Preference<Boolean> provideCaptureIntentsPreference(RxSharedPreferences preferences) {
   return preferences.getBoolean("debug_capture_intents", DEFAULT_CAPTURE_INTENTS);
 }
Exemplo n.º 15
0
 @Provides
 @Singleton
 Preference<InetSocketAddress> provideNetworkProxyAddress(RxSharedPreferences preferences) {
   return preferences.getObject(
       "debug_network_proxy", InetSocketAddressPreferenceAdapter.INSTANCE);
 }
Exemplo n.º 16
0
 @Provides
 @Singleton
 @NetworkVariancePercent
 Preference<Integer> provideNetworkVariancePercent(RxSharedPreferences preferences) {
   return preferences.getInteger("debug_network_variance_percent", 40);
 }