项目:Jockey
文件:QueueFragment.java
private void setupRecyclerView() {
Drawable shadow = ContextCompat.getDrawable(getContext(),R.drawable.list_drag_shadow);
ItemDecoration background = new DragBackgroundDecoration(R.id.song_drag_root);
ItemDecoration divider = new DragDividerDecoration(getContext(),true,R.id.instance_blank);
ItemDecoration dragShadow = new DragDropDecoration((NinePatchDrawable) shadow);
mRecyclerView.addItemDecoration(background);
mRecyclerView.addItemDecoration(divider);
mRecyclerView.addItemDecoration(dragShadow);
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
boolean portrait = getResources().getConfiguration().orientation != ORIENTATION_LANDSCAPE;
boolean tablet = getResources().getConfiguration().smallestScreenWidthDp >= 600;
if (portrait || !tablet) {
// Add an inner shadow at the top of the list
mRecyclerView.addItemDecoration(new InsetDecoration(
ContextCompat.getDrawable(getContext(),R.drawable.inset_top_shadow),(int) getResources().getDimension(R.dimen.inset_top_shadow_height),Gravity.TOP));
} else {
// Add an inner shadow at the bottom of the list
mRecyclerView.addItemDecoration(new InsetDecoration(
ContextCompat.getDrawable(getContext(),R.drawable.inset_bottom_shadow),getResources().getDimensionPixelSize(R.dimen.inset_bottom_shadow_height),Gravity.BOTTOM));
}
}
项目:Jockey
文件:PlaylistViewModel.java
@Bindable
public ItemDecoration[] getItemDecorations() {
NinePatchDrawable dragShadow = (NinePatchDrawable) ContextCompat.getDrawable(
getContext(),R.drawable.list_drag_shadow);
return new ItemDecoration[] {
new DragBackgroundDecoration(R.id.song_drag_root),new DragDividerDecoration(R.id.song_drag_root,getContext(),R.id.empty_layout),new DragDropDecoration(dragShadow)
};
}
项目:Jockey
文件:ArtistViewModel.java
@Bindable
public ItemDecoration[] getItemDecorations() {
return new ItemDecoration[] {
new BackgroundDecoration(R.id.loading_frame,R.id.artist_bio_card,R.id.relatedCard),new DividerDecoration(getContext(),R.id.album_view,R.id.subheader_frame,R.id.relatedCard,new GridSpacingDecoration(
(int) getResources().getDimension(R.dimen.grid_margin),mAlbumColumnCount,mAlbumSection.getTypeId()),new GridSpacingDecoration(
(int) getResources().getDimension(R.dimen.card_margin),mRelatedColumnCount,mRelatedArtistSection.getTypeId())
};
}
项目:Jockey
文件:GenreViewModel.java
@Bindable
public ItemDecoration[] getItemDecorations() {
return new ItemDecoration[] {
new BackgroundDecoration(),R.id.empty_layout)
};
}
项目:Jockey
文件:RecyclerViewBindingAdapters.java
@BindingAdapter("itemDecorations")
public static void setItemDecorations(RecyclerView recyclerView,ItemDecoration... decor) {
for (ItemDecoration decoration : decor) {
recyclerView.addItemDecoration(decoration);
}
}
项目:FloodInfo
文件:BaseListActivity.java
/**
* Implement this with the ItemDecoration of your choice.
*
* if you don't want decoration,@return null
* else @return ItemDecoration
*/
protected abstract ItemDecoration getItemDecoration();
项目:FloodInfo
文件:NewsActivity.java
/**
* Implement this with the ItemDecoration of your choice.
*
* if you don't want decoration,@return null
* else @return ItemDecoration
*/
@Override protected ItemDecoration getItemDecoration() {
return new DividerDecoration(this,DividerDecoration.VERTICAL_LIST);
}
项目:FloodInfo
文件:ContactsActivity.java
/**
* Implement this with the ItemDecoration of your choice.
*
* if you don't want decoration,DividerDecoration.VERTICAL_LIST);
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。