Search in sources :

Example 6 with AudientItemDecoration

use of com.xinshang.audient.widget.AudientItemDecoration in project Audient by komamj.

the class MineFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    LogUtils.i(TAG, "onViewCreated");
    mDynamicAdapter = new AudientAdapter(mContext);
    mDynamicAdapter.setEventListener(new AudientAdapter.EventListener() {

        @Override
        public void onFavoriteMenuClick(Audient audient) {
            Intent intent = new Intent(mContext, MyFavoritesActivity.class);
            intent.putExtra(Constants.KEY_AUDIENT, audient);
            mContext.startActivity(intent);
        }

        @Override
        public void onPlaylistChanged(Audient audient) {
            PaymentDialogFragment.show(getChildFragmentManager(), audient);
        }
    });
    mFavoriteAdapter = new FavoriteAdapter(mContext);
    mFavoriteAdapter.setListener(new FavoriteAdapter.EventListner() {

        @Override
        public void onModifyEventChange(Favorite favorite) {
            EditNameDialogFragment.show(getChildFragmentManager(), favorite);
        }

        @Override
        public void onDeleteEventChange(Favorite favorite) {
            if (mPresenter != null) {
                mPresenter.deleteMyFavorite(favorite);
            }
        }
    });
    LinearLayoutManager layoutManagerFavorite = new LinearLayoutManager(mContext);
    layoutManagerFavorite.setOrientation(LinearLayoutManager.HORIZONTAL);
    mRecyclerViewFavorite.setLayoutManager(layoutManagerFavorite);
    mRecyclerViewFavorite.setAdapter(mFavoriteAdapter);
    LinearLayoutManager layoutManagerUser = new LinearLayoutManager(mContext);
    layoutManagerUser.setOrientation(LinearLayoutManager.VERTICAL);
    mRecyclerViewUser.setLayoutManager(layoutManagerUser);
    mRecyclerViewUser.addItemDecoration(new AudientItemDecoration(mContext));
    mRecyclerViewUser.setAdapter(mDynamicAdapter);
    mIsPrepared = true;
}
Also used : Favorite(com.xinshang.audient.model.entities.Favorite) MyFavoritesActivity(com.xinshang.audient.favorite.MyFavoritesActivity) AudientItemDecoration(com.xinshang.audient.widget.AudientItemDecoration) Intent(android.content.Intent) Audient(com.xinshang.audient.model.entities.Audient) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) AudientAdapter(com.xinshang.audient.base.AudientAdapter)

Example 7 with AudientItemDecoration

use of com.xinshang.audient.widget.AudientItemDecoration in project Audient by komamj.

the class ToplistDetailFragment 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.subscribe();
            }
        }
    });
    mSwipeRefreshLayout.setColorSchemeResources(R.color.colorAccent, R.color.colorPrimaryDark, R.color.colorPrimary);
    mSwipeRefreshLayout.setRefreshing(true);
    mAdapter = new AudientAdapter(mContext);
    mAdapter.setEventListener(new AudientAdapter.EventListener() {

        @Override
        public void onFavoriteMenuClick(Audient audient) {
            Intent intent = new Intent(mContext, MyFavoritesActivity.class);
            intent.putExtra(Constants.KEY_AUDIENT, audient);
            mContext.startActivity(intent);
        }

        @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.subscribe();
    }
}
Also used : MyFavoritesActivity(com.xinshang.audient.favorite.MyFavoritesActivity) AudientItemDecoration(com.xinshang.audient.widget.AudientItemDecoration) Intent(android.content.Intent) Audient(com.xinshang.audient.model.entities.Audient) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) SwipeRefreshLayout(android.support.v4.widget.SwipeRefreshLayout) AudientAdapter(com.xinshang.audient.base.AudientAdapter)

Example 8 with AudientItemDecoration

use of com.xinshang.audient.widget.AudientItemDecoration in project Audient by komamj.

the class SplashFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    LogUtils.i(TAG, "onViewCreated");
    setLoadingIndicator(false);
    mAdapter = new StoresAdapter(mContext);
    mAdapter.setListener(new StoresAdapter.OnItemClickListener() {

        @Override
        public void onItemClick(Store store) {
            if (mPresenter != null) {
                mPresenter.persistenceStore(store);
            }
        }
    });
    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.subscribe();
    }
}
Also used : AudientItemDecoration(com.xinshang.audient.widget.AudientItemDecoration) Store(com.xinshang.audient.model.entities.Store) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 9 with AudientItemDecoration

use of com.xinshang.audient.widget.AudientItemDecoration in project Audient by komamj.

the class SearchFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    LogUtils.i(TAG, "onViewCreated");
    showProgressBar(false);
    mAdapter = new AudientAdapter(mContext);
    mAdapter.setEventListener(new AudientAdapter.EventListener() {

        @Override
        public void onFavoriteMenuClick(Audient audient) {
            Intent intent = new Intent(mContext, MyFavoritesActivity.class);
            intent.putExtra(Constants.KEY_AUDIENT, audient);
            mContext.startActivity(intent);
        }

        @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);
}
Also used : MyFavoritesActivity(com.xinshang.audient.favorite.MyFavoritesActivity) AudientItemDecoration(com.xinshang.audient.widget.AudientItemDecoration) Intent(android.content.Intent) Audient(com.xinshang.audient.model.entities.Audient) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) AudientAdapter(com.xinshang.audient.base.AudientAdapter)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)9 AudientItemDecoration (com.xinshang.audient.widget.AudientItemDecoration)9 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)6 Audient (com.xinshang.audient.model.entities.Audient)5 Intent (android.content.Intent)4 MyFavoritesActivity (com.xinshang.audient.favorite.MyFavoritesActivity)4 AudientAdapter (com.xinshang.audient.base.AudientAdapter)3 Favorite (com.xinshang.audient.model.entities.Favorite)3 Comment (com.xinshang.audient.model.entities.Comment)1 Store (com.xinshang.audient.model.entities.Store)1