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


Java Sessions类代码示例

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


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

示例1: onCreateLoader

import com.google.samples.apps.iosched.provider.ScheduleContract.Sessions; //导入依赖的package包/类
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
    switch (id) {
        case SessionSummaryQuery._TOKEN:
            return new CursorLoader(this, Sessions.buildSessionUri(mSessionId),
                    SessionSummaryQuery.PROJECTION, null, null, null);
        case SessionsQuery._TOKEN:
            boolean futureSessions = false;
            if (args != null) {
                futureSessions = args.getBoolean(LOADER_SESSIONS_ARG, false);
            }
            final long currentTime = UIUtils.getCurrentTime(this);
            String selection = Sessions.LIVESTREAM_SELECTION + " and ";
            String[] selectionArgs;
            if (!futureSessions) {
                selection += Sessions.AT_TIME_SELECTION;
                selectionArgs = Sessions.buildAtTimeSelectionArgs(currentTime);
            } else {
                selection += Sessions.UPCOMING_LIVE_SELECTION;
                selectionArgs = Sessions.buildUpcomingSelectionArgs(currentTime);
            }
            return new CursorLoader(this, Sessions.CONTENT_URI, SessionsQuery.PROJECTION,
                    selection, selectionArgs, SessionsQuery.SORT_ORDER);
    }
    return null;
}
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:27,代码来源:SessionLivestreamActivity.java

示例2: upgradeFrom2017Bto2017C

import com.google.samples.apps.iosched.provider.ScheduleContract.Sessions; //导入依赖的package包/类
private void upgradeFrom2017Bto2017C(SQLiteDatabase db) {
    db.execSQL("CREATE TABLE " + Tables.MY_RESERVATIONS + " ("
            + BaseColumns._ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
            + MyReservations.SESSION_ID + " TEXT NOT NULL " + References.SESSION_ID + ","
            + MyReservations.MY_RESERVATION_ACCOUNT_NAME + " TEXT NOT NULL,"
            + MyReservations.MY_RESERVATION_STATUS + " INTEGER NOT NULL DEFAULT "
            + Integer.toString(MyReservations.RESERVATION_STATUS_UNRESERVED) + ","
            + MyReservations.MY_RESERVATION_TIMESTAMP + " DATETIME, "
            + "UNIQUE (" + MyReservations.SESSION_ID + ", "
            + MyReservations.MY_RESERVATION_ACCOUNT_NAME + ") ON CONFLICT REPLACE)");

    db.execSQL("CREATE TRIGGER " + Triggers.SESSIONS_MY_RESERVATIONS_DELETE + " AFTER DELETE ON "
            + Tables.SESSIONS + " BEGIN DELETE FROM " + Tables.MY_RESERVATIONS + " "
            + " WHERE " + Tables.MY_RESERVATIONS + "." + MyReservations.SESSION_ID +
            "=old." + Sessions.SESSION_ID
            + ";" + " END;");

}
 
开发者ID:google,项目名称:iosched,代码行数:19,代码来源:ScheduleDatabase.java

示例3: addSessions

