本文整理汇总了Java中com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration类的典型用法代码示例。如果您正苦于以下问题:Java HorizontalDividerItemDecoration类的具体用法?Java HorizontalDividerItemDecoration怎么用?Java HorizontalDividerItemDecoration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HorizontalDividerItemDecoration类属于com.yqritc.recyclerviewflexibledivider包,在下文中一共展示了HorizontalDividerItemDecoration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initView
import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration; //导入依赖的package包/类
private void initView() {
mToolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(mToolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(false);
mRvLayer = (RecyclerView) findViewById(R.id.rv_layer);
mRvRoom = (RecyclerView) findViewById(R.id.rv_room);
mSvRoom = (ObservableHorizontalScrollView) findViewById(R.id.sv_room);
mRvLayer.setLayoutManager(new LinearLayoutManager(this));
mRvLayer.addItemDecoration(new HorizontalDividerItemDecoration.Builder(this)
.color(Color.parseColor("#f5f5f5"))
.size(1)
.build()
);
mRvRoom.setLayoutManager(new LinearLayoutManager(this));
mRvRoom.addItemDecoration(new HorizontalDividerItemDecoration.Builder(this)
.color(Color.parseColor("#f5f5f5"))
.size(1)
.build()
);
}
示例2: onCreate
import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample);
SimpleAdapter adapter = new SimpleAdapter(this);
LinearLayoutManager manager = new LinearLayoutManager(this);
manager.setOrientation(OrientationHelper.VERTICAL);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.main_recyclerview);
recyclerView.setLayoutManager(manager);
recyclerView.setAdapter(adapter);
recyclerView.addItemDecoration(new HorizontalDividerItemDecoration.Builder(this)
.drawable(R.drawable.sample)
.size(15)
.build());
}
示例3: onCreate
import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.main_recyclerview);
// Workaround for dash path effect
// https://code.google.com/p/android/issues/detail?id=29944
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
recyclerView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
ComplexAdapter adapter = new ComplexAdapter(this);
LinearLayoutManager manager = new LinearLayoutManager(this);
manager.setOrientation(OrientationHelper.VERTICAL);
recyclerView.setLayoutManager(manager);
recyclerView.setAdapter(adapter);
recyclerView.addItemDecoration(new HorizontalDividerItemDecoration.Builder(this)
.paintProvider(adapter)
.visibilityProvider(adapter)
.marginProvider(adapter)
.build());
}
示例4: onAfterViews
import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration; //导入依赖的package包/类
@Override
public void onAfterViews() {
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
mRecyclerView.setHasFixedSize(true);
mRecyclerView.addItemDecoration(new HorizontalDividerItemDecoration.Builder(getActivity())
.marginResId(R.dimen.divider_margin_left, R.dimen.divider_margin_right) // 设置分割线距离两端距离
// .color(Color.RED) // 设置分割线颜色
// .sizeResId(R.dimen.divider) // 设置分割线粗细
// .drawable(R.drawable.abc_list_pressed_holo_light) // 设置分割线背景
.build());
List<ItemEntity> list = new ArrayList<>();
list.add(new ItemEntity(R.string.tools_check_exchange_rate, R.mipmap.ic_check_exchange_rate));
list.add(new ItemEntity(R.string.tools_check_hs_code, R.mipmap.ic_check_hs_code));
list.add(new ItemEntity(R.string.tools_declare_factor, R.mipmap.ic_declare_factor));
list.add(new ItemEntity(R.string.tools_check_tax_refund_rate, R.mipmap.ic_check_tax_refund_rate));
list.add(new ItemEntity(R.string.tools_check_logistics, R.mipmap.ic_check_logistics));
if (mAdapter == null)
mAdapter = new MyToolsFragmentAdapter(list);
mRecyclerView.setAdapter(mAdapter);
}
示例5: initViews
import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration; //导入依赖的package包/类
@Override
protected void initViews(@Nullable Bundle savedInstanceState) {
mActMainBinding = DataBindingUtil.setContentView(this, R.layout.act_main);
mAdapter = new BaseDBAdapter<>(this, R.layout.item_db_service_shop);
mOptimumRecyclerView = mActMainBinding.optimumRv;
mOptimumRecyclerView.setLayoutManager(new LinearLayoutManager(this));
mOptimumRecyclerView.addItemDecoration(new HorizontalDividerItemDecoration.Builder(this).color(Color.parseColor("#efeef3"))
.size(PixelUtil.dp2px(1)).showLastDivider().build());
mOptimumRecyclerView.setAdapter(mAdapter);
mOptimumRecyclerView.setEmptyOnClick(this);
mOptimumRecyclerView.setRefreshListener(this);
mOptimumRecyclerView.getLoadMoreContainer().setItemLeftToLoadMore(1);
mOptimumRecyclerView.setLoadMoreHandler(this, new DlLoadMoreView(this));
getGoodsByNet(true);
}
示例6: initView
import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration; //导入依赖的package包/类
private void initView() {
layoutManager = new WrapContentLinearLayoutManager(getActivity());
adapter = new TeamActivitiesAdapter(this);
listView.setLayoutManager(layoutManager);
listView.setAdapter(adapter);
listView.addItemDecoration(new HorizontalDividerItemDecoration.Builder(getActivity())
.marginResId(R.dimen.contacts_text_left_margin, R.dimen.zero_dp)
.build());
listView.addOnScrollListener(new RecyclerViewPauseOnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
if (canLoadMore && BizLogic.isNetworkConnected()
&& layoutManager.findLastVisibleItemPosition() > adapter.getItemCount() - 5) {
canLoadMore = false;
adapter.setIsLoading(true);
presenter.getTeamActivities(BizLogic.getTeamId(), maxId);
}
}
});
swipeRefreshLayout.setOnRefreshListener(this);
}
示例7: onCreateView
import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_notification, container, false);
ButterKnife.inject(this, view);
listView.addItemDecoration(new HorizontalDividerItemDecoration.Builder(getActivity())
.marginResId(R.dimen.contacts_text_left_margin, R.dimen.zero_dp)
.build());
listView.setLayoutManager(layoutManager);
listView.setAdapter(adapter);
listView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
if (canLoadMore && layoutManager.findLastVisibleItemPosition() > adapter.getItemCount() - 5) {
canLoadMore = false;
adapter.setIsLoading(true);
presenter.getMoreNotifications(maxDate);
}
}
});
swipeRefreshLayout.setOnRefreshListener(this);
presenter.initNotifications(false);
return view;
}
示例8: onCreate
import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration; //导入依赖的package包/类
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.share_deck_activity);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
Intent intent = getIntent();
Deck deck = ParcelableDeck.get(intent.getParcelableExtra(DECK));
this.setTitle(deck.getName());
ButterKnife.bind(this);
Injector.getShareDeckActivityInjector(deck).inject(this);
mSharingPermissionsSpinner.setType(
R.array.share_permissions_spinner_text, R.array.share_permissions_spinner_img);
setAutoCompleteViewSettings();
mRecyclerView.addItemDecoration(new HorizontalDividerItemDecoration.Builder(this)
.build());
// use a linear layout manager
RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(this);
mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.setAdapter(new UserDeckAccessRecyclerViewAdapter(this, mPresenter));
}
示例9: initViews
import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration; //导入依赖的package包/类
private void initViews() {
getActivity().setTitle(R.string.menu_most_star);
mRefreshLayout.setOnRefreshListener(mRefreshListener);
mAdapter = new RepoListRecyclerAdapter(null);
mAdapter.setOnRecyclerViewItemClickListener(mItemtClickListener);
mRepoListView.setLayoutManager(new LinearLayoutManager(this.getActivity()));
mRepoListView.addItemDecoration(new HorizontalDividerItemDecoration
.Builder(getContext())
.color(Color.TRANSPARENT)
.size(getResources().getDimensionPixelSize(R.dimen.divider_height))
.build());
mRepoListView.setAdapter(mAdapter);
}
示例10: initViews
import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration; //导入依赖的package包/类
private void initViews() {
mPathView.initRootCrumb();
mPathView.setCallback(mPathSelectionCallback);
mAdapter = new RepoContentAdapter(null);
mAdapter.setOnRecyclerViewItemClickListener(mItemClickListener);
mRepoTree.setLayoutManager(new LinearLayoutManager(this));
mRepoTree.addItemDecoration(new HorizontalDividerItemDecoration
.Builder(this)
.color(Color.TRANSPARENT)
.size(getResources().getDimensionPixelSize(R.dimen.divider_height))
.build());
mRepoTree.setAdapter(mAdapter);
}
示例11: initViews
import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration; //导入依赖的package包/类
private void initViews() {
mRefreshLayout.setOnRefreshListener(mRefreshListener);
mAdapter = new TrendingRepoRecyclerAdapter(null);
mAdapter.setOnRecyclerViewItemClickListener(mItemClickListener);
mAdapter.setEmptyView(LayoutInflater.from(getContext()).inflate(R.layout.empty_view, null));
mRepoListView.setLayoutManager(new LinearLayoutManager(this.getActivity()));
mRepoListView.addItemDecoration(new HorizontalDividerItemDecoration
.Builder(getActivity())
.color(Color.TRANSPARENT)
.size(getResources().getDimensionPixelSize(R.dimen.divider_height))
.build());
mRepoListView.setAdapter(mAdapter);
}
示例12: onCreate
import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
DaggerAppComponent.builder().appModule(new AppModule(getBaseContext(), getFragmentManager())).build().inject(this);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
List<RecyclerStringItem> data = new ArrayList<>();
data.add(new RecyclerStringItem(FingerPrint));
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.addItemDecoration(new HorizontalDividerItemDecoration.Builder(this).build());
recyclerView.setAdapter(new SimpleRecyclerAdapter<>(data, recyclerDelegate));
FileUtils.createGetContentIntent();
}
示例13: initView
import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration; //导入依赖的package包/类
@Override
public void initView(View view) {
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
mRecyclerView.setAdapter(adapter);
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
mRecyclerView.addItemDecoration(new HorizontalDividerItemDecoration.Builder(getActivity()).build());
mPullToRefreshView = (PullToRefreshView)view.findViewById(R.id.pull_to_refresh_b);
mPullToRefreshView.setOnRefreshListener(new PullToRefreshView.OnRefreshListener() {
@Override
public void onRefresh() {
getData();
refresh_flag = 1;
}
});
getData();
}
示例14: initView
import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration; //导入依赖的package包/类
@Override
public void initView(View view) {
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
mRecyclerView.setAdapter(adapter);
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
mRecyclerView.addItemDecoration(new HorizontalDividerItemDecoration.Builder(getActivity()).build());
mPullToRefreshView = (PullToRefreshView)view.findViewById(R.id.pull_to_refresh_b);
mPullToRefreshView.setOnRefreshListener(new PullToRefreshView.OnRefreshListener() {
@Override
public void onRefresh() {
getData();
}
});
tlUserProfileTabs.addTab(tlUserProfileTabs.newTab().setText("动态"));
tlUserProfileTabs.addTab(tlUserProfileTabs.newTab().setText("信息"));
getData();
}
示例15: onCreateView
import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_schedule, container, false);
RecyclerView listView = (RecyclerView)view.findViewById(R.id.scheduleList);
if(listView != null){
listView.setHasFixedSize(true);
listView.setAdapter(mSectionedAdapter);
listView.addItemDecoration(new HorizontalDividerItemDecoration.Builder(getContext()).build());
LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
listView.setLayoutManager(layoutManager);
listView.addOnItemTouchListener(new RecyclerItemClickListener(getContext(), new ScheduleItemClickListener()));
}
SwipeRefreshLayout swipeRefresh = (SwipeRefreshLayout)view.findViewById(R.id.scheduleRefreshLayout);
if(swipeRefresh != null){
swipeRefresh.setOnRefreshListener(this);
}
return view;
}