本文整理汇总了Java中com.jcodecraeer.xrecyclerview.XRecyclerView.setLayoutManager方法的典型用法代码示例。如果您正苦于以下问题:Java XRecyclerView.setLayoutManager方法的具体用法?Java XRecyclerView.setLayoutManager怎么用?Java XRecyclerView.setLayoutManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jcodecraeer.xrecyclerview.XRecyclerView
的用法示例。
在下文中一共展示了XRecyclerView.setLayoutManager方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initView
import com.jcodecraeer.xrecyclerview.XRecyclerView; //导入方法依赖的package包/类
private void initView() {
mDatas = new ArrayList<>();
mRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.srl_refresh);
mRecyclerView = (XRecyclerView) findViewById(R.id.base_recycler_view);
mSearchBtn = (FloatingActionButton) findViewById(R.id.fanju_new_btn_search);
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
mRecyclerView.setLayoutManager(layoutManager);
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
mRecyclerView.setPullRefreshEnabled(false);
mRecyclerView.setLoadingMoreEnabled(false);
mSearchBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showSearchDialog();
}
});
}
示例2: setLinearLayout
import com.jcodecraeer.xrecyclerview.XRecyclerView; //导入方法依赖的package包/类
public void setLinearLayout(Context context, XRecyclerView mRecy) {
LinearLayoutManager layoutManager = new LinearLayoutManager(context);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
mRecy.setLayoutManager(layoutManager);
//设置分隔线
// mRecy.addItemDecoration(new SpacesItemDecoration(1));
mRecy.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
mRecy.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
mRecy.setArrowImageView(R.drawable.abc_icon_down_arrow);
}
示例3: onCreate
import com.jcodecraeer.xrecyclerview.XRecyclerView; //导入方法依赖的package包/类
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_route);
setStatusBar();
routeRecyclerView = (XRecyclerView) findViewById(R.id.recyclerview_route);
no_route = (TextView) findViewById(R.id.no_route);
routeRecyclerView.setLayoutManager(new LinearLayoutManager(this));
// routeList = getAllPoints();
routeList = new ArrayList<RouteRecord>();
RouteDBHelper helper = new RouteDBHelper(this);
db = helper.getWritableDatabase();
itemCount = getItemCount();
routeList = loadPage();
if (routeList != null) {
routeAdapter = new MyRouteAdapter(this, routeList);
routeRecyclerView.setAdapter(routeAdapter);
routeRecyclerView.addItemDecoration(new MyRouteDividerDecoration(10));
routeAdapter.setOnClickListener(this);
}else{
no_route.setVisibility(View.VISIBLE);
}
routeRecyclerView.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
routeRecyclerView.setLoadingMoreProgressStyle(ProgressStyle.BallScale);
routeRecyclerView.setArrowImageView(R.drawable.iconfont_downgrey);
routeRecyclerView.setPullRefreshEnabled(false);
// View header = LayoutInflater.from(this).inflate(R.layout.recyclerview_header, (ViewGroup)findViewById(android.R.id.content),false);
// routeRecyclerView.addHeaderView(header);
routeRecyclerView.setLoadingListener(new XRecyclerView.LoadingListener() {
@Override
public void onRefresh() {
// Toast.makeText(MyRouteActivity.this, "onRefresh", Toast.LENGTH_SHORT).show();
routeRecyclerView.refreshComplete();
}
@Override
public void onLoadMore() {
// Toast.makeText(MyRouteActivity.this, "onLoadMore", Toast.LENGTH_SHORT).show();
loadPage();
routeRecyclerView.loadMoreComplete();
routeAdapter.notifyDataSetChanged();
}
});
}
示例4: setupRecycleView
import com.jcodecraeer.xrecyclerview.XRecyclerView; //导入方法依赖的package包/类
private void setupRecycleView() {
recyclerView = (XRecyclerView) findViewById(R.id.base_recycler_view);
if (recyclerView != null) {
recyclerView.setHasFixedSize(true);
}
LinearLayoutManager mLayoutManager = new LinearLayoutManager(FindBookActivity.this);
mLayoutManager.setOrientation(OrientationHelper.VERTICAL);
recyclerView.setLayoutManager(mLayoutManager);
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setLoadingMoreEnabled(false);
recyclerView.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
recyclerView.setLoadingListener(new XRecyclerView.LoadingListener() {
@Override
public void onRefresh() {
sendParseDataMessage(REFRESH_START);
}
@Override
public void onLoadMore() {
}
});
mAdapter = new FindRecycleAdapter(this, mDatas);
mAdapter.setOnItemClickListener(new FindRecycleAdapter.OnItemClickListener() {
@Override
public void onItemClick(View view, int position) {
Intent intent = new Intent(FindBookActivity.this, BookDetailActivity.class);
intent.putExtra("book", mDatas.get(position));
ActivityOptionsCompat options =
ActivityOptionsCompat.makeSceneTransitionAnimation(FindBookActivity.this,
view.findViewById(R.id.iv_book_img),
getString(R.string.transition_book_img));
ActivityCompat.startActivity(FindBookActivity.this, intent, options.toBundle());
}
});
recyclerView.setAdapter(mAdapter);
}