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


Java Config.CONFERENCE_END_MILLIS属性代码示例

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


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

示例1: getItemViewType

@Override
public int getItemViewType(int position) {
    if (position < 0 || position >= mItems.size()) {
        LOGE(TAG, "Invalid view position passed to MyScheduleAdapter: " + position);
        return VIEW_TYPE_NORMAL;
    }
    ScheduleItem item = mItems.get(position);
    long now = UIUtils.getCurrentTime(mContext);
    if (item.startTime <= now && now <= item.endTime && item.type == ScheduleItem.SESSION) {
        return VIEW_TYPE_NOW;
    } else if (item.endTime <= now && now < Config.CONFERENCE_END_MILLIS) {
        return VIEW_TYPE_PAST_DURING_CONFERENCE;
    } else {
        return VIEW_TYPE_NORMAL;
    }
}
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:16,代码来源:MyScheduleAdapter.java

示例2: formatSessionSubtitle

/**
 * Format and return the given session time and {@link Rooms} values using {@link
 * Config#CONFERENCE_TIMEZONE}.
 */
public static String formatSessionSubtitle(long intervalStart, long intervalEnd,
        String roomName, StringBuilder recycle, Context context) {

    // Determine if the session is in the past
    long currentTimeMillis = TimeUtils.getCurrentTime(context);
    boolean conferenceEnded = currentTimeMillis > Config.CONFERENCE_END_MILLIS;
    boolean sessionEnded = currentTimeMillis > intervalEnd;
    if (sessionEnded && !conferenceEnded) {
        return context.getString(R.string.session_finished);
    }

    if (roomName == null) {
        roomName = context.getString(R.string.unknown_room);
    }
    String timeInterval = formatIntervalTimeString(intervalStart, intervalEnd, recycle,
            context);
    return timeInterval + "\n" + roomName;
}
 
开发者ID:google,项目名称:iosched,代码行数:22,代码来源:UIUtils.java

示例3: shouldOfferToSetupWifi

/**
 * Returns whether we should or should not offer to set up wifi. If asCard == true
 * this will decide whether or not to offer wifi setup actively (as a card, for instance).
 * If asCard == false, this will return whether or not to offer wifi setup passively
 * (in the overflow menu, for instance).
 */
