use of com.junjunguo.pocketmaps.fragments.MyMapAdapter in project PocketMaps by junjunguo.
the class MainActivity method activateRecyclerView.
/**
* active directions, and directions view
*/
private void activateRecyclerView(List<MyMap> myMaps) {
RecyclerView.LayoutManager layoutManager;
mapsRV = (RecyclerView) findViewById(R.id.my_maps_recycler_view);
DefaultItemAnimator animator = new DefaultItemAnimator();
animator.setAddDuration(2000);
animator.setRemoveDuration(600);
mapsRV.setItemAnimator(animator);
// use this setting to improve performance if you know that changes
// in content do not change the layout size of the RecyclerView
mapsRV.setHasFixedSize(true);
// use a linear layout manager
layoutManager = new LinearLayoutManager(this);
mapsRV.setLayoutManager(layoutManager);
// specify an adapter (see also next example)
if (mapAdapter == null) {
mapAdapter = new MyMapAdapter(myMaps, this, false);
} else {
mapAdapter.clearList();
mapAdapter.addAll(myMaps);
}
mapsRV.setAdapter(mapAdapter);
deleteItemHandler();
}
use of com.junjunguo.pocketmaps.fragments.MyMapAdapter in project PocketMaps by junjunguo.
the class DownloadMapActivity method activateRecyclerView.
/**
* active directions, and directions view
*/
private void activateRecyclerView(List<MyMap> myMaps) {
mapsRV = (RecyclerView) findViewById(R.id.my_maps_download_recycler_view);
DefaultItemAnimator animator = new DefaultItemAnimator();
animator.setAddDuration(600);
animator.setRemoveDuration(600);
mapsRV.setItemAnimator(animator);
// use this setting to improve performance if you know that changes
// in content do not change the layout size of the RecyclerView
mapsRV.setHasFixedSize(true);
// use a linear layout manager
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
mapsRV.setLayoutManager(layoutManager);
myDownloadAdapter = new MyMapAdapter(myMaps, this, true);
mapsRV.setAdapter(myDownloadAdapter);
}
Aggregations