當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。