• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Preference类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: AppDetailPresenter

import com.f2prateek.rx.preferences.Preference; //导入依赖的package包/类
@Inject public AppDetailPresenter(AppService appService,
    IntentFactory intentFactory,
    @HasSeenEditPermissionsTutorial Preference<Boolean> hasSeenEditPermissionsTutorial,
    @DisplayAllPermissions Preference<Boolean> displayAllPermissions,
    AnalyseUsedPermissions analyseUsedPermissions,
    FetchLibrariesForAppWithPermissions fetchLibrariesForAppWithPermissions,
    AppAnalyticsService appAnalyticsService,
    DeviceFeatures deviceFeatures) {
  this.appService = appService;
  this.intentFactory = intentFactory;
  this.hasSeenEditPermissionsTutorial = hasSeenEditPermissionsTutorial;
  this.displayAllPermissions = displayAllPermissions;
  this.analyseUsedPermissions = analyseUsedPermissions;
  this.fetchLibrariesForAppWithPermissions = fetchLibrariesForAppWithPermissions;
  this.appAnalyticsService = appAnalyticsService;
  this.deviceFeatures = deviceFeatures;
}
 
开发者ID:philipphager,项目名称:disclosure-android-app,代码行数:18,代码来源:AppDetailPresenter.java


示例2: testRxSharePreference

import com.f2prateek.rx.preferences.Preference; //导入依赖的package包/类
public void testRxSharePreference() {
    Preference<String> name = profile.name();
    assertNotNull(name);
    assertEquals("No Name", name.get());
    Preference<Boolean> gender = profile.gender();

    remove("gender");

    assertNotNull(gender);
    gender.set(true);
    sleep(2000);
    assertTrue(gender.get());
    assertTrue(sp().getBoolean("gender", false));

    gender.delete();
    sleep(2000);
    assertNull(gender.get());
}
 
开发者ID:soarcn,项目名称:Favor,代码行数:19,代码来源:ApplicationTest.java


示例3: changeSyncId

import com.f2prateek.rx.preferences.Preference; //导入依赖的package包/类
private void changeSyncId(Preference<String> syncIdPreference,
    Preference<Boolean> isGroupSchedulePreference) {
  Boolean b = isGroupSchedulePreference.get();
  if (b != null && b) {
    List<StudentGroup> groups = mStorIOSQLite.get()
        .listOfObjects(StudentGroup.class)
        .withQuery(Query.builder()
            .table(StudentGroupEntry.TABLE_NAME)
            .where(StudentGroupEntry.COL_NAME + " = ?")
            .whereArgs(syncIdPreference.get())
            .build())
        .prepare()
        .executeAsBlocking();
    if (groups.size() == 1) {
      syncIdPreference.set(String.valueOf(groups.get(0).id));
    }
  }
}
 
开发者ID:drymarev,项目名称:rxbsuir,代码行数:19,代码来源:ReplaceSyncIdService.java


示例4: AppManagerPresenter

import com.f2prateek.rx.preferences.Preference; //导入依赖的package包/类
@Inject public AppManagerPresenter(AppService appService,
    @AppListSortBy Preference<SortBy> sortBy,
    AppAnalyticsService appAnalyticsService,
    StringProvider stringProvider) {
  this.appService = appService;
  this.sortBy = sortBy;
  this.appAnalyticsService = appAnalyticsService;
  this.stringProvider = stringProvider;
}
 
开发者ID:philipphager,项目名称:disclosure-android-app,代码行数:10,代码来源:AppManagerPresenter.java


示例5: LibraryCategoryPresenter

import com.f2prateek.rx.preferences.Preference; //导入依赖的package包/类
@Inject
public LibraryCategoryPresenter(@OnlyShowUsedLibraries Preference<Boolean> onlyShowUsedLibraries,
    ApiSyncer apiSyncer,
    AppService appService,
    AnalyseUsedLibraries analyseUsedLibraries) {
  this.onlyShowUsedLibraries = onlyShowUsedLibraries;
  this.apiSyncer = apiSyncer;
  this.appService = appService;
  this.analyseUsedLibraries = analyseUsedLibraries;
}
 
开发者ID:philipphager,项目名称:disclosure-android-app,代码行数:11,代码来源:LibraryCategoryPresenter.java


示例6: provideBehavior

