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.
|
* does nothing.
|
||||||
*/
|
*/
|
||||||
public void onDetach() {
|
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
|
@Override
|
||||||
public void destroy() {
|
public void onDetach() {
|
||||||
for (T loader : mTileLoader) {
|
for (T loader : mTileLoader) {
|
||||||
loader.pause();
|
loader.pause();
|
||||||
loader.interrupt();
|
loader.interrupt();
|
||||||
|
|||||||
@ -77,14 +77,6 @@ public class Layers extends AbstractList<Layer> {
|
|||||||
return mDrawLayers;
|
return mDrawLayers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onDetach() {
|
|
||||||
if (mDirtyLayers)
|
|
||||||
updateLayers();
|
|
||||||
|
|
||||||
for (Layer o : mLayers)
|
|
||||||
o.onDetach();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onUpdate(MapPosition mapPosition, boolean changed, boolean clear) {
|
public void onUpdate(MapPosition mapPosition, boolean changed, boolean clear) {
|
||||||
if (mDirtyLayers)
|
if (mDirtyLayers)
|
||||||
updateLayers();
|
updateLayers();
|
||||||
@ -97,9 +89,8 @@ public class Layers extends AbstractList<Layer> {
|
|||||||
if (mDirtyLayers)
|
if (mDirtyLayers)
|
||||||
updateLayers();
|
updateLayers();
|
||||||
|
|
||||||
for (Layer l : mLayers) {
|
for (Layer o : mLayers)
|
||||||
l.destroy();
|
o.onDetach();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Layer[] mLayers;
|
Layer[] mLayers;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user