import com.google.samples.apps.iosched.provider.ScheduleContract.Sessions; //导入依赖的package包/类
protected void addSessions(long start, long end,
        ArrayList<ScheduleItem> mutableItems, ArrayList<ScheduleItem> immutableItems) {

    Cursor cursor = mContext.getContentResolver().query(
            ScheduleContract.addOverrideAccountName(Sessions.CONTENT_MY_SCHEDULE_URI, AccountUtils.getActiveAccountName(mContext)),
                    SessionsQuery.PROJECTION,
            // filter sessions to the specified day
            Sessions.STARTING_AT_TIME_INTERVAL_SELECTION,
            new String[]{String.valueOf(start), String.valueOf(end)},
            // order by session start
            Sessions.SESSION_START);

    while (cursor.moveToNext()) {
        ScheduleItem item = new ScheduleItem();
        item.type = ScheduleItem.SESSION;
        item.sessionId = cursor.getString(SessionsQuery.SESSION_ID);
        item.title = cursor.getString(SessionsQuery.SESSION_TITLE);
        item.startTime = cursor.getLong(SessionsQuery.SESSION_START);
        item.endTime = cursor.getLong(SessionsQuery.SESSION_END);
        if (!TextUtils.isEmpty(cursor.getString(SessionsQuery.SESSION_LIVESTREAM_URL))) {
            item.flags |= ScheduleItem.FLAG_HAS_LIVESTREAM;
        }
        item.subtitle = UIUtils.formatSessionSubtitle(
                cursor.getString(SessionsQuery.ROOM_ROOM_NAME),
                cursor.getString(SessionsQuery.SESSION_SPEAKER_NAMES), mContext);
        item.backgroundImageUrl = cursor.getString(SessionsQuery.SESSION_PHOTO_URL);
        item.backgroundColor = cursor.getInt(SessionsQuery.SESSION_COLOR);
        item.hasGivenFeedback = (cursor.getInt(SessionsQuery.HAS_GIVEN_FEEDBACK) > 0);
        immutableItems.add(item);
    }
    cursor.close();;
}
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:33,代码来源:ScheduleHelper.java

示例4: reloadFromUri

import com.google.samples.apps.iosched.provider.ScheduleContract.Sessions; //导入依赖的package包/类
/**
 * Reloads all data in the activity and fragments from a given uri
 * @param newUri The session uri to load from
 */
private void reloadFromUri(Uri newUri) {
    mSessionUri = newUri;
    if (mSessionUri != null && mSessionUri.getPathSegments().size() >= 2) {
        mSessionId = Sessions.getSessionId(mSessionUri);
        getLoaderManager().restartLoader(SessionSummaryQuery._TOKEN, null, this);
    } else {
        // No session uri, get out
        mSessionUri = null;
        finish();
    }
}
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:16,代码来源:SessionLivestreamActivity.java

示例5: onNavigationItemSelected

import com.google.samples.apps.iosched.provider.ScheduleContract.Sessions; //导入依赖的package包/类
@Override
public boolean onNavigationItemSelected(int itemPosition, long itemId) {
    final Cursor cursor = (Cursor) mLivestreamAdapter.getItem(itemPosition);
    final String sessionId = cursor.getString(SessionsQuery.SESSION_ID);
    if (sessionId != null) {
        reloadFromUri(Sessions.buildSessionUri(sessionId));
        return true;
    }
    return false;
}
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:11,代码来源:SessionLivestreamActivity.java

示例6: onSessionClicked

import com.google.samples.apps.iosched.provider.ScheduleContract.Sessions; //导入依赖的package包/类
@Override
public void onSessionClicked(String sessionId) {
    Bundle args = new Bundle();
    Uri sessionUri = Sessions.buildSessionUri(sessionId);
    args.putString(ScheduleModel.SESSION_URL_KEY, sessionUri.toString());
    startActivity(new Intent(Intent.ACTION_VIEW, sessionUri));
}
 
开发者ID:google,项目名称:iosched,代码行数:8,代码来源:MyIOFragment.java

示例7: performQuery

import com.google.samples.apps.iosched.provider.ScheduleContract.Sessions; //导入依赖的package包/类
@Override
public Cursor performQuery(@NonNull CursorModelLoader<List<ScheduleItem>> loader,
        @NonNull CancellationSignal cancellationSignal) {
    return ContentResolverCompat.query(loader.getContext().getContentResolver(),
            Sessions.CONTENT_MY_SCHEDULE_URI, ScheduleItemHelper.REQUIRED_SESSION_COLUMNS,
            null, null, Sessions.SORT_BY_TIME, cancellationSignal);
}
 
开发者ID:google,项目名称:iosched,代码行数:8,代码来源:MyIOScheduleCursorTransform.java

示例8: onBookmarkClicked

import com.google.samples.apps.iosched.provider.ScheduleContract.Sessions; //导入依赖的package包/类
@Override
public void onBookmarkClicked(String sessionId, boolean isInSchedule) {
    Bundle args = new Bundle();
    args.putString(Sessions.SESSION_ID, sessionId);
    SessionDetailUserActionEnum action = isInSchedule
            ? SessionDetailUserActionEnum.UNSTAR_RELATED
            : SessionDetailUserActionEnum.STAR_RELATED;
    sendUserAction(action, args);
}
 