import com.f2prateek.rx.preferences.Preference; //导入依赖的package包/类
@Provides @Singleton NetworkBehavior provideBehavior(@NetworkDelay Preference<Long> networkDelay,
    @NetworkFailurePercent Preference<Integer> networkFailurePercent,
    @NetworkVariancePercent Preference<Integer> networkVariancePercent) {
  NetworkBehavior behavior = NetworkBehavior.create();
  behavior.setDelay(networkDelay.get(), MILLISECONDS);
  behavior.setFailurePercent(networkFailurePercent.get());
  behavior.setVariancePercent(networkVariancePercent.get());
  return behavior;
}
 
开发者ID:rogues-dev,项目名称:superglue,代码行数:10,代码来源:DebugApiModule.java


示例7: provideOkHttpClient

import com.f2prateek.rx.preferences.Preference; //导入依赖的package包/类
@Provides @Singleton OkHttpClient provideOkHttpClient(Application app,
    Preference<InetSocketAddress> networkProxyAddress) {
  return DataModule.createOkHttpClient(app)
      .sslSocketFactory(createBadSslSocketFactory())
      .proxy(InetSocketAddressPreferenceAdapter.createProxy(networkProxyAddress.get()))
      .build();
}
 
开发者ID:rogues-dev,项目名称:superglue,代码行数:8,代码来源:DebugDataModule.java


示例8: ProxyAdapter

import com.f2prateek.rx.preferences.Preference; //导入依赖的package包/类
ProxyAdapter(Context context, Preference<InetSocketAddress> proxyAddress) {
  super(context);
  if (proxyAddress == null) {
    throw new IllegalStateException("proxy == null");
  }
  this.proxyAddress = proxyAddress;
}
 
开发者ID:rogues-dev,项目名称:superglue,代码行数:8,代码来源:ProxyAdapter.java


示例9: DebugViewContainer

import com.f2prateek.rx.preferences.Preference; //导入依赖的package包/类
@Inject public DebugViewContainer(LumberYard lumberYard,
    IntentManager intentManager,
    @SeenDebugDrawer Preference<Boolean> seenDebugDrawer,
    @PixelGridEnabled Preference<Boolean> pixelGridEnabled,
    @PixelRatioEnabled Preference<Boolean> pixelRatioEnabled,
    @ScalpelEnabled Preference<Boolean> scalpelEnabled,
    @ScalpelWireframeEnabled Preference<Boolean> scalpelWireframeEnabled) {
  this.lumberYard = lumberYard;
  this.intentManager = intentManager;
  this.seenDebugDrawer = seenDebugDrawer;
  this.pixelGridEnabled = pixelGridEnabled;
  this.pixelRatioEnabled = pixelRatioEnabled;
  this.scalpelEnabled = scalpelEnabled;
  this.scalpelWireframeEnabled = scalpelWireframeEnabled;
}
 
开发者ID:rogues-dev,项目名称:superglue,代码行数:16,代码来源:DebugViewContainer.java


示例10: LoginPresenter

import com.f2prateek.rx.preferences.Preference; //导入依赖的package包/类
@Inject public LoginPresenter(LoginContract.View loginView,
    ZoomEyeApiService api,
    ErrorBodyHandler errorHandler,
    @AccessToken Preference<String> tokenPreference) {

  this.loginView = loginView;
  this.api = api;
  this.errorHandler = errorHandler;
  this.tokenPreference = tokenPreference;
}
 
开发者ID:donglua,项目名称:ZoomEyeAndroid,代码行数:11,代码来源:LoginPresenter.java


示例11: OauthManager

import com.f2prateek.rx.preferences.Preference; //导入依赖的package包/类
@Inject public OauthManager(IntentFactory intentFactory, OkHttpClient client, Gson gson,
    @AccessToken Preference<String> accessToken) {
  this.intentFactory = intentFactory;
  this.client = client;
  this.gson = gson;
  this.accessToken = accessToken;
}
 
开发者ID:donglua,项目名称:GitHubClient,代码行数:8,代码来源:OauthManager.java


示例12: check_update1

import com.f2prateek.rx.preferences.Preference; //导入依赖的package包/类
/**
 * 同步SharedPreferences
 */
