projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altoslib,altosuilib: Bump library version numbers
[fw/altos]
/
altosdroid
/
src
/
org
/
altusmetrum
/
AltosDroid
/
TabMap.java
diff --git
a/altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java
b/altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java
index 54ccd18f7e95e5ab5f8bd8e1fb5b4d61e616c424..d239d988ad488f36bebb9909e0c06d43aed6bc96 100644
(file)
--- a/
altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java
+++ b/
altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java
@@
-3,7
+3,8
@@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-20,7
+21,7
@@
package org.altusmetrum.AltosDroid;
import java.util.*;
import java.io.*;
import java.util.*;
import java.io.*;
-import org.altusmetrum.altoslib_
8
.*;
+import org.altusmetrum.altoslib_
12
.*;
import android.app.Activity;
import android.graphics.*;
import android.app.Activity;
import android.graphics.*;
@@
-32,7
+33,7
@@
import android.widget.*;
import android.location.Location;
import android.content.*;
import android.location.Location;
import android.content.*;
-public class TabMap extends AltosDroidTab {
+public class TabMap extends AltosDroidTab
implements AltosDroidMapSourceListener
{
AltosLatLon here;
AltosLatLon here;
@@
-74,7
+75,8
@@
public class TabMap extends AltosDroidTab {
map_offline.onCreateView(altos_droid);
map_online = new AltosMapOnline(view.getContext());
map_online.onCreateView(altos_droid);
map_offline.onCreateView(altos_droid);
map_online = new AltosMapOnline(view.getContext());
map_online.onCreateView(altos_droid);
- set_map_source(AltosDroidPreferences.map_source());
+ map_source_changed(AltosDroidPreferences.map_source());
+ AltosDroidPreferences.register_map_source_listener(this);
return view;
}
return view;
}
@@
-88,6
+90,9
@@
public class TabMap extends AltosDroidTab {
@Override
public void onDestroyView() {
super.onDestroyView();
@Override
public void onDestroyView() {
super.onDestroyView();
+ map_offline.onDestroyView();
+ map_online.onDestroyView();
+ AltosDroidPreferences.unregister_map_source_listener(this);
}
public String tab_name() { return AltosDroid.tab_map_name; }
}
public String tab_name() { return AltosDroid.tab_map_name; }
@@
-144,16
+149,7
@@
public class TabMap extends AltosDroidTab {
}
}
}
}
- @Override
- public void set_map_type(int map_type) {
- if (map_offline != null)
- map_offline.set_map_type(map_type);
- if (map_online != null)
- map_online.set_map_type(map_type);
- }
-
- @Override
- public void set_map_source(int map_source) {
+ public void map_source_changed(int map_source) {
this.map_source = map_source;
if (map_source == AltosDroidPreferences.MAP_SOURCE_OFFLINE) {
if (map_online != null)
this.map_source = map_source;
if (map_source == AltosDroidPreferences.MAP_SOURCE_OFFLINE) {
if (map_online != null)