开发者ID:google,项目名称:iosched,代码行数:10,代码来源:SessionDetailFragment.java

示例9: createCursorLoader

import com.google.samples.apps.iosched.provider.ScheduleContract.Sessions; //导入依赖的package包/类
@Override
public Loader<Cursor> createCursorLoader(SessionDetailQueryEnum query, Bundle args) {
    CursorLoader loader = null;
    if (query == null) {
        return loader;
    }
    switch (query) {
        case SESSIONS:
            loader = getCursorLoaderInstance(mContext, mSessionUri,
                    SessionDetailQueryEnum.SESSIONS.getProjection(), null, null, null);
            break;
        case SPEAKERS:
            Uri speakersUri = getSpeakersDirUri(mSessionId);
            loader = getCursorLoaderInstance(mContext, speakersUri,
                    SessionDetailQueryEnum.SPEAKERS.getProjection(), null, null,
                    ScheduleContract.Speakers.DEFAULT_SORT);
            break;
        case FEEDBACK:
            Uri feedbackUri = getFeedbackUri(mSessionId);
            loader = getCursorLoaderInstance(mContext, feedbackUri,
                    SessionDetailQueryEnum.FEEDBACK.getProjection(), null, null, null);
            break;
        case TAG_METADATA:
            loader = getTagMetadataLoader();
            break;
        case MY_VIEWED_VIDEOS:
            Uri myPlayedVideoUri = ScheduleContract.MyViewedVideos.buildMyViewedVideosUri(
                    AccountUtils.getActiveAccountName(mContext));
            loader = getCursorLoaderInstance(mContext, myPlayedVideoUri,
                    SessionDetailQueryEnum.MY_VIEWED_VIDEOS.getProjection(), null, null, null);
            break;
        case RELATED:
            Uri relatedSessionsUri = Sessions.buildRelatedSessionsDirUri(mSessionId);
            loader = getCursorLoaderInstance(mContext, relatedSessionsUri,
                    SessionDetailQueryEnum.RELATED.getProjection(), null, null, null);
            break;
    }
    return loader;
}
 
开发者ID:google,项目名称:iosched,代码行数:40,代码来源:SessionDetailModel.java

示例10: onSessionClicked

import com.google.samples.apps.iosched.provider.ScheduleContract.Sessions; //导入依赖的package包/类
@Override
public void onSessionClicked(String sessionId) {
    Bundle args = new Bundle();
    Uri sessionUri = Sessions.buildSessionUri(sessionId);
    args.putString(ScheduleModel.SESSION_URL_KEY, sessionUri.toString());
    mListener.onUserAction(MyScheduleUserActionEnum.SESSION_SLOT, args);

    startActivity(new Intent(Intent.ACTION_VIEW, sessionUri));
}
 
开发者ID:google,项目名称:iosched,代码行数:10,代码来源:ScheduleSingleDayFragment.java

示例11: addSessions

import com.google.samples.apps.iosched.provider.ScheduleContract.Sessions; //导入依赖的package包/类
protected void addSessions(final long start, final long end,
        @NonNull final ArrayList<ScheduleItem> items, final TagFilterHolder filters) {
    Cursor cursor = null;
    try {
        Uri uri = Sessions.CONTENT_URI;
        String selection = Sessions.STARTING_AT_TIME_INTERVAL_SELECTION;
        if (mMode == MODE_STARRED_ITEMS) {
            selection = DatabaseUtils.concatenateWhere(selection,
                    Sessions.IN_SCHEDULE_SELECTION);
        }
        if (filters != null) {
            uri = Sessions.buildCategoryTagFilterUri(uri, filters.getSelectedFilterIds(),
                    filters.getCategoryCount());
        }
        cursor = mContext.getContentResolver().query(
                uri,
                ScheduleItemHelper.REQUIRED_SESSION_COLUMNS,
                selection,
                new String[]{String.valueOf(start), String.valueOf(end)},
                // order by session start
                Sessions.SESSION_START);

        ScheduleItemHelper.cursorToItems(cursor, mContext, items);
    } finally {
        if (cursor != null) {
            cursor.close();
        }
    }
}
 
