Search in sources :

Example 6 with OfflineTilePyramidRegionDefinition

use of com.mapbox.mapboxsdk.offline.OfflineTilePyramidRegionDefinition in project osm-contributor by jawg.

the class OfflineRegionsActivity method selectOfflineRegion.

private void selectOfflineRegion(int position) {
    if (selectedRegionItem != null) {
        selectedRegionItem.setSelected(false);
    }
    selectedRegionItem = adapter.getOfflineRegion(position);
    selectedRegionItem.setSelected(true);
    OfflineTilePyramidRegionDefinition definition = (OfflineTilePyramidRegionDefinition) selectedRegionItem.getOfflineRegion().getDefinition();
    animateCameraToBounds(definition.getBounds());
    if (selectedRegionItem.getStatus().isComplete()) {
        switchMode(Mode.STATUS_COMPLETE);
    } else {
        switchMode(Mode.STATUS_INCOMPLETE);
    }
    closeEditMenu();
    adapter.notifyDataSetChanged();
}
Also used : OfflineTilePyramidRegionDefinition(com.mapbox.mapboxsdk.offline.OfflineTilePyramidRegionDefinition)

Aggregations

OfflineTilePyramidRegionDefinition (com.mapbox.mapboxsdk.offline.OfflineTilePyramidRegionDefinition)6 LatLng (com.mapbox.mapboxsdk.geometry.LatLng)2 OfflineRegion (com.mapbox.mapboxsdk.offline.OfflineRegion)2 PointF (android.graphics.PointF)1 RectF (android.graphics.RectF)1 OnClick (butterknife.OnClick)1 LatLngBounds (com.mapbox.mapboxsdk.geometry.LatLngBounds)1 OfflineManager (com.mapbox.mapboxsdk.offline.OfflineManager)1 NotificationOptions (com.mapbox.mapboxsdk.plugins.offline.model.NotificationOptions)1 OfflineRegionManager (io.jawg.osmcontributor.offline.OfflineRegionManager)1 OfflineRegionCreatedEvent (io.jawg.osmcontributor.offline.events.OfflineRegionCreatedEvent)1