Implement base plugin API
This commit is contained in:
parent
4365899094
commit
d9e33f4c81
3 changed files with 18 additions and 3 deletions
|
@ -92,6 +92,12 @@ public class OsmandApplication extends Application {
|
||||||
if (LOG.isDebugEnabled()) {
|
if (LOG.isDebugEnabled()) {
|
||||||
LOG.debug("Time to start application " + (System.currentTimeMillis() - timeToStart) + " ms. Should be less < 800 ms");
|
LOG.debug("Time to start application " + (System.currentTimeMillis() - timeToStart) + " ms. Should be less < 800 ms");
|
||||||
}
|
}
|
||||||
|
timeToStart = System.currentTimeMillis();
|
||||||
|
OsmandPlugin.initPlugins(this);
|
||||||
|
|
||||||
|
if (LOG.isDebugEnabled()) {
|
||||||
|
LOG.debug("Time to init plugins " + (System.currentTimeMillis() - timeToStart) + " ms. Should be less < 800 ms");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -38,6 +38,13 @@ public abstract class OsmandPlugin {
|
||||||
*/
|
*/
|
||||||
public abstract boolean init(OsmandApplication app);
|
public abstract boolean init(OsmandApplication app);
|
||||||
|
|
||||||
|
|
||||||
|
public static void initPlugins(OsmandApplication app) {
|
||||||
|
for (OsmandPlugin plugin : plugins) {
|
||||||
|
plugin.init(app);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ????
|
* ????
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -108,8 +108,8 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe
|
||||||
|
|
||||||
/** Called when the activity is first created. */
|
/** Called when the activity is first created. */
|
||||||
private OsmandMapTileView mapView;
|
private OsmandMapTileView mapView;
|
||||||
final private MapActivityActions mapActions = new MapActivityActions(this);
|
private MapActivityActions mapActions;
|
||||||
final private MapActivityLayers mapLayers = new MapActivityLayers(this);
|
private MapActivityLayers mapLayers;
|
||||||
private NavigationInfo navigationInfo;
|
private NavigationInfo navigationInfo;
|
||||||
|
|
||||||
private SavingTrackHelper savingTrackHelper;
|
private SavingTrackHelper savingTrackHelper;
|
||||||
|
@ -152,7 +152,9 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
settings = getMyApplication().getSettings();
|
settings = getMyApplication().getSettings();
|
||||||
|
mapActions = new MapActivityActions(this);
|
||||||
|
mapLayers = new MapActivityLayers(this);
|
||||||
navigationInfo = new NavigationInfo(this);
|
navigationInfo = new NavigationInfo(this);
|
||||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
// Full screen is not used here
|
// Full screen is not used here
|
||||||
|
|
Loading…
Reference in a new issue