use of com.xinshang.audient.widget.AudientItemDecoration in project Audient by komamj.
the class TopListFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
if (mPresenter != null) {
mPresenter.loadTopList();
}
}
});
mSwipeRefreshLayout.setColorSchemeResources(R.color.colorAccent, R.color.colorPrimaryDark, R.color.colorPrimary);
mAdapter = new TopListAdapter(mContext);
mRecyclerView.setHasFixedSize(true);
LinearLayoutManager layoutManager = new LinearLayoutManager(mContext);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
mRecyclerView.setLayoutManager(layoutManager);
mRecyclerView.addItemDecoration(new AudientItemDecoration(mContext));
mRecyclerView.setAdapter(mAdapter);
mIsPrepared = true;
}
use of com.xinshang.audient.widget.AudientItemDecoration in project Audient by komamj.
the class PlaylistFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
setLoadingIndicator(true);
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
if (mPresenter != null) {
mPresenter.unSubscribe();
mPresenter.subscribe();
}
}
});
mSwipeRefreshLayout.setColorSchemeResources(R.color.colorAccent, R.color.colorPrimaryDark, R.color.colorPrimary);
mAdapter = new PlaylistAdapter(mContext);
mAdapter.setEventListener(new PlaylistAdapter.EventListener() {
@Override
public void onFavoriteMenuClick(Audient audient) {
Intent intent = new Intent(mContext, MyFavoritesActivity.class);
intent.putExtra(Constants.KEY_AUDIENT, audient);
mContext.startActivity(intent);
}
});
mRecyclerView.setHasFixedSize(true);
LinearLayoutManager layoutManager = new LinearLayoutManager(mContext);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
mRecyclerView.setLayoutManager(layoutManager);
mRecyclerView.addItemDecoration(new AudientItemDecoration(mContext));
mRecyclerView.setAdapter(mAdapter);
}
use of com.xinshang.audient.widget.AudientItemDecoration in project Audient by komamj.
the class MyFavoritesFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
LogUtils.i(TAG, "onViewCreated");
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
if (mPresenter != null) {
mPresenter.loadMyFavorites();
}
}
});
mSwipeRefreshLayout.setColorSchemeResources(R.color.colorAccent, R.color.colorPrimaryDark, R.color.colorPrimary);
setLoadingIndicator(true);
mAdapter = new MyFavoritesAdapter(mContext);
mAdapter.setListener(new MyFavoritesAdapter.EventListener() {
@Override
public void onItemClick(Favorite favorite) {
if (mPresenter != null) {
mPresenter.addToFavorite(favorite.favoritesId, mAudient);
}
}
});
LinearLayoutManager layoutManager = new LinearLayoutManager(mContext);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
mRecyclerView.addItemDecoration(new AudientItemDecoration(mContext));
mRecyclerView.setLayoutManager(layoutManager);
mRecyclerView.setAdapter(mAdapter);
if (mPresenter != null) {
mPresenter.loadMyFavorites();
}
}
use of com.xinshang.audient.widget.AudientItemDecoration in project Audient by komamj.
the class FavoriteDetailFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
LogUtils.i(TAG, "onViewCreated");
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
if (mPresenter != null) {
mPresenter.loadData(mFavorite.favoritesId);
}
}
});
mSwipeRefreshLayout.setColorSchemeResources(R.color.colorPrimaryDark, R.color.colorPrimary, R.color.colorAccent);
setLoadingIndicator(true);
mAdapter = new FavoritesSongAdapter(mContext);
mAdapter.setEventListener(new FavoritesSongAdapter.EventListener() {
@Override
public void onDeleteEventChanged(Favorite.FavoritesSong favoritesSong) {
if (mPresenter != null) {
mPresenter.deleteFavoriteSong(favoritesSong);
}
}
@Override
public void onPlaylistChanged(Audient audient) {
PaymentDialogFragment.show(getChildFragmentManager(), audient);
}
});
mRecyclerView.setHasFixedSize(true);
LinearLayoutManager layoutManager = new LinearLayoutManager(mContext);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
mRecyclerView.setLayoutManager(layoutManager);
mRecyclerView.addItemDecoration(new AudientItemDecoration(mContext));
mRecyclerView.setAdapter(mAdapter);
if (mPresenter != null) {
mPresenter.loadData(mFavorite.favoritesId);
}
}
use of com.xinshang.audient.widget.AudientItemDecoration in project Audient by komamj.
the class CommentFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
LogUtils.i(TAG, "onViewCreated");
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
if (mPresenter != null) {
mPresenter.loadComments(mAudient);
}
}
});
mSwipeRefreshLayout.setColorSchemeResources(R.color.colorAccent, R.color.colorPrimaryDark, R.color.colorPrimary);
setLoadingIncator(true);
mAdapter = new CommentAdapter(mContext);
mAdapter.setListener(new CommentAdapter.EventListener() {
@Override
public void onThumbUpClick(Comment comment) {
if (mPresenter != null) {
mPresenter.thumbUpComment(comment);
}
}
});
mRecyclerView.setHasFixedSize(true);
LinearLayoutManager layoutManager = new LinearLayoutManager(mContext);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
mRecyclerView.setLayoutManager(layoutManager);
mRecyclerView.addItemDecoration(new AudientItemDecoration(mContext));
mRecyclerView.setAdapter(mAdapter);
// load data
if (mPresenter != null) {
mPresenter.loadComments(mAudient);
}
}
Aggregations