use of com.mapbox.pluginscalebar.ScaleBarOptions in project mapbox-plugins-android by mapbox.
the class ScaleBarTest method testTextBorder.
@Test
public void testTextBorder() {
validateTestSetup();
setupScaleBar();
invoke(mapboxMap, (uiController, mapboxMap) -> {
assertEquals(activity.getResources().getDimension(R.dimen.mapbox_scale_bar_text_border_width), scaleBarWidget.getTextBorderWidth(), 0);
assertTrue(scaleBarWidget.isShowTextBorder());
ScaleBarOptions option = new ScaleBarOptions(activity);
option.setTextBorderWidth(R.dimen.fab_margin);
scaleBarWidget = scaleBarPlugin.create(option);
assertNotNull(scaleBarWidget);
assertEquals(activity.getResources().getDimension(R.dimen.fab_margin), scaleBarWidget.getTextBorderWidth(), 0);
option = new ScaleBarOptions(activity);
option.setTextBorderWidth(100f);
scaleBarWidget = scaleBarPlugin.create(option);
assertNotNull(scaleBarWidget);
assertEquals(100f, scaleBarWidget.getTextBorderWidth(), 0);
option = new ScaleBarOptions(activity);
option.setShowTextBorder(false);
scaleBarWidget = scaleBarPlugin.create(option);
assertNotNull(scaleBarWidget);
assertFalse(scaleBarWidget.isShowTextBorder());
});
}
Aggregations