Search in sources :

Example 1 with FightSkillPresenter

use of cn.nicolite.palm300heroes.presenter.FightSkillPresenter 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)

Aggregations

ActionBar (android.support.v7.app.ActionBar)1 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 View (android.view.View)1 TextView (android.widget.TextView)1 BindView (butterknife.BindView)1 FightSkillPresenter (cn.nicolite.palm300heroes.presenter.FightSkillPresenter)1 FightSkillAdapter (cn.nicolite.palm300heroes.view.adapter.FightSkillAdapter)1 IFightSkillView (cn.nicolite.palm300heroes.view.iview.IFightSkillView)1 OnNetWorkErrorListener (com.github.jdsjlzx.interfaces.OnNetWorkErrorListener)1 OnRefreshListener (com.github.jdsjlzx.interfaces.OnRefreshListener)1 LRecyclerView (com.github.jdsjlzx.recyclerview.LRecyclerView)1 LRecyclerViewAdapter (com.github.jdsjlzx.recyclerview.LRecyclerViewAdapter)1