@Test public void testSetMBTileLayers() { ReflectionHelpers.setField(mbTilesHelper, "mbtilesDir", new File("src/test/resources/")); mbTilesHelper.setMBTileLayers(context, switcherPlugin); verify(switcherPlugin, times(2)).addBaseLayer(any(MBTilesLayer.class), eq(false)); }
public void setMBTileLayers(Context context, BaseLayerSwitcherPlugin baseLayerSwitcherPlugin) { if (mbtilesDir.exists() && mbtilesDir.exists() && mbtilesDir.listFiles() != null) { for (File mbTile : mbtilesDir.listFiles()) { MBTilesLayer mbTilesLayer = new MBTilesLayer(context, mbTile, this); if (!TextUtils.isEmpty(mbTilesLayer.getDisplayName())) { baseLayerSwitcherPlugin.addBaseLayer(mbTilesLayer, false); } } } }
MBTilesHelper { public void setMBTileLayers(Context context, BaseLayerSwitcherPlugin baseLayerSwitcherPlugin) { if (mbtilesDir.exists() && mbtilesDir.exists() && mbtilesDir.listFiles() != null) { for (File mbTile : mbtilesDir.listFiles()) { MBTilesLayer mbTilesLayer = new MBTilesLayer(context, mbTile, this); if (!TextUtils.isEmpty(mbTilesLayer.getDisplayName())) { baseLayerSwitcherPlugin.addBaseLayer(mbTilesLayer, false); } } } } }
MBTilesHelper { public void setMBTileLayers(Context context, BaseLayerSwitcherPlugin baseLayerSwitcherPlugin) { if (mbtilesDir.exists() && mbtilesDir.exists() && mbtilesDir.listFiles() != null) { for (File mbTile : mbtilesDir.listFiles()) { MBTilesLayer mbTilesLayer = new MBTilesLayer(context, mbTile, this); if (!TextUtils.isEmpty(mbTilesLayer.getDisplayName())) { baseLayerSwitcherPlugin.addBaseLayer(mbTilesLayer, false); } } } }  }
MBTilesHelper { public void setMBTileLayers(Context context, BaseLayerSwitcherPlugin baseLayerSwitcherPlugin) { if (mbtilesDir.exists() && mbtilesDir.exists() && mbtilesDir.listFiles() != null) { for (File mbTile : mbtilesDir.listFiles()) { MBTilesLayer mbTilesLayer = new MBTilesLayer(context, mbTile, this); if (!TextUtils.isEmpty(mbTilesLayer.getDisplayName())) { baseLayerSwitcherPlugin.addBaseLayer(mbTilesLayer, false); } } } }  void initializeMbTileslayers(@NonNull Style style, List<File> offlineFiles); Pair<Set<Source>, Set<Layer>> initializeMbTileslayers(File offlineFile); void setMBTileLayers(Context context, BaseLayerSwitcherPlugin baseLayerSwitcherPlugin); void onDestroy(); }
MBTilesHelper { public void setMBTileLayers(Context context, BaseLayerSwitcherPlugin baseLayerSwitcherPlugin) { if (mbtilesDir.exists() && mbtilesDir.exists() && mbtilesDir.listFiles() != null) { for (File mbTile : mbtilesDir.listFiles()) { MBTilesLayer mbTilesLayer = new MBTilesLayer(context, mbTile, this); if (!TextUtils.isEmpty(mbTilesLayer.getDisplayName())) { baseLayerSwitcherPlugin.addBaseLayer(mbTilesLayer, false); } } } }  void initializeMbTileslayers(@NonNull Style style, List<File> offlineFiles); Pair<Set<Source>, Set<Layer>> initializeMbTileslayers(File offlineFile); void setMBTileLayers(Context context, BaseLayerSwitcherPlugin baseLayerSwitcherPlugin); void onDestroy(); static final String MB_TILES_EXTENSION; static final String MB_TILES_DIRECTORY; }