private void check_update1() {
    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
    RxSharedPreferences rxPreferences = RxSharedPreferences.create(preferences);
    Preference<Boolean> xxFunction = rxPreferences.getBoolean("xxFunction", false);

    checkBox1.setChecked(xxFunction.get());

    RxCompoundButton.checkedChanges(checkBox1)
            .subscribe(xxFunction.asAction());
}
 
开发者ID:cowthan,项目名称:AyoSunny,代码行数:14,代码来源:CheckBoxUpdateFragment.java


示例13: parseResponseType

import com.f2prateek.rx.preferences.Preference; //导入依赖的package包/类
private ResponseType parseResponseType() {
        Type returnType = method.getGenericReturnType();
        Type[] parameterTypes = method.getGenericParameterTypes();

        if (parameterTypes.length > 1) {
            throw methodError("%s method has more than one parameter", method.getName());
        }
        Type typeToCheck = null;

        if (parameterTypes.length > 0) {
            typeToCheck = parameterTypes[0];
        }

        boolean hasReturnType = returnType != void.class;

        if (typeToCheck != null && hasReturnType) {
            Log.w(TAG, String.format("Setter method %s should not have return value", method.getName()));
            hasReturnType = false;
            returnType = void.class;
        }

        if (hasReturnType) {
            Class rawReturnType = Types.getRawType(returnType);
//            if (parameterTypes.length > 0) {
//                throw methodError("getter method %s should not have parameter", method.getName());
//            }

            if (HAS_RX_JAVA) {
                if (rawReturnType == Preference.class) {

                    returnType = Types.getSupertype(returnType, rawReturnType, Preference.class);
                    responseObjectType = getParameterUpperBound((ParameterizedType) returnType);
                    return ResponseType.OBSERVABLE;
                }
            }
            responseObjectType = returnType;
        }
        FavorType = (hasReturnType ? returnType : typeToCheck);
        return hasReturnType ? ResponseType.OBJECT : ResponseType.VOID;
    }
 
开发者ID:soarcn,项目名称:Favor,代码行数:41,代码来源:MethodInfo.java


示例14: getRemoteViews

import com.f2prateek.rx.preferences.Preference; //导入依赖的package包/类
/**
 * Gets remote views.
 *
 * @param context the context
 * @param id the id
 * @return the remote views
 */
@Nullable public static RemoteViews getRemoteViews(Context context, int id,
    Preference.Adapter<SyncIdItem> adapter) {
  SyncIdItem item = PreferenceHelper.getSyncIdItemPreference(context, id, adapter);
  if (item == null) {
    return null;
  }

  boolean isNightModeEnabled = PreferenceHelper.isNightModeEnabled(context, id);
  boolean isToday = PreferenceHelper.getIsTodayPreference(context, id);
  boolean isCollapsed = PreferenceHelper.getIsWidgetCollapsedPreference(context, id);
  SubgroupFilter subgroupFilter = PreferenceHelper.getSubgroupFilterPreference(context, id);

  RemoteViews remoteViews =
      new RemoteViews(context.getPackageName(), R.layout.appwidget_schedule);

  remoteViews.setInt(R.id.icon, "setVisibility", isCollapsed ? View.GONE : View.VISIBLE);

  setupRemoteViews(context, id, isToday, isNightModeEnabled, remoteViews);

  setupSubtitle(item, subgroupFilter, remoteViews);

  setupOpenApp(context, remoteViews, isCollapsed ? R.id.title_subtitle : R.id.icon);

  setupItemPendingIntentTemplate(context, id, remoteViews);

  setupArrow(context, id, isToday, remoteViews);

  return remoteViews;
}
 
开发者ID:drymarev,项目名称:rxbsuir,代码行数:37,代码来源:AppWidgetScheduleProvider.java


示例15: AppWidgetScheduleFactory

import com.f2prateek.rx.preferences.Preference; //导入依赖的package包/类
public AppWidgetScheduleFactory(Context context, Intent intent, StorIOSQLite storIOSQLite,
    Preference.Adapter<SyncIdItem> adapter) {
  mAppWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,
      AppWidgetManager.INVALID_APPWIDGET_ID);
  mContext = context;
  mIsToday = intent.getBooleanExtra(AppWidgetScheduleProvider.EXTRA_IS_TODAY, true);
  mStorIOSQLite = storIOSQLite;
  mSyncIdItem = PreferenceHelper.getSyncIdItemPreference(context, mAppWidgetId, adapter);
  mAreCirclesColored = PreferenceHelper.getAreCirclesColoredPreference(context, mAppWidgetId);
  mIsDarkTheme = PreferenceHelper.isNightModeEnabled(context, mAppWidgetId);
  mSubgroupFilter = PreferenceHelper.getSubgroupFilterPreference(context, mAppWidgetId);
  mIsCollapsed = PreferenceHelper.getIsWidgetCollapsedPreference(mContext, mAppWidgetId);
}
 
