Search in sources :

Example 41 with DividerItemDecoration

use of android.support.v7.widget.DividerItemDecoration in project Palm300Heroes by nicolite.

the class FightSkillActivity method doBusiness.

@Override
protected void doBusiness() {
    toolbarTitle.setText("战斗技能");
    setSupportActionBar(toolbar);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            finish();
        }
    });
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setDisplayShowTitleEnabled(false);
    }
    lRecyclerView.setLayoutManager(new LinearLayoutManager(context, OrientationHelper.VERTICAL, false));
    lRecyclerViewAdapter = new LRecyclerViewAdapter(new FightSkillAdapter(context, dataList));
    lRecyclerView.setAdapter(lRecyclerViewAdapter);
    lRecyclerView.addItemDecoration(new DividerItemDecoration(context, OrientationHelper.VERTICAL));
    lRecyclerView.setLoadMoreEnabled(false);
    fightSkillPresenter = new FightSkillPresenter(this, this);
    lRecyclerView.setOnRefreshListener(new OnRefreshListener() {

        @Override
        public void onRefresh() {
            fightSkillPresenter.showFightSkill(true);
        }
    });
    lRecyclerView.setOnNetWorkErrorListener(new OnNetWorkErrorListener() {

        @Override
        public void reload() {
            fightSkillPresenter.showFightSkill(true);
        }
    });
    fightSkillPresenter.showFightSkill(false);
}
Also used : OnNetWorkErrorListener(com.github.jdsjlzx.interfaces.OnNetWorkErrorListener) LRecyclerViewAdapter(com.github.jdsjlzx.recyclerview.LRecyclerViewAdapter) FightSkillPresenter(cn.nicolite.palm300heroes.presenter.FightSkillPresenter) FightSkillAdapter(cn.nicolite.palm300heroes.view.adapter.FightSkillAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(android.support.v7.widget.DividerItemDecoration) IFightSkillView(cn.nicolite.palm300heroes.view.iview.IFightSkillView) BindView(butterknife.BindView) TextView(android.widget.TextView) LRecyclerView(com.github.jdsjlzx.recyclerview.LRecyclerView) View(android.view.View) ActionBar(android.support.v7.app.ActionBar) OnRefreshListener(com.github.jdsjlzx.interfaces.OnRefreshListener)

Example 42 with DividerItemDecoration

use of android.support.v7.widget.DividerItemDecoration in project okhttp-OkGo by jeasonlzy.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    initToolBar(toolbar, false, "");
    initData();
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
    recyclerView.setAdapter(new MainAdapter(this));
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.lzy.demo.base.DividerItemDecoration) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Example 43 with DividerItemDecoration

use of android.support.v7.widget.DividerItemDecoration in project okhttp-OkGo by jeasonlzy.

the class DownloadActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_download);
    initToolBar(toolbar, true, "下载管理");
    initData();
    downloadManager = DownloadService.getDownloadManager();
    downloadManager.setTargetFolder(Environment.getExternalStorageDirectory().getAbsolutePath() + "/aaa/");
    targetFolder.setText("下载路径: " + downloadManager.getTargetFolder());
    sbCorePoolSize.setMax(5);
    sbCorePoolSize.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            downloadManager.getThreadPool().setCorePoolSize(progress);
            tvCorePoolSize.setText(String.valueOf(progress));
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        }
    });
    sbCorePoolSize.setProgress(3);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
    adapter = new MainAdapter(this);
    recyclerView.setAdapter(adapter);
    openManager.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            startActivity(new Intent(getApplicationContext(), DownloadManagerActivity.class));
        }
    });
}
Also used : SeekBar(android.widget.SeekBar) Intent(android.content.Intent) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.lzy.demo.base.DividerItemDecoration) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Example 44 with DividerItemDecoration

use of android.support.v7.widget.DividerItemDecoration in project chuck by jgilfelt.

the class TransactionListFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.chuck_fragment_transaction_list, container, false);
    if (view instanceof RecyclerView) {
        Context context = view.getContext();
        RecyclerView recyclerView = (RecyclerView) view;
        recyclerView.setLayoutManager(new LinearLayoutManager(context));
        recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL_LIST));
        adapter = new TransactionAdapter(getContext(), listener);
        recyclerView.setAdapter(adapter);
    }
    return view;
}
Also used : Context(android.content.Context) RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.readystatesoftware.chuck.internal.support.DividerItemDecoration) SearchView(android.support.v7.widget.SearchView) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Example 45 with DividerItemDecoration

use of android.support.v7.widget.DividerItemDecoration in project QuickReturn by lawloretienne.

the class QuickReturnFooterRecyclerViewFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    mValues = getResources().getStringArray(R.array.countries);
    if (mLayoutManagerType.equals("linear")) {
        CountriesLinearLayoutAdapter countriesLinearLayoutAdapter = new CountriesLinearLayoutAdapter(Arrays.asList(mValues));
        RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getActivity());
        mRecyclerView.setLayoutManager(layoutManager);
        mRecyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), null));
        mRecyclerView.setAdapter(countriesLinearLayoutAdapter);
    } else if (mLayoutManagerType.equals("grid")) {
        CountriesGridLayoutAdapter countriesGridLayoutAdapter = new CountriesGridLayoutAdapter(Arrays.asList(mValues));
        RecyclerView.LayoutManager layoutManager = new GridLayoutManager(getActivity(), 2);
        mRecyclerView.setLayoutManager(layoutManager);
        mRecyclerView.addItemDecoration(new GridSpacesItemDecoration(QuickReturnUtils.dp2px(getActivity(), 8)));
        mRecyclerView.setAdapter(countriesGridLayoutAdapter);
    }
    int footerHeight = getActivity().getResources().getDimensionPixelSize(R.dimen.footer_height);
    switch(mQuickReturnAnimationType) {
        case TRANSLATION_SIMPLE:
            if (mLayoutManagerType.equals("grid")) {
                mScrollListener = new QuickReturnRecyclerViewOnScrollListener.Builder(QuickReturnViewType.FOOTER).footer(mQuickReturnTextView).minFooterTranslation(footerHeight).columnCount(2).build();
            } else {
                mScrollListener = new QuickReturnRecyclerViewOnScrollListener.Builder(QuickReturnViewType.FOOTER).footer(mQuickReturnTextView).minFooterTranslation(footerHeight).build();
            }
            mRecyclerView.addOnScrollListener(mScrollListener);
            break;
        case TRANSLATION_SNAP:
            if (mLayoutManagerType.equals("grid")) {
                mScrollListener = new QuickReturnRecyclerViewOnScrollListener.Builder(QuickReturnViewType.FOOTER).footer(mQuickReturnTextView).minFooterTranslation(footerHeight).columnCount(2).isSnappable(true).build();
            } else {
                mScrollListener = new QuickReturnRecyclerViewOnScrollListener.Builder(QuickReturnViewType.FOOTER).footer(mQuickReturnTextView).minFooterTranslation(footerHeight).isSnappable(true).build();
            }
            mRecyclerView.addOnScrollListener(mScrollListener);
            break;
        case TRANSLATION_ANTICIPATE_OVERSHOOT:
            if (mLayoutManagerType.equals("grid")) {
                mScrollListener2 = new SpeedyQuickReturnRecyclerViewOnScrollListener.Builder(getActivity(), QuickReturnViewType.FOOTER).footer(mQuickReturnTextView).columnCount(2).build();
            } else {
                mScrollListener2 = new SpeedyQuickReturnRecyclerViewOnScrollListener.Builder(getActivity(), QuickReturnViewType.FOOTER).footer(mQuickReturnTextView).build();
            }
            mRecyclerView.addOnScrollListener(mScrollListener2);
            break;
        default:
            if (mLayoutManagerType.equals("grid")) {
                mScrollListener = new QuickReturnRecyclerViewOnScrollListener.Builder(QuickReturnViewType.FOOTER).footer(mQuickReturnTextView).minFooterTranslation(footerHeight).columnCount(2).build();
            } else {
                mScrollListener = new QuickReturnRecyclerViewOnScrollListener.Builder(QuickReturnViewType.FOOTER).footer(mQuickReturnTextView).minFooterTranslation(footerHeight).build();
            }
            mRecyclerView.addOnScrollListener(mScrollListener);
            break;
    }
}
Also used : QuickReturnRecyclerViewOnScrollListener(com.etiennelawlor.quickreturn.library.listeners.QuickReturnRecyclerViewOnScrollListener) SpeedyQuickReturnRecyclerViewOnScrollListener(com.etiennelawlor.quickreturn.library.listeners.SpeedyQuickReturnRecyclerViewOnScrollListener) SpeedyQuickReturnRecyclerViewOnScrollListener(com.etiennelawlor.quickreturn.library.listeners.SpeedyQuickReturnRecyclerViewOnScrollListener) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.etiennelawlor.quickreturn.itemdecorations.DividerItemDecoration) GridLayoutManager(android.support.v7.widget.GridLayoutManager) GridLayoutManager(android.support.v7.widget.GridLayoutManager) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) CountriesGridLayoutAdapter(com.etiennelawlor.quickreturn.adapters.CountriesGridLayoutAdapter) CountriesLinearLayoutAdapter(com.etiennelawlor.quickreturn.adapters.CountriesLinearLayoutAdapter) RecyclerView(android.support.v7.widget.RecyclerView) GridSpacesItemDecoration(com.etiennelawlor.quickreturn.itemdecorations.GridSpacesItemDecoration)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)73 RecyclerView (android.support.v7.widget.RecyclerView)42 View (android.view.View)36 TextView (android.widget.TextView)23 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)19 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)15 ImageView (android.widget.ImageView)14 DividerItemDecoration (com.wm.remusic.widget.DividerItemDecoration)9 Drawable (android.graphics.drawable.Drawable)8 DividerItemDecoration (de.madcyph3r.example.DividerItemDecoration)8 DividerItemDecoration (io.hefuyi.listener.widget.DividerItemDecoration)7 Nullable (android.support.annotation.Nullable)6 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)6 Context (android.content.Context)5 Toolbar (android.support.v7.widget.Toolbar)5 Intent (android.content.Intent)4 ActionBar (android.support.v7.app.ActionBar)4 DividerItemDecoration (com.lzy.demo.base.DividerItemDecoration)4 DividerItemDecoration (org.michenux.drodrolib.ui.recyclerview.DividerItemDecoration)4 TargetApi (android.annotation.TargetApi)3