public static boolean shouldOfferToSetupWifi(final Context context, boolean actively) {
    long now = UIUtils.getCurrentTime(context);
    if (now < Config.WIFI_SETUP_OFFER_START) {
        LOGW(TAG, "Too early to offer wifi");
        return false;
    }
    if (now > Config.CONFERENCE_END_MILLIS) {
        LOGW(TAG, "Too late to offer wifi");
        return false;
    }
    if (!WiFiUtils.isWiFiEnabled(context)) {
        LOGW(TAG, "Wifi isn't enabled");
        return false;
    }
    if (!SettingsUtils.isAttendeeAtVenue(context)) {
        LOGW(TAG, "Attendee isn't onsite so wifi wouldn't matter");
        return false;
    }
    if (WiFiUtils.isWiFiApConfigured(context)) {
        LOGW(TAG, "Attendee is already setup for wifi.");
        return false;
    }
    if (actively && SettingsUtils.hasDeclinedWifiSetup(context)) {
        LOGW(TAG, "Attendee opted out of wifi.");
        return false;
    }
    return true;
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:34,代码来源:WiFiUtils.java

示例4: formatSessionSubtitle

/**
 * Format and return the given session time and {@link Rooms} values using
 * {@link Config#CONFERENCE_TIMEZONE}.
 */
public static String formatSessionSubtitle(long intervalStart, long intervalEnd, String roomName, StringBuilder recycle,
        Context context, boolean shortFormat) {

    // Determine if the session is in the past
    long currentTimeMillis = UIUtils.getCurrentTime(context);
    boolean conferenceEnded = currentTimeMillis > Config.CONFERENCE_END_MILLIS;
    boolean sessionEnded = currentTimeMillis > intervalEnd;
    if (sessionEnded && !conferenceEnded) {
        return context.getString(R.string.session_finished);
    }

    if (roomName == null) {
        roomName = context.getString(R.string.unknown_room);
    }

    if (shortFormat) {
        TimeZone timeZone = SettingsUtils.getDisplayTimeZone(context);
        Date intervalStartDate = new Date(intervalStart);
        SimpleDateFormat shortDateFormat = new SimpleDateFormat("MMM dd");
        DateFormat shortTimeFormat = DateFormat.getTimeInstance(DateFormat.SHORT);
        shortDateFormat.setTimeZone(timeZone);
        shortTimeFormat.setTimeZone(timeZone);
        return shortDateFormat.format(intervalStartDate) + " "
                + shortTimeFormat.format(intervalStartDate);
    } else {
        String timeInterval = formatIntervalTimeString(intervalStart, intervalEnd, recycle,
                context);
        return context.getString(R.string.session_subtitle, timeInterval, roomName);
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:34,代码来源:UIUtils.java

示例5: calculateRecommendedSyncInterval

private static long calculateRecommendedSyncInterval(final Context context) {
    long now = UIUtils.getCurrentTime(context);
    long aroundConferenceStart = Config.CONFERENCE_START_MILLIS
            - Config.AUTO_SYNC_AROUND_CONFERENCE_THRESH;
    if (now < aroundConferenceStart) {
        return Config.AUTO_SYNC_INTERVAL_LONG_BEFORE_CONFERENCE;
    } else if (now <= Config.CONFERENCE_END_MILLIS) {
        return Config.AUTO_SYNC_INTERVAL_AROUND_CONFERENCE;
    } else {
        return Config.AUTO_SYNC_INTERVAL_AFTER_CONFERENCE;
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:12,代码来源:SyncHelper.java

示例6: checkShowStaleDataButterBar

private void checkShowStaleDataButterBar() {
    final boolean showingFilters = findViewById(R.id.filters_box) != null
            && findViewById(R.id.filters_box).getVisibility() == View.VISIBLE;
    final long now = UIUtils.getCurrentTime(this);
    final boolean inSnooze = (now - mLastDataStaleUserActionTime < Config.STALE_DATA_WARNING_SNOOZE);
    final long staleTime = now - PrefUtils.getLastSyncSucceededTime(this);
    final long staleThreshold = (now >= Config.CONFERENCE_START_MILLIS && now
            <= Config.CONFERENCE_END_MILLIS) ? Config.STALE_DATA_THRESHOLD_DURING_CONFERENCE :
            Config.STALE_DATA_THRESHOLD_NOT_DURING_CONFERENCE;
    final boolean isStale = (staleTime >= staleThreshold);
    final boolean bootstrapDone = PrefUtils.isDataBootstrapDone(this);
    final boolean mustShowBar = bootstrapDone && isStale && !inSnooze && !showingFilters;

    if (!mustShowBar) {
        mButterBar.setVisibility(View.GONE);
    } else {
        UIUtils.setUpButterBar(mButterBar, getString(R.string.data_stale_warning),
                getString(R.string.description_refresh), new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        mButterBar.setVisibility(View.GONE);
                        updateFragContentTopClearance();
                        mLastDataStaleUserActionTime = UIUtils.getCurrentTime(
                                BrowseSessionsActivity.this);
                        requestDataRefresh();
                    }
                }
        );
    }
    updateFragContentTopClearance();
}
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:31,代码来源:BrowseSessionsActivity.java

示例7: shouldOfferToSetupWifi

/**
 * Returns whether we should or should not offer to set up wifi. If asCard == true
 * this will decide whether or not to offer wifi setup actively (as a card, for instance).
 * If asCard == false, this will return whether or not to offer wifi setup passively
 * (in the overflow menu, for instance).
 */
public static boolean shouldOfferToSetupWifi(final Context context, boolean actively) {
    long now = UIUtils.getCurrentTime(context);
    if (now < Config.WIFI_SETUP_OFFER_START) {
        // too early to offer
        return false;
    }
    if (now > Config.CONFERENCE_END_MILLIS) {
        // too late
        return false;
    }
    if (!WiFiUtils.isWiFiEnabled(context)) {
        // no wifi, no offer
        return false;
    }
    if (!PrefUtils.isAttendeeAtVenue(context)) {
        // wifi setup not relevant
        return false;
    }
    if (WiFiUtils.isWiFiApConfigured(context)) {
        // already set up
        return false;
    }
    if (actively && PrefUtils.hasDeclinedWifiSetup(context)) {
        // user said no
        return false;
    }
    return true;
}
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:34,代码来源:WiFiUtils.java

示例8: formatSessionSubtitle

/**
 * Format and return the given session time and {@link Rooms} values using
 * {@link Config#CONFERENCE_TIMEZONE}.
 */
public static String formatSessionSubtitle(long intervalStart, long intervalEnd, String roomName, StringBuilder recycle,
        Context context, boolean shortFormat) {

    // Determine if the session is in the past
    long currentTimeMillis = UIUtils.getCurrentTime(context);
    boolean conferenceEnded = currentTimeMillis > Config.CONFERENCE_END_MILLIS;
    boolean sessionEnded = currentTimeMillis > intervalEnd;
    if (sessionEnded && !conferenceEnded) {
        return context.getString(R.string.session_finished);
    }

    if (roomName == null) {
        roomName = context.getString(R.string.unknown_room);
    }

    if (shortFormat) {
        Date intervalStartDate = new Date(intervalStart);
        sDayOfWeekFormat.setTimeZone(PrefUtils.getDisplayTimeZone(context));
        sShortTimeFormat.setTimeZone(PrefUtils.getDisplayTimeZone(context));
        return sDayOfWeekFormat.format(intervalStartDate) + " "
                + sShortTimeFormat.format(intervalStartDate);
    } else {
        return context.getString(R.string.session_subtitle,
                formatIntervalTimeString(intervalStart, intervalEnd, recycle, context), roomName);
    }
}
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:30,代码来源:UIUtils.java

示例9: calculateRecommendedSyncInterval

public static long calculateRecommendedSyncInterval(final Context context) {
    long now = UIUtils.getCurrentTime(context);
    long aroundConferenceStart = Config.CONFERENCE_START_MILLIS - Config.AUTO_SYNC_AROUND_CONFERENCE_THRESH;
    if (now < aroundConferenceStart) {
        return Config.AUTO_SYNC_INTERVAL_LONG_BEFORE_CONFERENCE;
    } else if (now <= Config.CONFERENCE_END_MILLIS) {
        return Config.AUTO_SYNC_INTERVAL_AROUND_CONFERENCE;
    } else {
        return Config.AUTO_SYNC_INTERVAL_AFTER_CONFERENCE;
    }
}
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:11,代码来源:SyncHelper.java

示例10: shouldOfferToSetupWifi

/**
 * Returns whether we should or should not offer to set up wifi. If asCard == true
 * this will decide whether or not to offer wifi setup actively (as a card, for instance).
 * If asCard == false, this will return whether or not to offer wifi setup passively
 * (in the overflow menu, for instance).
 */
public static boolean shouldOfferToSetupWifi(final Context context, boolean actively) {
    long now = TimeUtils.getCurrentTime(context);
    if (now < Config.WIFI_SETUP_OFFER_START) {
        LOGI(TAG, "Too early to offer wifi");
        return false;
    }
    if (now > Config.CONFERENCE_END_MILLIS) {
        LOGI(TAG, "Too late to offer wifi");
        return false;
    }
    if (!WiFiUtils.isWiFiEnabled(context)) {
        LOGI(TAG, "Wifi isn't enabled");
        return false;
    }
    if (RegistrationUtils.isRegisteredAttendee(context) !=
            RegistrationUtils.REGSTATUS_REGISTERED) {
        LOGI(TAG, "Attendee isn't on-site so wifi wouldn't matter");
        return false;
    }
    if (WiFiUtils.isWiFiApConfigured(context)) {
        LOGI(TAG, "Attendee is already setup for wifi.");
        return false;
    }
    if (actively && SettingsUtils.hasDeclinedWifiSetup(context)) {
        LOGI(TAG, "Attendee opted out of wifi.");
        return false;
    }
    return true;
}
 
开发者ID:google,项目名称:iosched,代码行数:35,代码来源:WiFiUtils.java

示例11: startTimeToDayIndex

/**
 * @param startTime The start time of a session. It is expected to be a start time during the
 *                  conference.
 * @return the position in the {@link Config#CONFERENCE_DAYS} of the day of the session at
 * {@code startTime}. Note that to avoid possible crashes, the returned index is always a valid
 * position in the {@link Config#CONFERENCE_DAYS} array, so if the {@code startTime} is before
 * the start of the conference, 0 will be returned, and if it is after the end of the
 * conference, the index of the last day will be returned. If the time is outside of the
 * start/end times of a conference day, for example at 5am, it returns 0.
 */
public static int startTimeToDayIndex(long startTime) {
    if (startTime < Config.CONFERENCE_START_MILLIS) {
        return 0;
    } else if (startTime > Config.CONFERENCE_END_MILLIS) {
        return Config.CONFERENCE_DAYS.length - 1;
    }
    for (int i = 0; i < Config.CONFERENCE_DAYS.length; i++) {
        if (startTime >=
                Config.CONFERENCE_DAYS[i][0] && startTime <= Config.CONFERENCE_DAYS[i][1]) {
            return i;
        }
    }
    return 0;
}
 
开发者ID:google,项目名称:iosched,代码行数:24,代码来源:UIUtils.java

示例12: calculateRecommendedSyncInterval

private static long calculateRecommendedSyncInterval(final Context context) {
    long now = TimeUtils.getCurrentTime(context);
    long aroundConferenceStart = Config.CONFERENCE_START_MILLIS
            - Config.AUTO_SYNC_AROUND_CONFERENCE_THRESH;
    if (now < aroundConferenceStart) {
        return Config.AUTO_SYNC_INTERVAL_LONG_BEFORE_CONFERENCE;
    } else if (now <= Config.CONFERENCE_END_MILLIS) {
        return Config.AUTO_SYNC_INTERVAL_AROUND_CONFERENCE;
    } else {
        return Config.AUTO_SYNC_INTERVAL_AFTER_CONFERENCE;
    }
}
 
开发者ID:google,项目名称:iosched,代码行数:12,代码来源:SyncHelper.java

示例13: startTimeToDayIndex_LastDay_ReturnsLastDay

@Test
public void startTimeToDayIndex_LastDay_ReturnsLastDay() {
    // Given a start time 1 hour1 before the end of the conference
    long startTime = Config.CONFERENCE_END_MILLIS - TimeUtils.HOUR * 1;

    // When getting the day index for the start time
    int index = UIUtils.startTimeToDayIndex(startTime);

    // Then the index is the last day of the conference
    int lastDay = Config.CONFERENCE_DAYS.length - 1;
    assertThat(index, is(lastDay));
}
 
开发者ID:google,项目名称:iosched,代码行数:12,代码来源:UIUtilsTest.java

示例14: startTimeToDayIndex_AfterEnd_ReturnsLastDay

@Test
public void startTimeToDayIndex_AfterEnd_ReturnsLastDay() {
    // Given a start time 24 hours after the start of the conference
    long startTime = Config.CONFERENCE_END_MILLIS + TimeUtils.HOUR * 24;

    // When getting the day index for the start time
    int index = UIUtils.startTimeToDayIndex(startTime);

    // Then the index is the last day of the conference
    int lastDay = Config.CONFERENCE_DAYS.length - 1;
    assertThat(index, is(lastDay));
}
 
开发者ID:google,项目名称:iosched,代码行数:12,代码来源:UIUtilsTest.java

示例15: shouldShowLiveSessionsOnly

@Deprecated
public static boolean shouldShowLiveSessionsOnly(final Context context) {
    return !SettingsUtils.isAttendeeAtVenue(context)
            && getCurrentTime(context) < Config.CONFERENCE_END_MILLIS;
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:5,代码来源:UIUtils.java


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