Search in sources :

Example 81 with RecyclerView

use of android.support.v7.widget.RecyclerView in project remusic by aa112901.

the class FolderFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.recylerview, container, false);
    // folderInfos = MusicUtils.queryFolder(mContext);
    recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
    layoutManager = new LinearLayoutManager(mContext);
    recyclerView.setLayoutManager(layoutManager);
    mAdapter = new Adapter(null);
    recyclerView.setAdapter(mAdapter);
    recyclerView.setHasFixedSize(true);
    setItemDecoration();
    isAZSort = mPreferences.getFoloerSortOrder().equals(SortOrder.FolderSortOrder.FOLDER_A_Z);
    dialogText = (TextView) view.findViewById(R.id.dialog_text);
    sideBar = (SideBar) view.findViewById(R.id.sidebar);
    sideBar.setOnTouchingLetterChangedListener(new SideBar.OnTouchingLetterChangedListener() {

        @Override
        public void onTouchingLetterChanged(String s) {
            dialogText.setText(s);
            sideBar.setView(dialogText);
            Log.e("scrol", "  " + s);
            if (positionMap.get(s) != null) {
                int i = positionMap.get(s);
                Log.e("scrolget", "  " + i);
                ((LinearLayoutManager) recyclerView.getLayoutManager()).scrollToPositionWithOffset(i, 0);
            }
        }
    });
    reloadAdapter();
    return view;
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ImageView(android.widget.ImageView) TintImageView(com.bilibili.magicasakura.widgets.TintImageView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) SideBar(com.wm.remusic.widget.SideBar)

Example 82 with RecyclerView

use of android.support.v7.widget.RecyclerView in project remusic by aa112901.

the class AlbumDetailFragment method onCreateView.

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_common, container, false);
    recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
    layoutManager = new LinearLayoutManager(mContext);
    recyclerView.setLayoutManager(layoutManager);
    mAdapter = new AlbumDetailAdapter(null);
    recyclerView.setAdapter(mAdapter);
    itemDecoration = new DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL_LIST);
    recyclerView.addItemDecoration(itemDecoration);
    recyclerView.setHasFixedSize(true);
    reloadAdapter();
    AlbumInfo albumInfo = MusicUtils.getAlbumInfo(mContext, albumID);
    Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
    toolbar.setPadding(0, CommonUtils.getStatusHeight(mContext), 0, 0);
    ((AppCompatActivity) mContext).setSupportActionBar(toolbar);
    ab = ((AppCompatActivity) mContext).getSupportActionBar();
    ab.setHomeAsUpIndicator(R.drawable.actionbar_back);
    ab.setDisplayHomeAsUpEnabled(true);
    ab.setTitle(albumInfo.album_name);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (getActivity() != null)
                getActivity().onBackPressed();
        }
    });
    return view;
}
Also used : AlbumInfo(com.wm.remusic.info.AlbumInfo) AppCompatActivity(android.support.v7.app.AppCompatActivity) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.wm.remusic.widget.DividerItemDecoration) ImageView(android.widget.ImageView) TintImageView(com.bilibili.magicasakura.widgets.TintImageView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) Toolbar(android.support.v7.widget.Toolbar)

Example 83 with RecyclerView

use of android.support.v7.widget.RecyclerView in project remusic by aa112901.

the class RadioDetailActivity method setList.

private void setList() {
    recyclerView = (ObservableRecyclerView) findViewById(R.id.recyclerview);
    recyclerView.setScrollViewCallbacks(RadioDetailActivity.this);
    recyclerView.setLayoutManager(new LinearLayoutManager(RadioDetailActivity.this));
    recyclerView.setHasFixedSize(false);
    mAdapter = new PlaylistDetailAdapter(RadioDetailActivity.this, adapterList);
    recyclerView.setAdapter(mAdapter);
    recyclerView.addItemDecoration(new DividerItemDecoration(RadioDetailActivity.this, DividerItemDecoration.VERTICAL_LIST));
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.wm.remusic.widget.DividerItemDecoration)

Example 84 with RecyclerView

use of android.support.v7.widget.RecyclerView in project remusic by aa112901.

the class RankingFragment method setUserVisibleHint.

@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
    super.setUserVisibleHint(isVisibleToUser);
    if (isVisibleToUser) {
        if (view == null) {
            view = LayoutInflater.from(mContext).inflate(R.layout.ranking, null, false);
            recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
            linearLayoutManager = new LinearLayoutManager(mContext);
            recyclerView.setLayoutManager(linearLayoutManager);
            rankingAdapter = new RankingAdapter();
            recyclerView.setAdapter(rankingAdapter);
            recyclerView.setHasFixedSize(true);
            loadData();
        }
    }
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 85 with RecyclerView

use of android.support.v7.widget.RecyclerView in project remusic by aa112901.

the class SearchAlbumFragment 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 AlbumAdapter(null);
    recyclerView.setAdapter(mAdapter);
    recyclerView.setHasFixedSize(true);
    setItemDecoration();
    loadAlbums();
    return view;
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ImageView(android.widget.ImageView) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView) View(android.view.View) Nullable(android.support.annotation.Nullable)

Aggregations

RecyclerView (android.support.v7.widget.RecyclerView)1778 View (android.view.View)1237 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1106 TextView (android.widget.TextView)384 GridLayoutManager (android.support.v7.widget.GridLayoutManager)234 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)225 ImageView (android.widget.ImageView)210 ArrayList (java.util.ArrayList)190 Toolbar (android.support.v7.widget.Toolbar)137 Intent (android.content.Intent)117 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)102 ViewGroup (android.view.ViewGroup)101 Nullable (android.support.annotation.Nullable)99 Context (android.content.Context)96 StaggeredGridLayoutManager (android.support.v7.widget.StaggeredGridLayoutManager)96 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)93 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)93 Bundle (android.os.Bundle)92 Test (org.junit.Test)90 Paint (android.graphics.Paint)80