本文整理汇总了Java中com.google.samples.apps.iosched.util.UIUtils.formatSessionSubtitle方法的典型用法代码示例。如果您正苦于以下问题:Java UIUtils.formatSessionSubtitle方法的具体用法?Java UIUtils.formatSessionSubtitle怎么用?Java UIUtils.formatSessionSubtitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.samples.apps.iosched.util.UIUtils
的用法示例。
在下文中一共展示了UIUtils.formatSessionSubtitle方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: formatSubtitle
import com.google.samples.apps.iosched.util.UIUtils; //导入方法依赖的package包/类
@VisibleForTesting
public void formatSubtitle() {
mSubtitle = UIUtils.formatSessionSubtitle(
mSessionStart, mSessionEnd, mRoomName, mBuffer, mContext);
if (mHasLiveStream) {
mSubtitle += " " + UIUtils.getLiveBadgeText(mContext, mSessionStart, mSessionEnd);
}
}
示例2: addSessions
import com.google.samples.apps.iosched.util.UIUtils; //导入方法依赖的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();;
}
示例3: cursorToItems
import com.google.samples.apps.iosched.util.UIUtils; //导入方法依赖的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);
}
}
示例4: addSessions
import com.google.samples.apps.iosched.util.UIUtils; //导入方法依赖的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();
}
}
}
示例5: formatSubtitle
import com.google.samples.apps.iosched.util.UIUtils; //导入方法依赖的package包/类
@VisibleForTesting
public void formatSubtitle() {
mSubtitle = UIUtils.formatSessionSubtitle(mSessionStart, mSessionEnd, mRoomName, mBuffer,
mContext);
}