Search in sources :

Example 56 with DividerItemDecoration

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

the class NetItemChangeActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.change_netmusic_item);
    toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    ab = getSupportActionBar();
    ab.setHomeAsUpIndicator(R.drawable.actionbar_back);
    ab.setDisplayHomeAsUpEnabled(true);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            onBackPressed();
        }
    });
    TextView defaultPosition = (TextView) findViewById(R.id.default_item_position);
    //下划线
    defaultPosition.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);
    //抗锯齿
    defaultPosition.getPaint().setAntiAlias(true);
    defaultPosition.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            PreferencesUtility.getInstance(NetItemChangeActivity.this).setItemPostion("推荐歌单 最新专辑 主播电台");
        }
    });
    recyclerView = (RecyclerView) findViewById(R.id.recyclerview);
    layoutManager = new LinearLayoutManager(this);
    recyclerView.setLayoutManager(layoutManager);
    recyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL_LIST));
    String str = PreferencesUtility.getInstance(this).getItemPosition();
    final String[] strs = str.split(" ");
    ArrayList<String> list = new ArrayList<>();
    for (String st : strs) {
        list.add(st);
    }
    mAdapter = new SelectAdapter(list);
    recyclerView.setAdapter(mAdapter);
    DragSortRecycler dragSortRecycler = new DragSortRecycler();
    dragSortRecycler.setViewHandleId(R.id.move);
    dragSortRecycler.setOnItemMovedListener(new DragSortRecycler.OnItemMovedListener() {

        @Override
        public void onItemMoved(int from, int to) {
            Log.d("queue", "onItemMoved " + from + " to " + to);
            final String str = mAdapter.getMusicAt(from);
            mAdapter.removeSongAt(from);
            mAdapter.addStringTo(to, str);
            mAdapter.notifyDataSetChanged();
            String st = "";
            for (int i = 0; i < mAdapter.strs.size(); i++) {
                if (i == mAdapter.strs.size() - 1) {
                    st = st + mAdapter.strs.get(i);
                    continue;
                }
                st = st + mAdapter.strs.get(i) + " ";
            }
            PreferencesUtility.getInstance(NetItemChangeActivity.this).setItemPostion(st);
        //MusicPlayer.moveQueueItem(from, to);
        }
    });
    recyclerView.addItemDecoration(dragSortRecycler);
    recyclerView.addOnItemTouchListener(dragSortRecycler);
    recyclerView.addOnScrollListener(dragSortRecycler.getScrollListener());
    recyclerView.setHasFixedSize(true);
}
Also used : ArrayList(java.util.ArrayList) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.wm.remusic.widget.DividerItemDecoration) ImageView(android.widget.ImageView) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View) Paint(android.graphics.Paint) TextView(android.widget.TextView) DragSortRecycler(com.wm.remusic.widget.DragSortRecycler)

Example 57 with DividerItemDecoration

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

the class PlaylistActivity method setList.

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

Example 58 with DividerItemDecoration

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

the class AlbumsDetailActivity method setList.

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

Example 59 with DividerItemDecoration

use of android.support.v7.widget.DividerItemDecoration in project Carbon by ZieIony.

the class AutoCompleteLayout method initAutoCompleteLayout.

private void initAutoCompleteLayout() {
    View.inflate(getContext(), R.layout.carbon_autocompletelayout, this);
    setOrientation(VERTICAL);
    search = (AutoCompleteEditText) findViewById(R.id.carbon_autoCompleteSearch);
    results = (RecyclerView) findViewById(R.id.carbon_autoCompleteResults);
    results.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
    ColorDrawable colorDrawable = new ColorDrawable(Carbon.getThemeColor(getContext(), R.attr.carbon_dividerColor));
    int dividerWidth = getResources().getDimensionPixelSize(R.dimen.carbon_1dip);
    results.addItemDecoration(new DividerItemDecoration(colorDrawable, dividerWidth));
    results.setAdapter(adapter);
    search.setOnFilterListener(filteringResults -> {
        if (filteringResults == null) {
            adapter.setItems(new ArrayList<>());
            return;
        }
        adapter.setItems(new ArrayList<>(filteringResults));
    });
    adapter.setOnItemClickedListener(position -> search.performCompletion(adapter.getItems().get(position).text.toString()));
}
Also used : ColorDrawable(android.graphics.drawable.ColorDrawable) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 60 with DividerItemDecoration

use of android.support.v7.widget.DividerItemDecoration in project storio by pushtorefresh.

the class TweetsFragment method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    ButterKnife.bind(this, view);
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    recyclerView.setAdapter(tweetsAdapter);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.setHasFixedSize(true);
    recyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST));
    uiStateController = new UiStateController.Builder().withLoadingUi(view.findViewById(R.id.tweets_loading_ui)).withErrorUi(view.findViewById(R.id.tweets_error_ui)).withEmptyUi(view.findViewById(R.id.tweets_empty_ui)).withContentUi(recyclerView).build();
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.pushtorefresh.storio.sample.ui.DividerItemDecoration) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)73 RecyclerView (android.support.v7.widget.RecyclerView)42 View (android.view.View)36 TextView (android.widget.TextView)23 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)19 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)15 ImageView (android.widget.ImageView)14 DividerItemDecoration (com.wm.remusic.widget.DividerItemDecoration)9 Drawable (android.graphics.drawable.Drawable)8 DividerItemDecoration (de.madcyph3r.example.DividerItemDecoration)8 DividerItemDecoration (io.hefuyi.listener.widget.DividerItemDecoration)7 Nullable (android.support.annotation.Nullable)6 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)6 Context (android.content.Context)5 Toolbar (android.support.v7.widget.Toolbar)5 Intent (android.content.Intent)4 ActionBar (android.support.v7.app.ActionBar)4 DividerItemDecoration (com.lzy.demo.base.DividerItemDecoration)4 DividerItemDecoration (org.michenux.drodrolib.ui.recyclerview.DividerItemDecoration)4 TargetApi (android.annotation.TargetApi)3