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


Java Config.hasExpertsDirectoryExpired方法代码示例

本文整理汇总了Java中com.google.samples.apps.iosched.Config.hasExpertsDirectoryExpired方法的典型用法代码示例。如果您正苦于以下问题:Java Config.hasExpertsDirectoryExpired方法的具体用法?Java Config.hasExpertsDirectoryExpired怎么用?Java Config.hasExpertsDirectoryExpired使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.samples.apps.iosched.Config的用法示例。


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

示例1: onResume

import com.google.samples.apps.iosched.Config; //导入方法依赖的package包/类
@Override
protected void onResume() {
    super.onResume();
    invalidateOptionsMenu();
    if (Config.hasExpertsDirectoryExpired()) {
        startActivity(new Intent(this, BrowseSessionsActivity.class));
        finish();
    }

    Fragment frag = getFragmentManager().findFragmentById(R.id.experts_fragment);
    if (frag != null) {
        // configure expert fragment's top clearance to take our overlaid controls (Action Bar
        // and spinner box) into account.
        int actionBarSize = UIUtils.calculateActionBarSize(this);
        int filterBarSize = getResources().getDimensionPixelSize(R.dimen.filterbar_height);
        mDrawShadowFrameLayout.setShadowTopOffset(actionBarSize + filterBarSize);
        ((ExpertsDirectoryFragment) frag).setContentTopClearance(actionBarSize + filterBarSize
                + getResources().getDimensionPixelSize(R.dimen.explore_grid_padding));
    }
}
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:21,代码来源:ExpertsDirectoryActivity.java

示例2: populateNavDrawer

import com.google.samples.apps.iosched.Config; //导入方法依赖的package包/类
/** Populates the navigation drawer with the appropriate items. */
    private void populateNavDrawer() {
        boolean attendeeAtVenue = PrefUtils.isAttendeeAtVenue(this);
        mNavDrawerItems.clear();

        // decide which items will appear in the nav drawer
        if (AccountUtils.hasActiveAccount(this)) {
            // Only logged-in users can save sessions, so if there is no active account,
            // there is no My Schedule
            mNavDrawerItems.add(NAVDRAWER_ITEM_MY_SCHEDULE);
        } else {
            // If no active account, show Sign In
            mNavDrawerItems.add(NAVDRAWER_ITEM_SIGN_IN);
        }

        // Explore is always shown
        mNavDrawerItems.add(NAVDRAWER_ITEM_EXPLORE);

        // If the attendee is on-site, show Map on the nav drawer
//        mNavDrawerItems.add(NAVDRAWER_ITEM_SEPARATOR);

        // If attendee is on-site, show the People I've Met item
//        if (attendeeAtVenue) {
//            mNavDrawerItems.add(NAVDRAWER_ITEM_PEOPLE_IVE_MET);
//        }

        // If the experts directory hasn't expired, show it
        if (!Config.hasExpertsDirectoryExpired()) {
            mNavDrawerItems.add(NAVDRAWER_ITEM_EXPERTS_DIRECTORY);
        }

        // Other items that are always in the nav drawer irrespective of whether the
        // attendee is on-site or remote:
        mNavDrawerItems.add(NAVDRAWER_ITEM_SOCIAL);
//        mNavDrawerItems.add(NAVDRAWER_ITEM_VIDEO_LIBRARY);
        mNavDrawerItems.add(NAVDRAWER_ITEM_SEPARATOR_SPECIAL);
        mNavDrawerItems.add(NAVDRAWER_ITEM_SETTINGS);

        createNavDrawerItems();
    }
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:41,代码来源:BaseActivity.java

示例3: clearExpertsIfNecessary

import com.google.samples.apps.iosched.Config; //导入方法依赖的package包/类
private boolean clearExpertsIfNecessary() {
    if (Config.hasExpertsDirectoryExpired()) {
        return 0 < mContext.getContentResolver()
                .delete(ScheduleContract.Experts.CONTENT_URI, null, null);
    }
    return false;
}
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:8,代码来源:SyncHelper.java

示例4: process

import com.google.samples.apps.iosched.Config; //导入方法依赖的package包/类
@Override
public void process(JsonElement element) {
    if (Config.hasExpertsDirectoryExpired()) {
        return;
    }
    for (Expert expert : new Gson().fromJson(element, Expert[].class)) {
        mExperts.put(expert.id, expert);
    }
}
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:10,代码来源:ExpertsHandler.java

示例5: makeContentProviderOperations

import com.google.samples.apps.iosched.Config; //导入方法依赖的package包/类
@Override
public void makeContentProviderOperations(ArrayList<ContentProviderOperation> list) {
    if (Config.hasExpertsDirectoryExpired()) {
        return;
    }
    Uri uri = ScheduleContract.addCallerIsSyncAdapterParameter(
            ScheduleContract.Experts.CONTENT_URI);
    HashMap<String, String> expertsHashcodes = loadExpertHashcodes();
    HashSet<String> expertsToKeep = new HashSet<String>();
    boolean isIncrementalUpdate = expertsHashcodes != null && expertsHashcodes.size() > 0;

    if (isIncrementalUpdate) {
        LOGD(TAG, "Doing incremental update for experts.");
    } else {
        LOGD(TAG, "Doing FULL (non incremental) update for experts.");
        list.add(ContentProviderOperation.newDelete(uri).build());
    }

    int updatedExperts = 0;
    for (Expert expert : mExperts.values()) {
        String hashCode = expert.getImportHashCode();
        expertsToKeep.add(expert.id);

        // Add the expert, if necessary
        if (!isIncrementalUpdate || !expertsHashcodes.containsKey(expert.id) ||
                !expertsHashcodes.get(expert.id).equals(hashCode)) {
            ++updatedExperts;
            boolean isNew = !isIncrementalUpdate || !expertsHashcodes.containsKey(expert.id);
            buildExpert(isNew, expert, list);
        }
    }

    int deletedExperts = 0;
    if (isIncrementalUpdate) {
        for (String expertId : expertsHashcodes.keySet()) {
            if (!expertsToKeep.contains(expertId)) {
                buildDeleteOperation(expertId, list);
                ++deletedExperts;
            }
        }
    }

    LOGD(TAG, "Experts: " + (isIncrementalUpdate ? "INCREMENTAL" : "FULL") + " update. " +
            updatedExperts + " to update, " + deletedExperts + " to delete. New total: " +
            mExperts.size());
}
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:47,代码来源:ExpertsHandler.java


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