开发者ID:google,项目名称:iosched,代码行数:30,代码来源:ScheduleHelper.java

示例12: cursorToItems

import com.google.samples.apps.iosched.provider.ScheduleContract.Sessions; //导入依赖的package包/类
@SuppressWarnings("WrongConstant")
public static void cursorToItems(Cursor cursor, Context context, List<ScheduleItem> list) {
    while (cursor.moveToNext()) {
        ScheduleItem item = new ScheduleItem();
        item.type = ScheduleItem.SESSION;
        item.sessionId = cursor.getString(cursor.getColumnIndex(Sessions.SESSION_ID));
        item.title = cursor.getString(cursor.getColumnIndex(Sessions.SESSION_TITLE));
        item.startTime = cursor.getLong(cursor.getColumnIndex(Sessions.SESSION_START));
        item.endTime = cursor.getLong(cursor.getColumnIndex(Sessions.SESSION_END));
        if (!TextUtils.isEmpty(
                cursor.getString(cursor.getColumnIndex(Sessions.SESSION_LIVESTREAM_ID)))) {
            item.flags |= ScheduleItem.FLAG_HAS_LIVESTREAM;
        }
        item.subtitle = UIUtils.formatSessionSubtitle(
                cursor.getString(cursor.getColumnIndex(Sessions.ROOM_NAME)),
                cursor.getString(cursor.getColumnIndex(Sessions.SESSION_SPEAKER_NAMES)),
                context);
        item.room = cursor.getString(cursor.getColumnIndex(Sessions.ROOM_NAME));
        item.backgroundImageUrl = cursor.getString(
                cursor.getColumnIndex(Sessions.SESSION_PHOTO_URL));
        item.backgroundColor = cursor.getInt(cursor.getColumnIndex(Sessions.SESSION_COLOR));
        item.sessionType = detectSessionType(
                cursor.getString(cursor.getColumnIndex(Sessions.SESSION_TAGS)));
        item.mainTag = cursor.getString(cursor.getColumnIndex(Sessions.SESSION_MAIN_TAG));
        String tags = cursor.getString(cursor.getColumnIndex(Sessions.SESSION_TAGS));
        if (tags != null) {
            item.tags = tags.split(",");
            item.isKeynote = tags.contains(Tags.SPECIAL_KEYNOTE);
        }
        item.inSchedule =
                cursor.getInt(cursor.getColumnIndex(Sessions.SESSION_IN_MY_SCHEDULE)) != 0;
        item.reservationStatus =
                cursor.getInt(cursor.getColumnIndex(Sessions.SESSION_RESERVATION_STATUS));
        list.add(item);
    }
}
 
开发者ID:google,项目名称:iosched,代码行数:37,代码来源:ScheduleItemHelper.java

示例13: upgradeFrom2016Bto2017A

import com.google.samples.apps.iosched.provider.ScheduleContract.Sessions; //导入依赖的package包/类
private void upgradeFrom2016Bto2017A(SQLiteDatabase db) {
    db.execSQL("CREATE TABLE " + Tables.RELATED_SESSIONS + " ("
            + BaseColumns._ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
            + Sessions.SESSION_ID + " TEXT NOT NULL, "
            + Sessions.RELATED_SESSION_ID + " TEXT NOT NULL, "
            + "UNIQUE (" + Sessions.SESSION_ID + "," + Sessions.RELATED_SESSION_ID + ") "
            + "ON CONFLICT IGNORE)");
}
 
开发者ID:google,项目名称:iosched,代码行数:9,代码来源:ScheduleDatabase.java

示例14: updateSessionSearchIndex

import com.google.samples.apps.iosched.provider.ScheduleContract.Sessions; //导入依赖的package包/类
/**
 * Updates the session search index. This should be done sparingly, as the queries are rather
 * complex.
 */
