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);
}
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));
}
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));
}
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()));
}
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();
}
Aggregations