use of com.junjunguo.pocketmaps.model.MyMap in project PocketMaps by junjunguo.
the class MyMapAdapter method remove.
/**
* remove item at the given position
*
* @param position
*/
public MyMap remove(int position) {
MyMap mm = null;
if (position >= 0 && position < getItemCount()) {
mm = myMaps.remove(position);
notifyItemRemoved(position);
}
return mm;
}
use of com.junjunguo.pocketmaps.model.MyMap in project PocketMaps by junjunguo.
the class Variable method updateCloudMaps.
public void updateCloudMaps(List<MyMap> cloudMaps) {
ArrayList<MyMap> newList = new ArrayList<MyMap>();
for (MyMap oldMap : this.cloudMaps) {
for (MyMap newMap : cloudMaps) {
if (newMap.getUrl().equals(oldMap.getUrl())) {
newMap.setStatus(oldMap.getStatus());
break;
}
}
}
// Find same Map from CloudMaps
for (MyMap newMap : cloudMaps) {
int myIndex = Variable.getVariable().getCloudMaps().indexOf(newMap);
if (myIndex < 0) {
newList.add(newMap);
continue;
}
MyMap sameMap = Variable.getVariable().getCloudMaps().get(myIndex);
sameMap.set(newMap);
newList.add(sameMap);
}
this.cloudMaps = newList;
}
Aggregations