static void updateSessionSearchIndex(SQLiteDatabase db) {
    db.execSQL("DELETE FROM " + Tables.SESSIONS_SEARCH);

    db.execSQL("INSERT INTO " + Qualified.SESSIONS_SEARCH
            + " SELECT s." + Sessions.SESSION_ID + ",("

            // Full text body
            + Sessions.SESSION_TITLE + "||'; '||"
            + Sessions.SESSION_ABSTRACT + "||'; '||"
            + "IFNULL(GROUP_CONCAT(t." + Speakers.SPEAKER_NAME + ",' '),'')||'; '||"
            + "'')"

            + " FROM " + Tables.SESSIONS + " s "
            + " LEFT OUTER JOIN"

            // Subquery resulting in session_id, speaker_id, speaker_name
            + "(SELECT " + Sessions.SESSION_ID + "," + Qualified.SPEAKERS_SPEAKER_ID
            + "," + Speakers.SPEAKER_NAME
            + " FROM " + Tables.SESSIONS_SPEAKERS
            + " INNER JOIN " + Tables.SPEAKERS
            + " ON " + Qualified.SESSIONS_SPEAKERS_SPEAKER_ID + "="
            + Qualified.SPEAKERS_SPEAKER_ID
            + ") t"

            // Grand finale
            + " ON s." + Sessions.SESSION_ID + "=t." + Sessions.SESSION_ID
            + " GROUP BY s." + Sessions.SESSION_ID);
}
 
开发者ID:google,项目名称:iosched,代码行数:33,代码来源:ScheduleDatabase.java

示例15: addSessions

import com.google.samples.apps.iosched.provider.ScheduleContract.Sessions; //导入依赖的package包/类
protected void addSessions(long start, long end,
        ArrayList<ScheduleItem> mutableItems, ArrayList<ScheduleItem> immutableItems) {

    Cursor cursor = null;
    try {
        cursor = mContext.getContentResolver().query(
                ScheduleContractHelper.addOverrideAccountName(Sessions.CONTENT_MY_SCHEDULE_URI,
                        AccountUtils.getActiveAccountName(mContext)),
                SessionsQuery.PROJECTION,
                // filter sessions to the specified day
                Sessions.STARTING_AT_TIME_INTERVAL_SELECTION,
                new String[]{String.valueOf(start), String.valueOf(end)},
                // order by session start
                Sessions.SESSION_START);

        if (cursor.moveToFirst()) {
            do {
                ScheduleItem item = new ScheduleItem();
                item.type = ScheduleItem.SESSION;
                item.sessionId = cursor.getString(SessionsQuery.SESSION_ID);
                item.title = cursor.getString(SessionsQuery.SESSION_TITLE);
                item.startTime = cursor.getLong(SessionsQuery.SESSION_START);
                item.endTime = cursor.getLong(SessionsQuery.SESSION_END);
                if (!TextUtils.isEmpty(cursor.getString(SessionsQuery.SESSION_LIVESTREAM_URL))) {
                    item.flags |= ScheduleItem.FLAG_HAS_LIVESTREAM;
                }
                item.subtitle = UIUtils.formatSessionSubtitle(
                        cursor.getString(SessionsQuery.ROOM_ROOM_NAME),
                        cursor.getString(SessionsQuery.SESSION_SPEAKER_NAMES), mContext);
                item.room = cursor.getString(SessionsQuery.ROOM_ROOM_NAME);
                item.backgroundImageUrl = cursor.getString(SessionsQuery.SESSION_PHOTO_URL);
                item.backgroundColor = cursor.getInt(SessionsQuery.SESSION_COLOR);
                item.hasGivenFeedback = (cursor.getInt(SessionsQuery.HAS_GIVEN_FEEDBACK) > 0);
                item.sessionType = detectSessionType(cursor.getString(SessionsQuery.SESSION_TAGS));
                item.mainTag = cursor.getString(SessionsQuery.SESSION_MAIN_TAG);
                immutableItems.add(item);
            } while (cursor.moveToNext());
        }
    } finally {
        if (cursor != null) {
            cursor.close();
        }
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:45,代码来源:ScheduleHelper.java


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