开发者ID:drymarev,项目名称:rxbsuir,代码行数:14,代码来源:AppWidgetScheduleService.java


示例16: provideBehavior

import com.f2prateek.rx.preferences.Preference; //导入依赖的package包/类
@Provides
@ApplicationScope
NetworkBehavior provideBehavior(@NetworkDelay Preference<Long> networkDelay,
                                @NetworkFailurePercent Preference<Integer> networkFailurePercent,
                                @NetworkVariancePercent Preference<Integer> networkVariancePercent) {
    NetworkBehavior behavior = NetworkBehavior.create();
    behavior.setDelay(networkDelay.get(), MILLISECONDS);
    behavior.setFailurePercent(networkFailurePercent.get());
    behavior.setVariancePercent(networkVariancePercent.get());
    return behavior;
}
 
开发者ID:LiveTyping,项目名称:u2020-mvp,代码行数:12,代码来源:DebugApiModule.java


示例17: provideOkHttpClient

import com.f2prateek.rx.preferences.Preference; //导入依赖的package包/类
@Provides
@ApplicationScope
OkHttpClient provideOkHttpClient(Application app,
                                 Preference<InetSocketAddress> networkProxyAddress) {
    return DataModule.createOkHttpClient(app)
            .sslSocketFactory(createBadSslSocketFactory())
            .proxy(InetSocketAddressPreferenceAdapter.createProxy(networkProxyAddress.get()))
            .build();
}
 
开发者ID:LiveTyping,项目名称:u2020-mvp,代码行数:10,代码来源:DebugDataModule.java


示例18: provideIsMockMode

import com.f2prateek.rx.preferences.Preference; //导入依赖的package包/类
@Provides
@ApplicationScope
@IsMockMode
boolean provideIsMockMode(@ApiEndpoint Preference<String> endpoint,
                          @IsInstrumentationTest boolean isInstrumentationTest) {
    // Running in an instrumentation forces mock mode.
    return isInstrumentationTest || ApiEndpoints.isMockMode(endpoint.get());
}
 
开发者ID:LiveTyping,项目名称:u2020-mvp,代码行数:9,代码来源:DebugDataModule.java


示例19: ProxyAdapter

import com.f2prateek.rx.preferences.Preference; //导入依赖的package包/类
ProxyAdapter(Context context, Preference<InetSocketAddress> proxyAddress) {
    super(context);
    if (proxyAddress == null) {
        throw new IllegalStateException("proxy == null");
    }
    this.proxyAddress = proxyAddress;
}
 
开发者ID:LiveTyping,项目名称:u2020-mvp,代码行数:8,代码来源:ProxyAdapter.java


示例20: DebugViewContainer

import com.f2prateek.rx.preferences.Preference; //导入依赖的package包/类
@Inject
public DebugViewContainer(@SeenDebugDrawer Preference<Boolean> seenDebugDrawer,
                          @PixelGridEnabled Preference<Boolean> pixelGridEnabled,
                          @PixelRatioEnabled Preference<Boolean> pixelRatioEnabled,
                          @ScalpelEnabled Preference<Boolean> scalpelEnabled,
                          @ScalpelWireframeEnabled Preference<Boolean> scalpelWireframeEnabled) {
    this.seenDebugDrawer = seenDebugDrawer;
    this.pixelGridEnabled = pixelGridEnabled;
    this.pixelRatioEnabled = pixelRatioEnabled;
    this.scalpelEnabled = scalpelEnabled;
    this.scalpelWireframeEnabled = scalpelWireframeEnabled;
}
 
开发者ID:LiveTyping,项目名称:u2020-mvp,代码行数:13,代码来源:DebugViewContainer.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PsiModifier类代码示例发布时间:2022-05-21
下一篇:
Java ServerSessionPool类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap