本文整理汇总了Java中com.google.samples.apps.iosched.model.TagMetadata类的典型用法代码示例。如果您正苦于以下问题:Java TagMetadata类的具体用法?Java TagMetadata怎么用?Java TagMetadata使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TagMetadata类属于com.google.samples.apps.iosched.model包,在下文中一共展示了TagMetadata类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setActivityTitle
import com.google.samples.apps.iosched.model.TagMetadata; //导入依赖的package包/类
/**
* Set the activity title to be that of the selected tag name.
* If the user chosen tag's category is present in the filter and there is a single tag
* with that category then set the title to the specific tag name else
* set the title to R.string.explore.
*/
private void setActivityTitle() {
if (mMode == MODE_EXPLORE && mTagMetadata != null) {
String tag = getIntent().getStringExtra(EXTRA_FILTER_TAG);
TagMetadata.Tag titleTag = tag == null ? null : mTagMetadata.getTag(tag);
String title = null;
if (titleTag != null &&
mTagFilterHolder.getCountByCategory(titleTag.getCategory()) == 1) {
for (String tagId : mTagFilterHolder.getSelectedFilters()) {
TagMetadata.Tag theTag = mTagMetadata.getTag(tagId);
if (TextUtils.equals(titleTag.getCategory(), theTag.getCategory())) {
title = theTag.getName();
}
}
}
setTitle(title == null ? getString(R.string.title_explore) : title);
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:24,代码来源:ExploreSessionsActivity.java
示例2: onCreateLoader
import com.google.samples.apps.iosched.model.TagMetadata; //导入依赖的package包/类
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
switch (id) {
case ExploreSessionsQuery.NORMAL_TOKEN:
return new CursorLoader(getActivity(),
mCurrentUri, ExploreSessionsQuery.NORMAL_PROJECTION,
mShowLiveStreamedSessions ?
ScheduleContract.Sessions.LIVESTREAM_OR_YOUTUBE_URL_SELECTION : null,
null,
ScheduleContract.Sessions.SORT_BY_TYPE_THEN_TIME);
case ExploreSessionsQuery.SEARCH_TOKEN:
return new CursorLoader(getActivity(),
mCurrentUri, ExploreSessionsQuery.SEARCH_PROJECTION,
mShowLiveStreamedSessions ?
ScheduleContract.Sessions.LIVESTREAM_OR_YOUTUBE_URL_SELECTION : null,
null,
ScheduleContract.Sessions.SORT_BY_TYPE_THEN_TIME);
case TAG_METADATA_TOKEN:
return TagMetadata.createCursorLoader(getActivity());
default:
return null;
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:24,代码来源:ExploreSessionsFragment.java
示例3: onCreateLoader
import com.google.samples.apps.iosched.model.TagMetadata; //导入依赖的package包/类
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle data) {
CursorLoader loader = null;
if (id == SessionsQuery._TOKEN){
loader = new CursorLoader(this, mSessionUri, SessionsQuery.PROJECTION, null,
null, null);
} else if (id == SpeakersQuery._TOKEN && mSessionUri != null){
Uri speakersUri = ScheduleContract.Sessions.buildSpeakersDirUri(mSessionId);
loader = new CursorLoader(this, speakersUri, SpeakersQuery.PROJECTION, null,
null, ScheduleContract.Speakers.DEFAULT_SORT);
} else if (id == FeedbackQuery._TOKEN) {
Uri feedbackUri = ScheduleContract.Feedback.buildFeedbackUri(mSessionId);
loader = new CursorLoader(this, feedbackUri, FeedbackQuery.PROJECTION, null,
null, null);
} else if (id == TAG_METADATA_TOKEN) {
loader = TagMetadata.createCursorLoader(this);
}
return loader;
}
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:20,代码来源:SessionDetailActivity.java
示例4: onLoadFinished
import com.google.samples.apps.iosched.model.TagMetadata; //导入依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
if (loader.getId() == SessionsQuery._TOKEN) {
onSessionQueryComplete(cursor);
} else if (loader.getId() == SpeakersQuery._TOKEN) {
onSpeakersQueryComplete(cursor);
} else if (loader.getId() == FeedbackQuery._TOKEN) {
onFeedbackQueryComplete(cursor);
} else if (loader.getId() == TAG_METADATA_TOKEN) {
mTagMetadata = new TagMetadata(cursor);
cursor.close();
tryRenderTags();
} else {
cursor.close();
}
}
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:17,代码来源:SessionDetailActivity.java
示例5: updateHeaderColor
import com.google.samples.apps.iosched.model.TagMetadata; //导入依赖的package包/类
private void updateHeaderColor() {
mHeaderColor = 0;
for (String tag : mFilterTags) {
if (tag != null) {
TagMetadata.Tag tagObj = mTagMetadata.getTag(tag);
if (tagObj != null && Config.Tags.CATEGORY_TOPIC.equals(tagObj.getCategory())) {
mHeaderColor = tagObj.getColor();
}
}
}
findViewById(R.id.headerbar).setBackgroundColor(
mHeaderColor == 0
? getResources().getColor(R.color.theme_primary)
: mHeaderColor);
setNormalStatusBarColor(
mHeaderColor == 0
? getThemedStatusBarColor()
: UIUtils.scaleColor(mHeaderColor, 0.8f, false));
}
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:20,代码来源:BrowseSessionsActivity.java
示例6: showSecondaryFilters
import com.google.samples.apps.iosched.model.TagMetadata; //导入依赖的package包/类
private void showSecondaryFilters() {
showFilterBox(false);
// repopulate secondary filter spinners
if (!TextUtils.isEmpty(mFilterTags[0])) {
TagMetadata.Tag topTag = mTagMetadata.getTag(mFilterTags[0]);
String topCategory = topTag.getCategory();
if (topCategory.equals(Config.Tags.EXPLORE_CATEGORIES[0])) {
populateSecondLevelFilterSpinner(0, 1);
populateSecondLevelFilterSpinner(1, 2);
} else if (topCategory.equals(Config.Tags.EXPLORE_CATEGORIES[1])) {
populateSecondLevelFilterSpinner(0, 0);
populateSecondLevelFilterSpinner(1, 2);
} else {
populateSecondLevelFilterSpinner(0, 0);
populateSecondLevelFilterSpinner(1, 1);
}
showFilterBox(true);
}
}
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:21,代码来源:BrowseSessionsActivity.java
示例7: buildFiltersList
import com.google.samples.apps.iosched.model.TagMetadata; //导入依赖的package包/类
private void buildFiltersList(TagMetadata tagMetadata) {
mItems.clear();
if (tagMetadata == null) {
return;
}
// Types
List<TagMetadata.Tag> types = tagMetadata.getTagsInCategory(Tags.CATEGORY_TYPE);
if (types != null && !types.isEmpty()) {
mItems.addAll(types);
}
// "Topics" header
mItems.add(new TopicsHeader());
// Topics (aka Tracks)
List<TagMetadata.Tag> topics = tagMetadata.getTagsInCategory(Tags.CATEGORY_TRACK);
if (topics != null && !topics.isEmpty()) {
mItems.addAll(topics);
}
}
开发者ID:google,项目名称:iosched,代码行数:19,代码来源:SessionsFilterAdapter.java
示例8: onClick
import com.google.samples.apps.iosched.model.TagMetadata; //导入依赖的package包/类
@Override
public void onClick(View v) {
boolean isChecked = ((CheckBox)v).isChecked();
TagMetadata.Tag theTag = (TagMetadata.Tag)v.getTag();
LOGD(TAG, "Checkbox with tag: " + theTag.getName() + " isChecked => " + isChecked);
if (isChecked) {
mTagFilterHolder.add(theTag.getId(), theTag.getCategory());
} else {
mTagFilterHolder.remove(theTag.getId(), theTag.getCategory());
}
reloadFragment();
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:13,代码来源:ExploreSessionsActivity.java
示例9: onCreateLoader
import com.google.samples.apps.iosched.model.TagMetadata; //导入依赖的package包/类
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
if (id == TAG_METADATA_TOKEN) {
return TagMetadata.createCursorLoader(this);
}
return null;
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:8,代码来源:ExploreSessionsActivity.java
示例10: onLoadFinished
import com.google.samples.apps.iosched.model.TagMetadata; //导入依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
switch (loader.getId()) {
case TAG_METADATA_TOKEN:
mTagMetadata = new TagMetadata(cursor);
onTagMetadataLoaded();
break;
default:
cursor.close();
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:12,代码来源:ExploreSessionsActivity.java
示例11: onLoadFinished
import com.google.samples.apps.iosched.model.TagMetadata; //导入依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
switch (loader.getId()) {
case ExploreSessionsQuery.NORMAL_TOKEN: // fall through
case ExploreSessionsQuery.SEARCH_TOKEN:
reloadSessionData(cursor);
break;
case TAG_METADATA_TOKEN:
mTagMetadata = new TagMetadata(cursor);
break;
default:
cursor.close();
}
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:15,代码来源:ExploreSessionsFragment.java
示例12: onCreateLoader
import com.google.samples.apps.iosched.model.TagMetadata; //导入依赖的package包/类
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle data) {
LOGD(TAG, "onCreateLoader, id=" + id + ", data=" + data);
final Intent intent = BaseActivity.fragmentArgumentsToIntent(data);
Uri sessionsUri = intent.getData();
if ((id == SessionsQuery.NORMAL_TOKEN || id == SessionsQuery.SEARCH_TOKEN) && sessionsUri == null) {
LOGD(TAG, "intent.getData() is null, setting to default sessions search");
sessionsUri = ScheduleContract.Sessions.CONTENT_URI;
}
Loader<Cursor> loader = null;
String liveStreamedOnlySelection = UIUtils.shouldShowLiveSessionsOnly(getActivity())
? "IFNULL(" + ScheduleContract.Sessions.SESSION_LIVESTREAM_URL + ",'')!=''"
: null;
if (id == SessionsQuery.NORMAL_TOKEN) {
LOGD(TAG, "Creating sessions loader for " + sessionsUri + ", selection " + liveStreamedOnlySelection);
loader = new CursorLoader(getActivity(), sessionsUri, SessionsQuery.NORMAL_PROJECTION,
liveStreamedOnlySelection, null, ScheduleContract.Sessions.SORT_BY_TYPE_THEN_TIME);
} else if (id == SessionsQuery.SEARCH_TOKEN) {
LOGD(TAG, "Creating search loader for " + sessionsUri + ", selection " + liveStreamedOnlySelection);
loader = new CursorLoader(getActivity(), sessionsUri, SessionsQuery.SEARCH_PROJECTION,
liveStreamedOnlySelection, null, ScheduleContract.Sessions.SORT_BY_TYPE_THEN_TIME);
} else if (id == TAG_METADATA_TOKEN) {
LOGD(TAG, "Creating metadata loader");
loader = TagMetadata.createCursorLoader(getActivity());
}
return loader;
}
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:28,代码来源:SessionsFragment.java
示例13: onLoadFinished
import com.google.samples.apps.iosched.model.TagMetadata; //导入依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
if (getActivity() == null) {
return;
}
int token = loader.getId();
LOGD(TAG, "Loader finished: " + (token == SessionsQuery.NORMAL_TOKEN ? "sessions" :
token == SessionsQuery.SEARCH_TOKEN ? "search" : token == TAG_METADATA_TOKEN ? "tags" :
"unknown"));
if (token == SessionsQuery.NORMAL_TOKEN || token == SessionsQuery.SEARCH_TOKEN) {
if (mCursor != null && mCursor != cursor) {
mCursor.close();
}
mCursor = cursor;
mIsSearchCursor = token == SessionsQuery.SEARCH_TOKEN;
LOGD(TAG, "Cursor has " + mCursor.getCount() + " items. Will now update collection view.");
updateCollectionView();
} else if (token == TAG_METADATA_TOKEN) {
mTagMetadata = new TagMetadata(cursor);
cursor.close();
updateCollectionView();
mCallbacks.onTagMetadataLoaded(mTagMetadata);
} else {
LOGD(TAG, "Query complete, Not Actionable: " + token);
cursor.close();
}
}
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:29,代码来源:SessionsFragment.java
示例14: onTagMetadataLoaded
import com.google.samples.apps.iosched.model.TagMetadata; //导入依赖的package包/类
@Override
public void onTagMetadataLoaded(TagMetadata metadata) {
mTagMetadata = metadata;
if (mSpinnerConfigured) {
// we need to reconfigure the spinner, so we need to remember our current filter
// and try to restore it after we set up the spinner again.
mSpinnerConfigured = false;
mFilterTagsToRestore[0] = mFilterTags[0];
mFilterTagsToRestore[1] = mFilterTags[1];
mFilterTagsToRestore[2] = mFilterTags[2];
}
trySetUpActionBarSpinner();
}
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:14,代码来源:BrowseSessionsActivity.java
示例15: getSessionTrackColor
import com.google.samples.apps.iosched.model.TagMetadata; //导入依赖的package包/类
public int getSessionTrackColor() {
if (mTagMetadata != null && mMainTag != null) {
final TagMetadata.Tag tag = mTagMetadata.getTag(mMainTag);
if (tag != null) {
return tag.getColor();
}
}
return Color.TRANSPARENT;
}
开发者ID:google,项目名称:iosched,代码行数:10,代码来源:SessionDetailModel.java
示例16: onCreateLoader
import com.google.samples.apps.iosched.model.TagMetadata; //导入依赖的package包/类
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
switch (id) {
case TAG_METADATA_TOKEN:
return TagMetadata.createCursorLoader(getActivity());
default:
return null;
}
}
开发者ID:google,项目名称:iosched,代码行数:10,代码来源:ScheduleSingleDayFragment.java
示例17: onLoadFinished
import com.google.samples.apps.iosched.model.TagMetadata; //导入依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
switch (loader.getId()) {
case TAG_METADATA_TOKEN:
mTagMetadata = new TagMetadata(cursor);
if (mViewAdapter != null) {
mViewAdapter.setTagMetadata(mTagMetadata);
}
break;
}
}
开发者ID:google,项目名称:iosched,代码行数:12,代码来源:ScheduleSingleDayFragment.java
示例18: onCreateLoader
import com.google.samples.apps.iosched.model.TagMetadata; //导入依赖的package包/类
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
if (id == TAG_METADATA_TOKEN) {
if (getContext() != null) {
return TagMetadata.createCursorLoader(getContext());
}
}
return null;
}
开发者ID:google,项目名称:iosched,代码行数:10,代码来源:ScheduleFilterFragment.java
示例19: onLoadFinished
import com.google.samples.apps.iosched.model.TagMetadata; //导入依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
if (loader.getId() == TAG_METADATA_TOKEN) {
TagMetadata tagMetadata = new TagMetadata(cursor);
onTagMetadataLoaded(tagMetadata);
} else {
cursor.close();
}
}
开发者ID:google,项目名称:iosched,代码行数:10,代码来源:ScheduleFilterFragment.java
示例20: ScheduleDayAdapter
import com.google.samples.apps.iosched.model.TagMetadata; //导入依赖的package包/类
public ScheduleDayAdapter(@NonNull Context context, @NonNull Callbacks adapterCallbacks,
@Nullable TagMetadata tagMetadata, boolean showTimeSeparators) {
mAdapterCallbacks = adapterCallbacks;
mTagMetadata = tagMetadata;
mShowTimeSeparators = showTimeSeparators;
stuckHeaderElevation = context.getResources().getDimension(R.dimen.card_elevation);
setHasStableIds(true);
}
开发者ID:google,项目名称:iosched,代码行数:9,代码来源:ScheduleDayAdapter.java
注:本文中的com.google.samples.apps.iosched.model.TagMetadata类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论