当前位置: 首页>>代码示例>>Java>>正文


Java DividerItemDecoration.VERTICAL属性代码示例

本文整理汇总了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);

    }
 
开发者ID:Salman544,项目名称:Todo_App,代码行数:21,代码来源:MainActivity.java

示例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);
}
 
开发者ID:ZafraniTechLLC,项目名称:Companion-For-PUBG-Android,代码行数:22,代码来源:ItemTabFragment.java

示例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();
}
 
开发者ID:swapyx,项目名称:Channelize,代码行数:26,代码来源:CompletedTasksActivity.java

示例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);
}
 
开发者ID:bigjelly,项目名称:ShaddockVideoPlayer,代码行数:19,代码来源:VideoListFragment.java

示例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);
}
 
开发者ID:GrenderG,项目名称:ClothyScanner,代码行数:13,代码来源:MainActivity.java

示例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;
}
 
开发者ID:inovait,项目名称:neatle,代码行数:14,代码来源:ScannerFragment.java

示例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);

    }
 
开发者ID:Salman544,项目名称:Todo_App,代码行数:15,代码来源:TodoFragment.java

示例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();
}
 
开发者ID:ZafraniTechLLC,项目名称:Companion-For-PUBG-Android,代码行数:14,代码来源:NewsFragment.java

示例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);
}
 
开发者ID:struggledhard,项目名称:USay,代码行数:9,代码来源:PostDetailLikesFragment.java

示例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;
}
 
开发者ID:lvaccaro,项目名称:BitcoinBlockExplorer,代码行数:33,代码来源:FragmentTxs.java

示例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();
    }
}
 
开发者ID:lvaccaro,项目名称:BitcoinBlockExplorer,代码行数:31,代码来源:PeerActivity.java

示例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);
}
 
开发者ID:struggledhard,项目名称:USay,代码行数:8,代码来源:SheQuFragment.java

示例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);
}
 
开发者ID:CMPUT301F17T29,项目名称:HabitUp,代码行数:13,代码来源:FollowActivity.java

示例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);
}
 
开发者ID:struggledhard,项目名称:USay,代码行数:9,代码来源:PostDetailCommentFragment.java

示例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);
    }
}
 
开发者ID:RanKKI,项目名称:PSNine,代码行数:8,代码来源:SmartRecyclerView.java


注:本文中的android.support.v7.widget.DividerItemDecoration.VERTICAL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。