Search in sources :

Example 6 with PointDescription

use of net.osmand.core.samples.android.sample1.data.PointDescription in project Osmand by osmandapp.

the class MenuController method getMenuController.

public static MenuController getMenuController(MainActivity mainActivity, LatLon latLon, PointDescription pointDescription, Object object, MenuType menuType) {
    SampleApplication app = mainActivity.getMyApplication();
    MenuController menuController = null;
    if (object != null) {
        if (object instanceof Amenity) {
            menuController = new AmenityMenuController(mainActivity, pointDescription, (Amenity) object);
        } else if (object instanceof LatLon) {
            if (pointDescription.isMyLocation()) {
                menuController = new MyLocationMenuController(mainActivity, pointDescription);
            }
        }
    }
    if (menuController == null) {
        menuController = new PointDescriptionMenuController(mainActivity, pointDescription);
    }
    menuController.menuType = menuType;
    menuController.setLatLon(latLon);
    return menuController;
}
Also used : SampleApplication(net.osmand.core.samples.android.sample1.SampleApplication) Amenity(net.osmand.data.Amenity) LatLon(net.osmand.data.LatLon) AmenityMenuController(net.osmand.core.samples.android.sample1.mapcontextmenu.controllers.AmenityMenuController) MyLocationMenuController(net.osmand.core.samples.android.sample1.mapcontextmenu.controllers.MyLocationMenuController) PointDescriptionMenuController(net.osmand.core.samples.android.sample1.mapcontextmenu.controllers.PointDescriptionMenuController) AmenityMenuController(net.osmand.core.samples.android.sample1.mapcontextmenu.controllers.AmenityMenuController) PointDescriptionMenuController(net.osmand.core.samples.android.sample1.mapcontextmenu.controllers.PointDescriptionMenuController) MyLocationMenuController(net.osmand.core.samples.android.sample1.mapcontextmenu.controllers.MyLocationMenuController)

Aggregations

PointDescription (net.osmand.core.samples.android.sample1.data.PointDescription)5 LatLon (net.osmand.data.LatLon)4 Amenity (net.osmand.data.Amenity)3 View (android.view.View)2 OnClickListener (android.view.View.OnClickListener)2 ImageView (android.widget.ImageView)2 TextView (android.widget.TextView)2 SampleApplication (net.osmand.core.samples.android.sample1.SampleApplication)2 SuppressLint (android.annotation.SuppressLint)1 Bundle (android.os.Bundle)1 ContextThemeWrapper (android.support.v7.view.ContextThemeWrapper)1 AppCompatButton (android.support.v7.widget.AppCompatButton)1 Editable (android.text.Editable)1 TextWatcher (android.text.TextWatcher)1 LinearLayout (android.widget.LinearLayout)1 MainActivity (net.osmand.core.samples.android.sample1.MainActivity)1 AmenityMenuController (net.osmand.core.samples.android.sample1.mapcontextmenu.controllers.AmenityMenuController)1 MyLocationMenuController (net.osmand.core.samples.android.sample1.mapcontextmenu.controllers.MyLocationMenuController)1 PointDescriptionMenuController (net.osmand.core.samples.android.sample1.mapcontextmenu.controllers.PointDescriptionMenuController)1 City (net.osmand.data.City)1