本文整理汇总了Java中android.support.v7.widget.DividerItemDecoration.VERTICAL属性的典型用法代码示例。如果您正苦于以下问题:Java DividerItemDecoration.VERTICAL属性的具体用法?Java DividerItemDecoration.VERTICAL怎么用?Java DividerItemDecoration.VERTICAL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.support.v7.widget.DividerItemDecoration
的用法示例。
在下文中一共展示了DividerItemDecoration.VERTICAL属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showRecyclerAdapter
private void showRecyclerAdapter() {
mAdapter = new NavAdapter(this,mArrayList, Typeface.createFromAsset(getAssets(),"fonts/Roboto-Light.ttf"));
RecyclerView rec = (RecyclerView)(findViewById(R.id.recyclerNav));
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
rec.setLayoutManager(linearLayoutManager);
rec.setAdapter(mAdapter);
mAdapter.onRecyclerClick(this);
if(mArrayList.size() == 3)
linearLayoutManager.scrollToPosition(mArrayList.size()+1);
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(rec.getContext(),
DividerItemDecoration.VERTICAL);
rec.addItemDecoration(dividerItemDecoration);
ItemTouchHelper helper = new ItemTouchHelper(callBack());
helper.attachToRecyclerView(rec);
}
示例2: onViewCreated
@Override
public void onViewCreated(@NonNull final View view, @Nullable final Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
final Bundle args = getArguments();
if (args == null || !args.containsKey(ARG_CATEGORY_NAME)) {
return;
}
final Category.Name categoryName = (Category.Name) args.getSerializable(ARG_CATEGORY_NAME);
if (this.recyclerView == null || categoryName == null) {
return;
}
final Category<Item> category = PUBGApplication.getInstance().getItems().getCategories().get(categoryName);
if (category == null) {
return;
}
final DividerItemDecoration itemDecoration = new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL);
this.recyclerView.addItemDecoration(itemDecoration);
this.recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
final ItemRecyclerViewAdapter<Item> adapter = new ItemRecyclerViewAdapter<>(category.getItems());
adapter.setListener(this);
this.recyclerView.setAdapter(adapter);
}
示例3: onCreate
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_completed_tasks);
Toolbar toolbarCompletedTasks = (Toolbar) findViewById(R.id.toolbar_task_completed);
setSupportActionBar(toolbarCompletedTasks);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mRecyclerView = (RecyclerView)findViewById(R.id.recyclerView_completed);
mTextEmptyList = (TextView) findViewById(R.id.text_noTask);
mLayoutManager = new LinearLayoutManager(getApplicationContext());
mDbHelper = new DBHelper(getApplicationContext());
mCompletedList = new ArrayList<>();
mAdapter = new CompletedTasksAdapter(mCompletedList,CompletedTasksActivity.this);
mRecyclerView.setAdapter(mAdapter);
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setLayoutManager(mLayoutManager);
RecyclerView.ItemDecoration itemDecoration = new
DividerItemDecoration(this,DividerItemDecoration.VERTICAL);
mRecyclerView.addItemDecoration(itemDecoration);
setClickListeners();
//Load all saved Tasks
new LoadCompletedTasks().execute();
}
示例4: initWidget
@Override
protected void initWidget(View root) {
super.initWidget(root);
TextView textView =findView(R.id.toolbar_title);
textView.setText(R.string.tab_name_video_list);
mRecyclerView = findView(R.id.pull_recycler_view);
// 初始化PullRecyclerView
mLayoutManager = new XLinearLayoutManager(getContext());
mRecyclerView.setLayoutManager(mLayoutManager);
DividerItemDecoration itemDecoration = new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL);
itemDecoration.setDrawable(getResources().getDrawable(R.drawable.shape_simple_item_decoration));
mRecyclerView.addItemDecoration(itemDecoration);
mAdpater = new VideoListAdpater(getContext(), R.layout.lay_item_video_file, new ArrayList<VideoInfo>(),getFragmentManager());
mRecyclerView.setAdapter(mAdpater);
mRecyclerView.enablePullRefresh(true); // 开启下拉刷新,默认即为true,可不用设置
mRecyclerView.enableLoadMore(false);
mRecyclerView.setOnRecyclerRefreshListener(this);
}
示例5: setupViews
private void setupViews() {
ButterKnife.bind(this);
setSupportActionBar(toolbar);
machineRecyclerView.setLayoutManager(new LinearLayoutManager(this));
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(machineRecyclerView.getContext(),
DividerItemDecoration.VERTICAL);
machineRecyclerView.addItemDecoration(dividerItemDecoration);
machineRecyclerView.setHasFixedSize(true);
machineRecyclerView.setItemAnimator(new DefaultItemAnimator());
machineRecyclerView.setAdapter(
new MachineAdapter(DBAccessor.getMachines(ClothyScannerDBHelper.getClothyScannerDBHelper(this)), this, this));
registerForContextMenu(machineRecyclerView);
}
示例6: onCreateView
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
RecyclerView view = (RecyclerView) inflater.inflate(R.layout.fragment_scanner_list, container, false);
DividerItemDecoration dividerItemDecoration =
new DividerItemDecoration(view.getContext(), DividerItemDecoration.VERTICAL);
view.addItemDecoration(dividerItemDecoration);
adapter = new ScannerRecyclerViewAdapter(listener);
view.setAdapter(adapter);
return view;
}
示例7: displayRecyclerAdapter
private void displayRecyclerAdapter() {
mAdapter = new TodoAdapter(getContext(),mArrayList,Typeface.createFromAsset(getActivity().getAssets(),"fonts/Roboto-Regular.ttf"));
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
mRecyclerView.setAdapter(mAdapter);
mAdapter.setOnClick(this);
DividerItemDecoration itemDecorator = new DividerItemDecoration(mRecyclerView.getContext(),
DividerItemDecoration.VERTICAL);
mRecyclerView.addItemDecoration(itemDecorator);
ItemTouchHelper helper = new ItemTouchHelper(callBack());
helper.attachToRecyclerView(mRecyclerView);
}
示例8: onViewCreated
@Override
public void onViewCreated(@NonNull final View view,
@Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
final DividerItemDecoration itemDecoration = new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL);
this.recyclerView.addItemDecoration(itemDecoration);
this.recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
this.adapter = new NewsAdapter();
adapter.setListener(this);
this.recyclerView.setAdapter(adapter);
final PUBGNewsFetch newsFetch = new PUBGNewsFetch(this);
newsFetch.execute();
}
示例9: initLikesRecycler
private void initLikesRecycler() {
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity(),
LinearLayoutManager.VERTICAL, false);
mPostDetailLikesRecycler.setLayoutManager(layoutManager);
mPostDetailLikesRecycler.setAdapter(mLikesAdapter);
DividerItemDecoration dividerItemDecoration =
new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL);
mPostDetailLikesRecycler.addItemDecoration(dividerItemDecoration);
}
示例10: onCreateView
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_txs, container, false);
tvStatus = (TextView) rootView.findViewById(R.id.tvStatus);
mRecyclerView = (RecyclerView) rootView.findViewById(R.id.my_recycler_view);
// use this setting to improve performance if you know that changes
// in content do not change the layout size of the RecyclerView
mRecyclerView.setHasFixedSize(true);
// use a linear layout manager
mLayoutManager = new LinearLayoutManager(getContext());
mRecyclerView.setLayoutManager(mLayoutManager);
DividerItemDecoration horizontalDecoration = new DividerItemDecoration(mRecyclerView.getContext(),
DividerItemDecoration.VERTICAL);
Drawable horizontalDivider = ContextCompat.getDrawable(getActivity(), R.drawable.divider_grey);
horizontalDecoration.setDrawable(horizontalDivider);
mRecyclerView.addItemDecoration(horizontalDecoration);
// specify an adapter (see also next example)
mAdapter = new TxsAdapter(transactions);
mAdapter.setOnItemClickListener(this);
mRecyclerView.setAdapter(mAdapter);
refreshUI();
return rootView;
}
示例11: onCreate
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_items);
mRecyclerView = (RecyclerView) findViewById(R.id.recycler_view);
// use this setting to improve performance if you know that changes
// in content do not change the layout size of the RecyclerView
mRecyclerView.setHasFixedSize(true);
// use a linear layout manager
mLayoutManager = new LinearLayoutManager(this);
mRecyclerView.setLayoutManager(mLayoutManager);
DividerItemDecoration horizontalDecoration = new DividerItemDecoration(mRecyclerView.getContext(),
DividerItemDecoration.VERTICAL);
Drawable horizontalDivider = ContextCompat.getDrawable(this, R.drawable.divider_grey);
horizontalDecoration.setDrawable(horizontalDivider);
mRecyclerView.addItemDecoration(horizontalDecoration);
// specify an adapter (see also next example)
mAdapter = new ItemAdapter(mDataset);
mRecyclerView.setAdapter(mAdapter);
try {
getPeer();
} catch (Exception e) {
e.printStackTrace();
}
}
示例12: initRecycler
private void initRecycler() {
mLayoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false);
mShequRecycler.setLayoutManager(mLayoutManager);
mShequRecycler.setAdapter(mSheQuAdapter);
DividerItemDecoration dividerItemDecoration =
new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL);
mShequRecycler.addItemDecoration(dividerItemDecoration);
}
示例13: onCreate
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.follow_request);
requestList = new ArrayList<>();
requestsListView = (RecyclerView) findViewById(R.id.request_listview);
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
requestsListView.setLayoutManager(layoutManager);
RecyclerView.ItemDecoration itemDecoration = new DividerItemDecoration(this, DividerItemDecoration.VERTICAL);
requestsListView.addItemDecoration(itemDecoration);
}
示例14: initCommentRecycler
private void initCommentRecycler() {
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity(),
LinearLayoutManager.VERTICAL, false);
mPostDetailCommentRecycler.setLayoutManager(layoutManager);
mPostDetailCommentRecycler.setAdapter(mAdapter);
DividerItemDecoration dividerItemDecoration =
new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL);
mPostDetailCommentRecycler.addItemDecoration(dividerItemDecoration);
}
示例15: setDivider
public void setDivider() {
Drawable d_divider = getContext().getDrawable(R.drawable.recyclerview_divider);
if (d_divider != null) {
DividerItemDecoration divider = new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL);
divider.setDrawable(d_divider);
addItemDecoration(divider);
}
}