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


Java Blocks类代码示例

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


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

示例1: addBlocks

import com.google.samples.apps.iosched.provider.ScheduleContract.Blocks; //导入依赖的package包/类
protected void addBlocks(long start, long end,
        ArrayList<ScheduleItem> mutableItems, ArrayList<ScheduleItem> immutableItems) {
    Cursor cursor = mContext.getContentResolver().query(
            Blocks.CONTENT_URI,
            BlocksQuery.PROJECTION,

            // filter sessions on the specified day
            Blocks.BLOCK_START + " >= ? and " + Blocks.BLOCK_START + " <= ?",
            new String[]{String.valueOf(start), String.valueOf(end)},

            // order by session start
            Blocks.BLOCK_START);

    while (cursor.moveToNext()) {
        ScheduleItem item = new ScheduleItem();
        item.setTypeFromBlockType(cursor.getString(BlocksQuery.BLOCK_TYPE));
        item.title = cursor.getString(BlocksQuery.BLOCK_TITLE);
        item.subtitle = cursor.getString(BlocksQuery.BLOCK_SUBTITLE);
        item.startTime = cursor.getLong(BlocksQuery.BLOCK_START);
        item.endTime = cursor.getLong(BlocksQuery.BLOCK_END);

        // Hide BREAK blocks to remote attendees (b/14666391):
        if (item.type == ScheduleItem.BREAK && !PrefUtils.isAttendeeAtVenue(mContext)) {
            continue;
        }
        // Currently, only type=FREE is mutable
        if (item.type == ScheduleItem.FREE) {
            mutableItems.add(item);
        } else {
            immutableItems.add(item);
            item.flags |= ScheduleItem.FLAG_NOT_REMOVABLE;
        }
    }
}
 
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:35,代码来源:ScheduleHelper.java

示例2: setTypeFromBlockType

import com.google.samples.apps.iosched.provider.ScheduleContract.Blocks; //导入依赖的package包/类
public void setTypeFromBlockType(String blockType) {
    if (ScheduleContract.Blocks.isValidBlockType(blockType) &&
            ScheduleContract.Blocks.BLOCK_TYPE_BREAK.equals(blockType)) {
        type = BREAK;
    } else {
        type = FREE;
    }
}
 
开发者ID:google,项目名称:iosched,代码行数:9,代码来源:ScheduleItem.java

示例3: getBreakIcon

import com.google.samples.apps.iosched.provider.ScheduleContract.Blocks; //导入依赖的package包/类
public int getBreakIcon() {
    if (blockKind != null) {
        switch (blockKind) {
            case Blocks.BLOCK_KIND_MEAL:
                return R.drawable.ic_food;
            case Blocks.BLOCK_KIND_CONCERT:
                return R.drawable.ic_concert;
            case Blocks.BLOCK_KIND_AFTERHOURS:
                return R.drawable.ic_afterhours;
            case Blocks.BLOCK_KIND_BADGEPICKUP:
                return R.drawable.ic_badge_pickup;
        }
    }
    return 0;
}
 
开发者ID:google,项目名称:iosched,代码行数:16,代码来源:ScheduleItem.java

示例4: addBlocks

import com.google.samples.apps.iosched.provider.ScheduleContract.Blocks; //导入依赖的package包/类
protected void addBlocks(long start, long end,
        ArrayList<ScheduleItem> mutableItems, ArrayList<ScheduleItem> immutableItems) {
    Cursor cursor = null;
    try {
        cursor = mContext.getContentResolver().query(
                Blocks.CONTENT_URI,
                BlocksQuery.PROJECTION,

                // filter sessions on the specified day
                Blocks.BLOCK_START + " >= ? and " + Blocks.BLOCK_START + " <= ?",
                new String[]{String.valueOf(start), String.valueOf(end)},

                // order by session start
                Blocks.BLOCK_START);

        if (cursor.moveToFirst()) {
            do {
                ScheduleItem item = new ScheduleItem();
                item.setTypeFromBlockType(cursor.getString(BlocksQuery.BLOCK_TYPE));
                item.title = cursor.getString(BlocksQuery.BLOCK_TITLE);
                item.room = item.subtitle = cursor.getString(BlocksQuery.BLOCK_SUBTITLE);
                item.startTime = cursor.getLong(BlocksQuery.BLOCK_START);
                item.endTime = cursor.getLong(BlocksQuery.BLOCK_END);

                // Hide BREAK blocks to remote attendees (b/14666391):
                if (item.type == ScheduleItem.BREAK && !SettingsUtils.isAttendeeAtVenue(mContext)) {
                    continue;
                }
                // Currently, only type=FREE is mutable
                if (item.type == ScheduleItem.FREE) {
                    mutableItems.add(item);
                } else {
                    immutableItems.add(item);
                    item.flags |= ScheduleItem.FLAG_NOT_REMOVABLE;
                }
            } while (cursor.moveToNext());
        }
    } finally {
        if (cursor != null) {
            cursor.close();
        }
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:44,代码来源:ScheduleHelper.java

示例5: isFoodBreak

import com.google.samples.apps.iosched.provider.ScheduleContract.Blocks; //导入依赖的package包/类
public boolean isFoodBreak() {
    return Blocks.BLOCK_KIND_MEAL.equals(blockKind);
}
 
开发者ID:google,项目名称:iosched,代码行数:4,代码来源:ScheduleItem.java

示例6: isConcert

import com.google.samples.apps.iosched.provider.ScheduleContract.Blocks; //导入依赖的package包/类
public boolean isConcert() {
    return Blocks.BLOCK_KIND_CONCERT.equals(blockKind);
}
 
开发者ID:google,项目名称:iosched,代码行数:4,代码来源:ScheduleItem.java

示例7: upgradeFrom2017Cto2017D

import com.google.samples.apps.iosched.provider.ScheduleContract.Blocks; //导入依赖的package包/类
private void upgradeFrom2017Cto2017D(SQLiteDatabase db) {
    db.execSQL("ALTER TABLE " + Tables.BLOCKS + " ADD COLUMN " + Blocks.BLOCK_KIND + " TEXT");
}
 
开发者ID:google,项目名称:iosched,代码行数:4,代码来源:ScheduleDatabase.java


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