本文整理汇总了Java中eu.davidea.flexibleadapter.common.SmoothScrollGridLayoutManager类的典型用法代码示例。如果您正苦于以下问题:Java SmoothScrollGridLayoutManager类的具体用法?Java SmoothScrollGridLayoutManager怎么用?Java SmoothScrollGridLayoutManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SmoothScrollGridLayoutManager类属于eu.davidea.flexibleadapter.common包,在下文中一共展示了SmoothScrollGridLayoutManager类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createNewGridLayoutManager
import eu.davidea.flexibleadapter.common.SmoothScrollGridLayoutManager; //导入依赖的package包/类
@Override
protected GridLayoutManager createNewGridLayoutManager() {
GridLayoutManager gridLayoutManager = new SmoothScrollGridLayoutManager(getActivity(), mColumnCount);
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
// NOTE: If you use simple integers to identify the ViewType,
// here, you should use them and not Layout integers
switch (mAdapter.getItemViewType(position)) {
case R.layout.recycler_scrollable_expandable_item:
case R.layout.recycler_scrollable_header_item:
case R.layout.recycler_scrollable_footer_item:
case R.layout.recycler_scrollable_layout_item:
case R.layout.recycler_scrollable_uls_item:
case R.layout.progress_item:
return mColumnCount;
default:
return 1;
}
}
});
return gridLayoutManager;
}
示例2: createNewGridLayoutManager
import eu.davidea.flexibleadapter.common.SmoothScrollGridLayoutManager; //导入依赖的package包/类
@Override
protected GridLayoutManager createNewGridLayoutManager() {
GridLayoutManager gridLayoutManager = new SmoothScrollGridLayoutManager(getActivity(), mColumnCount);
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
// NOTE: If you use simple integers to identify the ViewType,
// here, you should use them and not Layout integers
switch (mAdapter.getItemViewType(position)) {
case R.layout.recycler_scrollable_layout_item:
case R.layout.recycler_scrollable_uls_item:
case R.layout.recycler_header_item:
case R.layout.recycler_expandable_header_item:
case R.layout.recycler_expandable_item:
return mColumnCount;
default:
return 1;
}
}
});
return gridLayoutManager;
}
示例3: createNewGridLayoutManager
import eu.davidea.flexibleadapter.common.SmoothScrollGridLayoutManager; //导入依赖的package包/类
@Override
protected GridLayoutManager createNewGridLayoutManager() {
mAdapter.setAnimationEntryStep(false);
GridLayoutManager gridLayoutManager = new SmoothScrollGridLayoutManager(getActivity(), mColumnCount);
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
// NOTE: If you use simple integers to identify the ViewType,
// here, you should use them and not Layout integers
switch (mAdapter.getItemViewType(position)) {
case R.layout.recycler_scrollable_usecase_item:
case R.layout.recycler_scrollable_layout_item:
return mColumnCount;
default:
return 1;
}
}
});
return gridLayoutManager;
}
示例4: createNewGridLayoutManager
import eu.davidea.flexibleadapter.common.SmoothScrollGridLayoutManager; //导入依赖的package包/类
@Override
protected GridLayoutManager createNewGridLayoutManager() {
GridLayoutManager gridLayoutManager = new SmoothScrollGridLayoutManager(getActivity(), mColumnCount);
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
// NOTE: If you use simple integers to identify the ViewType,
// here, you should use them and not Layout integers
switch (mAdapter.getItemViewType(position)) {
case R.layout.recycler_scrollable_expandable_item:
case R.layout.recycler_scrollable_header_item:
case R.layout.recycler_scrollable_footer_item:
case R.layout.recycler_scrollable_layout_item:
case R.layout.recycler_scrollable_uls_item:
case R.layout.progress_item:
return mColumnCount;
default:
return 1;
}
}
});
return gridLayoutManager;
}
示例5: createNewGridLayoutManager
import eu.davidea.flexibleadapter.common.SmoothScrollGridLayoutManager; //导入依赖的package包/类
@Override
protected GridLayoutManager createNewGridLayoutManager() {
GridLayoutManager gridLayoutManager = new SmoothScrollGridLayoutManager(getActivity(), mColumnCount);
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
// NOTE: If you use simple integers to identify the ViewType,
// here, you should use them and not Layout integers
switch (mAdapter.getItemViewType(position)) {
case R.layout.recycler_scrollable_layout_item:
case R.layout.recycler_scrollable_uls_item:
case R.layout.recycler_header_item:
case R.layout.recycler_expandable_header_item:
case R.layout.recycler_expandable_item:
return mColumnCount;
default:
return 1;
}
}
});
return gridLayoutManager;
}
示例6: createNewGridLayoutManager
import eu.davidea.flexibleadapter.common.SmoothScrollGridLayoutManager; //导入依赖的package包/类
@Override
protected GridLayoutManager createNewGridLayoutManager() {
GridLayoutManager gridLayoutManager = new SmoothScrollGridLayoutManager(getActivity(), mColumnCount);
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
//noinspection ConstantConditions
return mAdapter.getItem(position).getSpanSize(mColumnCount, position);
}
});
return gridLayoutManager;
}
示例7: createNewGridLayoutManager
import eu.davidea.flexibleadapter.common.SmoothScrollGridLayoutManager; //导入依赖的package包/类
@Override
protected GridLayoutManager createNewGridLayoutManager() {
GridLayoutManager gridLayoutManager = new SmoothScrollGridLayoutManager(getActivity(), mColumnCount);
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
return mAdapter.getItem(position).getSpanSize(mColumnCount, position);
}
});
return gridLayoutManager;
}
示例8: createNewGridLayoutManager
import eu.davidea.flexibleadapter.common.SmoothScrollGridLayoutManager; //导入依赖的package包/类
@Override
protected GridLayoutManager createNewGridLayoutManager() {
mAdapter.setAnimationEntryStep(false);
GridLayoutManager gridLayoutManager = new SmoothScrollGridLayoutManager(getActivity(), mColumnCount);
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
return mAdapter.getItem(position).getSpanSize(mColumnCount, position);
}
});
return gridLayoutManager;
}
示例9: createNewGridLayoutManager
import eu.davidea.flexibleadapter.common.SmoothScrollGridLayoutManager; //导入依赖的package包/类
protected GridLayoutManager createNewGridLayoutManager() {
return new SmoothScrollGridLayoutManager(getActivity(), mColumnCount);
}
示例10: onCreate
import eu.davidea.flexibleadapter.common.SmoothScrollGridLayoutManager; //导入依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTitle("About Us");
setContentView(R.layout.activity_about);
aboutRecyclerView = (RecyclerView) findViewById(R.id.about_us_recyclerview);
aboutAdapter = new FlexibleAdapter<>(null);
GridLayoutManager manager = new SmoothScrollGridLayoutManager(this, 2);
manager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
if (aboutAdapter.isHeader(aboutAdapter.getItem(position))) {
//Headers occupy 2 spans, which is the entire grid
return 2;
} else {
//Normally occupy 1 span
return 1;
}
}
});
aboutRecyclerView.setLayoutManager(manager);
aboutRecyclerView.setAdapter(aboutAdapter);
aboutRecyclerView.setItemAnimator(new FlexibleItemAnimator());
aboutAdapter.setDisplayHeadersAtStartUp(true);
DeveloperHeaderItem androidHeader = new DeveloperHeaderItem("Android Team");
DeveloperHeaderItem iOSHeader = new DeveloperHeaderItem("iOS Team");
DeveloperHeaderItem teacherHeader = new DeveloperHeaderItem("Instructors");
aboutAdapter.addItem(new DeveloperItem(androidHeader, "Mitchell Skaggs", "Android Team Lead\n\nUniversity:\n\nMissouri University of Science and Technology", R.drawable.face_skaggs,
new LinkItem(R.drawable.github_box, "https://github.com/magneticflux-"),
new LinkItem(R.drawable.linkedin_box, "https://www.linkedin.com/in/mitchell-s-16085b13b")
));
aboutAdapter.addItem(new DeveloperItem(androidHeader, "Keturah Gadson", "University:\n\nHarvard University", R.drawable.face_gadson,
new LinkItem(R.drawable.github_box, "https://github.com/gadsonk")
));
aboutAdapter.addItem(new DeveloperItem(androidHeader, "Ethan Holtgrieve", "University:\n\nTruman State University", R.drawable.face_holtgrieve,
new LinkItem(R.drawable.github_box, "https://github.com/holtgrie")
));
aboutAdapter.addItem(new DeveloperItem(androidHeader, "Nathan Skelton", "University:\n\nMissouri University of Science and Technology", R.drawable.face_skelton,
new LinkItem(R.drawable.github_box, "https://github.com/skeltonn"),
new LinkItem(R.drawable.linkedin_box, "https://www.linkedin.com/in/nathaniel-skelton-8815a413b/")
));
aboutAdapter.addItem(new DeveloperItem(iOSHeader, "Joshua Zahner", "iOS Team Lead\n\nUniversity:\n\nUniversity of Miami", R.drawable.face_zahner,
new LinkItem(R.drawable.github_box, "https://github.com/Ovec8hkin"),
new LinkItem(R.drawable.linkedin_box, "https://www.linkedin.com/in/joshuazahner/")
));
aboutAdapter.addItem(new DeveloperItem(iOSHeader, "Mustapha Barrie", "University:\n\nWashington University in St. Louis", R.drawable.face_barrie,
new LinkItem(R.drawable.github_box, "https://github.com/MustaphaB")
));
aboutAdapter.addItem(new DeveloperItem(iOSHeader, "Kevin Bowers", "University:\n\nUniversity of Missouri - Columbia", R.drawable.face_bowers,
new LinkItem(R.drawable.github_box, "https://github.com/KevinBowers73")
));
aboutAdapter.addItem(new DeveloperItem(iOSHeader, "Micah Thompkins", "University:\n\nNorthwestern University", R.drawable.face_thompkins,
new LinkItem(R.drawable.github_box, "https://github.com/MicahThompkins")
));
aboutAdapter.addItem(new DeveloperItem(teacherHeader, "Mr. Simmons", "Supervisor, Representative, Philosopher", R.drawable.face_simmons));
aboutAdapter.addItem(new SecretDeveloperItem(teacherHeader, null, null, 0));
}
示例11: createNewGridLayoutManager
import eu.davidea.flexibleadapter.common.SmoothScrollGridLayoutManager; //导入依赖的package包/类
protected GridLayoutManager createNewGridLayoutManager() {
return new SmoothScrollGridLayoutManager(getActivity(), mColumnCount);
}