本文整理汇总了Java中android.media.tv.TvContract.Programs.COLUMN_TITLE属性的典型用法代码示例。如果您正苦于以下问题:Java Programs.COLUMN_TITLE属性的具体用法?Java Programs.COLUMN_TITLE怎么用?Java Programs.COLUMN_TITLE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.media.tv.TvContract.Programs
的用法示例。
在下文中一共展示了Programs.COLUMN_TITLE属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fillProgramInfo
/**
* Replaces the channel information - title, description, channel logo - with the current
* program information of the channel if the current program information exists and it is not
* blocked.
*/
@WorkerThread
private void fillProgramInfo(SearchResult result) {
long now = System.currentTimeMillis();
Uri uri = TvContract.buildProgramsUriForChannel(result.channelId, now, now);
String[] projection = new String[] {
Programs.COLUMN_TITLE,
Programs.COLUMN_POSTER_ART_URI,
Programs.COLUMN_CONTENT_RATING,
Programs.COLUMN_VIDEO_WIDTH,
Programs.COLUMN_VIDEO_HEIGHT,
Programs.COLUMN_START_TIME_UTC_MILLIS,
Programs.COLUMN_END_TIME_UTC_MILLIS
};
try (Cursor c = mContentResolver.query(uri, projection, null, null, null)) {
if (c != null && c.moveToNext() && !isRatingBlocked(c.getString(2))) {
String channelName = result.title;
long startUtcMillis = c.getLong(5);
long endUtcMillis = c.getLong(6);
result.title = c.getString(0);
result.description = buildProgramDescription(result.channelNumber, channelName,
startUtcMillis, endUtcMillis);
String imageUri = c.getString(1);
if (imageUri != null) {
result.imageUri = imageUri;
}
result.videoWidth = c.getInt(3);
result.videoHeight = c.getInt(4);
result.duration = endUtcMillis - startUtcMillis;
result.progressPercentage = getProgressPercentage(startUtcMillis, endUtcMillis);
}
}
}