use of android.support.v7.widget.RecyclerView in project remusic by aa112901.
the class SearchArtistFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.recylerview, container, false);
recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
layoutManager = new LinearLayoutManager(mContext);
recyclerView.setLayoutManager(layoutManager);
mAdapter = new ArtistAdapter(null);
recyclerView.setAdapter(mAdapter);
recyclerView.setHasFixedSize(true);
setItemDecoration();
loadArtists();
return view;
}
use of android.support.v7.widget.RecyclerView in project remusic by aa112901.
the class SearchMusicFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.recylerview, container, false);
if (getArguments() != null) {
songInfos = getArguments().getParcelableArrayList("searchMusic");
}
recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
layoutManager = new LinearLayoutManager(mContext);
recyclerView.setLayoutManager(layoutManager);
mAdapter = new MusicAdapter(songInfos);
recyclerView.setAdapter(mAdapter);
recyclerView.setHasFixedSize(true);
recyclerView.addItemDecoration(new DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL_LIST));
return view;
}
use of android.support.v7.widget.RecyclerView in project remusic by aa112901.
the class DividerItemDecoration method drawHorizontal.
public void drawHorizontal(Canvas c, RecyclerView parent) {
final int top = parent.getPaddingTop();
final int bottom = parent.getHeight() - parent.getPaddingBottom();
final int childCount = parent.getChildCount();
for (int i = 0; i < childCount; i++) {
final View child = parent.getChildAt(i);
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
final int left = child.getRight() + params.rightMargin;
final int right = left + mDivider.getIntrinsicHeight();
mDivider.setBounds(left, top, right, bottom);
mDivider.draw(c);
}
}
use of android.support.v7.widget.RecyclerView in project actor-platform by actorapp.
the class MessagesFragment method configureRecyclerView.
@Override
protected void configureRecyclerView(RecyclerView recyclerView) {
layoutManager = new ChatLinearLayoutManager(getActivity(), ChatLinearLayoutManager.VERTICAL, true);
layoutManager.setStackFromEnd(false);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(layoutManager);
}
use of android.support.v7.widget.RecyclerView in project actor-platform by actorapp.
the class BlockedListFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View res = inflater.inflate(R.layout.fragment_recycler_list, container, false);
list = (RecyclerView) res.findViewById(R.id.listView);
list.setLayoutManager(new LinearLayoutManager(getActivity()));
emptyView = (TextView) res.findViewById(R.id.emptyView);
emptyView.setText(R.string.blocked_loading);
res.setBackgroundColor(ActorSDK.sharedActor().style.getBackyardBackgroundColor());
emptyView.setTextColor(ActorSDK.sharedActor().style.getTextSecondaryColor());
adapter = new BlockedAdapter(new ArrayList<User>(), new BlockedAdapter.OnBlockedClickListener() {
@Override
public void onClick(UserVM u) {
execute(messenger().unblockUser(u.getId()).then(new Consumer<Void>() {
@Override
public void apply(Void aVoid) {
checkBlockedList();
}
}));
}
});
list.setAdapter(adapter);
checkBlockedList();
return res;
}
Aggregations