refactor: change Layer.destroy to Layer.onDetach
This commit is contained in:
parent
d397624fdc
commit
6fbfeb2848
@ -66,10 +66,5 @@ public abstract class Layer {
|
||||
* does nothing.
|
||||
*/
|
||||
public void onDetach() {
|
||||
// FIXME call to this function is not implemented
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ public abstract class TileLayer<T extends TileLoader> extends Layer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
public void onDetach() {
|
||||
for (T loader : mTileLoader) {
|
||||
loader.pause();
|
||||
loader.interrupt();
|
||||
|
||||
@ -77,14 +77,6 @@ public class Layers extends AbstractList<Layer> {
|
||||
return mDrawLayers;
|
||||
}
|
||||
|
||||
public void onDetach() {
|
||||
if (mDirtyLayers)
|
||||
updateLayers();
|
||||
|
||||
for (Layer o : mLayers)
|
||||
o.onDetach();
|
||||
}
|
||||
|
||||
public void onUpdate(MapPosition mapPosition, boolean changed, boolean clear) {
|
||||
if (mDirtyLayers)
|
||||
updateLayers();
|
||||
@ -97,9 +89,8 @@ public class Layers extends AbstractList<Layer> {
|
||||
if (mDirtyLayers)
|
||||
updateLayers();
|
||||
|
||||
for (Layer l : mLayers) {
|
||||
l.destroy();
|
||||
}
|
||||
for (Layer o : mLayers)
|
||||
o.onDetach();
|
||||
}
|
||||
|
||||
Layer[] mLayers;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user