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);
}
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));
}
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));
}
});
}
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;
}
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;
}
}
Aggregations