本文整理汇总了Java中com.google.samples.apps.iosched.ui.widget.CollectionView类的典型用法代码示例。如果您正苦于以下问题:Java CollectionView类的具体用法?Java CollectionView怎么用?Java CollectionView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CollectionView类属于com.google.samples.apps.iosched.ui.widget包,在下文中一共展示了CollectionView类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: updateCollectionView
import com.google.samples.apps.iosched.ui.widget.CollectionView; //导入依赖的package包/类
/**
* Updates the CollectionView with the given list of {@code videos}.
*/
private void updateCollectionView(List<VideoLibraryModel.Video> videos) {
LOGD(TAG, "Updating filtered video library collection view.");
CollectionView.Inventory inventory = new CollectionView.Inventory();
int normalColumns = getResources().getInteger(R.integer.video_library_columns);
// Go through all videos and organize them into groups for each topic. We assume they are
// already ordered by topics.
CollectionView.InventoryGroup curGroup = new CollectionView.InventoryGroup(0)
.setDataIndexStart(0)
.setShowHeader(false)
.setDisplayCols(normalColumns);
for (int dataIndex = 0; dataIndex < videos.size(); ++dataIndex) {
curGroup.addItemWithTag(videos.get(dataIndex));
}
if (curGroup.getRowCount() > 0) {
inventory.addGroup(curGroup);
}
mCollectionView.setCollectionAdapter(this);
mCollectionView.updateInventory(inventory);
mEmptyView.setVisibility(videos.isEmpty() ? View.VISIBLE : View.GONE);
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:28,代码来源:VideoLibraryFilteredFragment.java
示例2: makeRandomCollectionViewInventoryGroup
import com.google.samples.apps.iosched.ui.widget.CollectionView; //导入依赖的package包/类
/**
* Returns a {@link CollectionView.InventoryGroup} containing {@code numRandomVideos} number of
* videos randomly selected in the given {@code videos} list.
*/
private CollectionView.InventoryGroup makeRandomCollectionViewInventoryGroup(
List<VideoLibraryModel.Video> videos, int numRandomVideos, String groupHeaderLabel,
int groupId) {
// Get the number of display columns for each groups.
int normalColumns = getResources().getInteger(R.integer.video_library_columns);
// Randomly select the requested number of items fro the list.
videos = new ArrayList<>(videos);
Collections.shuffle(videos);
videos = videos.subList(0, Math.min(videos.size(), numRandomVideos));
// Add these videos to the group.
CollectionView.InventoryGroup lastYearGroup =
new CollectionView.InventoryGroup(groupId)
.setDataIndexStart(0)
.setHeaderLabel(groupHeaderLabel)
.setShowHeader(true)
.setDisplayCols(normalColumns);
for (VideoLibraryModel.Video video : videos) {
lastYearGroup.addItemWithTag(video);
}
return lastYearGroup;
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:29,代码来源:VideoLibraryFragment.java
示例3: getInventory
import com.google.samples.apps.iosched.ui.widget.CollectionView; //导入依赖的package包/类
public CollectionView.Inventory getInventory() {
CollectionView.Inventory inventory = new CollectionView.Inventory();
// setup hero hashtag
inventory.addGroup(new CollectionView.InventoryGroup(HERO_GROUP_ID)
.setDisplayCols(1)
.setItemCount(1)
.setShowHeader(false));
// setup other hashtags
inventory.addGroup(new CollectionView.InventoryGroup(HashtagsQuery.TOKEN)
.setDisplayCols(mContext.getResources().getInteger(R.integer.social_grid_columns))
.setItemCount(mCursor.getCount() - 1)
.setDataIndexStart(1)
.setShowHeader(false));
return inventory;
}
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:17,代码来源:HashtagsFragment.java
示例4: onCreateView
import com.google.samples.apps.iosched.ui.widget.CollectionView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_partners, container, false);
if (getArguments() != null && !getArguments().getBoolean(ARG_HAS_HEADER, true)) {
rootView.findViewById(R.id.headerbar).setVisibility(View.GONE);
}
rootView.findViewById(R.id.close_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// TODO: refactor to use fragment callbacks
getFragmentManager().popBackStack();
}
});
mCollectionView = (CollectionView) rootView.findViewById(R.id.collection_view);
return rootView;
}
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:20,代码来源:PartnersFragment.java
示例5: onPostCreate
import com.google.samples.apps.iosched.ui.widget.CollectionView; //导入依赖的package包/类
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
CollectionView collectionView = (CollectionView) findViewById(R.id.sessions_collection_view);
if (collectionView != null) {
enableActionBarAutoHide(collectionView);
}
mSessionsFrag = (SessionsFragment) getFragmentManager().findFragmentById(
R.id.sessions_fragment);
if (mSessionsFrag != null && savedInstanceState == null) {
Bundle args = intentToFragmentArguments(getIntent());
mSessionsFrag.reloadFromArguments(args);
}
registerHideableHeaderView(findViewById(R.id.headerbar));
}
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:18,代码来源:BrowseSessionsActivity.java
示例6: getInventory
import com.google.samples.apps.iosched.ui.widget.CollectionView; //导入依赖的package包/类
/**
* Returns a new instance of {@link CollectionView.Inventory}. It always contains a single
* {@link CollectionView.InventoryGroup}.
*
* @return A new instance of {@link CollectionView.Inventory}.
*/
public CollectionView.Inventory getInventory() {
CollectionView.Inventory inventory = new CollectionView.Inventory();
inventory.addGroup(new CollectionView.InventoryGroup(ExploreSessionsQuery.NORMAL_TOKEN)
.setDisplayCols(mDisplayColumns)
.setItemCount(getCursor().getCount())
.setDataIndexStart(0)
.setShowHeader(false));
return inventory;
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:16,代码来源:ExploreSessionsFragment.java
示例7: onCreateView
import com.google.samples.apps.iosched.ui.widget.CollectionView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.explore_io_frag, container, false);
mCollectionView = (CollectionView) root.findViewById(R.id.explore_collection_view);
mEmptyView = root.findViewById(android.R.id.empty);
getActivity().overridePendingTransition(0, 0);
return root;
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:11,代码来源:ExploreIOFragment.java
示例8: onCreateView
import com.google.samples.apps.iosched.ui.widget.CollectionView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.video_library_frag, container, false);
mCollectionView = (CollectionView) root.findViewById(R.id.videos_collection_view);
mEmptyView = root.findViewById(android.R.id.empty);
getActivity().overridePendingTransition(0, 0);
return root;
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:11,代码来源:VideoLibraryFilteredFragment.java
示例9: onCreateView
import com.google.samples.apps.iosched.ui.widget.CollectionView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.video_library_frag, container, false);
mCollectionView = (CollectionView) root.findViewById(R.id.videos_collection_view);
mEmptyView = root.findViewById(android.R.id.empty);
getActivity().overridePendingTransition(0, 0);
// Reload the content so that new random Videos are shown.
fireReloadEvent();
return root;
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:14,代码来源:VideoLibraryFragment.java
示例10: newCollectionGroupView
import com.google.samples.apps.iosched.ui.widget.CollectionView; //导入依赖的package包/类
@Override
public ViewGroup newCollectionGroupView(Context context, int groupId,
CollectionView.InventoryGroup group, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater) context.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
return (ViewGroup) inflater.inflate(R.layout.video_lib_card_container, parent, false);
}
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:8,代码来源:VideoLibraryFragment.java
示例11: onLoaderReset
import com.google.samples.apps.iosched.ui.widget.CollectionView; //导入依赖的package包/类
@Override
public void onLoaderReset(Loader<Cursor> loader) {
switch (loader.getId()) {
case PeopleIveMetQuery.TOKEN: {
mCollectionView.updateInventory(new CollectionView.Inventory());
break;
}
case PeopleIveMetSubQuery.TOKEN: {
mPlusIds.clear();
break;
}
}
}
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:14,代码来源:PeopleIveMetFragment.java
示例12: getInventory
import com.google.samples.apps.iosched.ui.widget.CollectionView; //导入依赖的package包/类
public CollectionView.Inventory getInventory() {
CollectionView.Inventory inventory = new CollectionView.Inventory();
inventory.addGroup(new CollectionView.InventoryGroup(PeopleIveMetQuery.TOKEN)
.setDisplayCols(1)
.setItemCount(1)
.setDataIndexStart(0)
.setShowHeader(true)
.setHeaderLabel(mContext.getString(R.string.title_people_ive_met)));
return inventory;
}
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:11,代码来源:PeopleIveMetFragment.java
示例13: onCreateView
import com.google.samples.apps.iosched.ui.widget.CollectionView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_video_library, container, false);
mCollectionView = (CollectionView) root.findViewById(R.id.videos_collection_view);
mEmptyView = root.findViewById(android.R.id.empty);
return root;
}
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:8,代码来源:VideoLibraryFragment.java
示例14: onLoaderReset
import com.google.samples.apps.iosched.ui.widget.CollectionView; //导入依赖的package包/类
@Override
public void onLoaderReset(Loader<Cursor> loader) {
switch (loader.getId()) {
case ExpertsQuery.TOKEN: {
mCollectionView.updateInventory(new CollectionView.Inventory());
break;
}
}
}
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:10,代码来源:ExpertsDirectoryFragment.java
示例15: getInventory
import com.google.samples.apps.iosched.ui.widget.CollectionView; //导入依赖的package包/类
/**
* Returns a new instance of {@link CollectionView.Inventory}. It always contains only one
* {@link CollectionView.InventoryGroup}.
*
* @return A new instance of {@link CollectionView.Inventory}
*/
public CollectionView.Inventory getInventory() {
CollectionView.Inventory inventory = new CollectionView.Inventory();
inventory.addGroup(new CollectionView.InventoryGroup(ExpertsQuery.TOKEN)
.setDisplayCols(mDisplayCols)
.setItemCount(mCursor.getCount())
.setDataIndexStart(0)
.setShowHeader(mShowHeader)
.setHeaderLabel(getString(R.string.title_experts_directory)));
return inventory;
}
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:17,代码来源:ExpertsDirectoryFragment.java
示例16: onCreateView
import com.google.samples.apps.iosched.ui.widget.CollectionView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_sessions, container, false);
mCollectionView = (CollectionView) root.findViewById(R.id.sessions_collection_view);
mPreloader = new Preloader(ROWS_TO_PRELOAD);
mCollectionView.setOnScrollListener(mPreloader);
mEmptyView = (TextView) root.findViewById(R.id.empty_text);
mLoadingView = root.findViewById(R.id.loading);
return root;
}
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:12,代码来源:SessionsFragment.java
示例17: updateCollectionView
import com.google.samples.apps.iosched.ui.widget.CollectionView; //导入依赖的package包/类
private void updateCollectionView() {
if (mCursor == null || mTagMetadata == null) {
LOGD(TAG, "updateCollectionView: not ready yet... " + (mCursor == null ? "no cursor." :
"no tag metadata."));
// not ready!
return;
}
LOGD(TAG, "SessionsFragment updating CollectionView... " + (mSessionDataIsFullReload ?
"(FULL RELOAD)" : "(light refresh)"));
mCursor.moveToPosition(-1);
int itemCount = mCursor.getCount();
mMaxDataIndexAnimated = 0;
CollectionView.Inventory inv;
if (itemCount == 0) {
showEmptyView();
inv = new CollectionView.Inventory();
} else {
hideEmptyView();
inv = prepareInventory();
}
Parcelable state = null;
if (!mSessionDataIsFullReload) {
// it's not a full reload, so we want to keep scroll position, etc
state = mCollectionView.onSaveInstanceState();
}
LOGD(TAG, "Updating CollectionView with inventory, # groups = " + inv.getGroupCount()
+ " total items = " + inv.getTotalItemCount());
mCollectionView.setCollectionAdapter(this);
mCollectionView.updateInventory(inv, mSessionDataIsFullReload);
if (state != null) {
mCollectionView.onRestoreInstanceState(state);
}
mSessionDataIsFullReload = false;
}
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:38,代码来源:SessionsFragment.java
示例18: getInventory
import com.google.samples.apps.iosched.ui.widget.CollectionView; //导入依赖的package包/类
/**
* Returns a new instance of {@link CollectionView.Inventory}. It always contains only one
* {@link CollectionView.InventoryGroup}.
*
* @return A new instance of {@link CollectionView.Inventory}
*/
public CollectionView.Inventory getInventory() {
CollectionView.Inventory inventory = new CollectionView.Inventory();
inventory.addGroup(new CollectionView.InventoryGroup(PartnersQuery._TOKEN)
.setDisplayCols(mDisplayCols)
.setItemCount(mCursor.getCount())
.setDataIndexStart(0)
.setShowHeader(false)
.setHeaderLabel(getString(R.string.title_experts_directory)));
return inventory;
}
开发者ID:gdg-bh,项目名称:AppDevFestSudeste2015,代码行数:17,代码来源:PartnersFragment.java
注:本文中的com.google.samples.apps.iosched.ui.widget.CollectionView类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论