[android] ensure default local ideographs font family is not overwrote
This commit is contained in:
@@ -69,7 +69,7 @@ public class MapboxMapOptions implements Parcelable {
|
||||
|
||||
private boolean prefetchesTiles = true;
|
||||
private boolean zMediaOverlay = false;
|
||||
private String localIdeographFontFamily = "sans-serif";
|
||||
private String localIdeographFontFamily;
|
||||
|
||||
private String apiBaseUri;
|
||||
|
||||
@@ -246,8 +246,14 @@ public class MapboxMapOptions implements Parcelable {
|
||||
typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_enableTilePrefetch, true));
|
||||
mapboxMapOptions.renderSurfaceOnTop(
|
||||
typedArray.getBoolean(R.styleable.mapbox_MapView_mapbox_enableZMediaOverlay, false));
|
||||
mapboxMapOptions.localIdeographFontFamily(
|
||||
typedArray.getString(R.styleable.mapbox_MapView_mapbox_localIdeographFontFamily));
|
||||
|
||||
String localIdeographFontFamily =
|
||||
typedArray.getString(R.styleable.mapbox_MapView_mapbox_localIdeographFontFamily);
|
||||
if (localIdeographFontFamily == null) {
|
||||
localIdeographFontFamily = "sans-serif";
|
||||
}
|
||||
mapboxMapOptions.localIdeographFontFamily(localIdeographFontFamily);
|
||||
|
||||
mapboxMapOptions.pixelRatio(
|
||||
typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_pixelRatio, 0));
|
||||
mapboxMapOptions.foregroundLoadColor(
|
||||
|
||||
@@ -8,6 +8,9 @@ import com.mapbox.mapboxsdk.constants.MapboxConstants;
|
||||
import com.mapbox.mapboxsdk.geometry.LatLng;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.RuntimeEnvironment;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@@ -18,6 +21,7 @@ import static org.junit.Assert.assertNotEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class MapboxMapOptionsTest {
|
||||
|
||||
private static final double DELTA = 1e-15;
|
||||
@@ -172,5 +176,11 @@ public class MapboxMapOptionsTest {
|
||||
assertTrue(new MapboxMapOptions().crossSourceCollisions(true).getCrossSourceCollisions());
|
||||
assertFalse(new MapboxMapOptions().crossSourceCollisions(false).getCrossSourceCollisions());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLocalIdeographFontFamily_enabledByDefault() {
|
||||
MapboxMapOptions options = MapboxMapOptions.createFromAttributes(RuntimeEnvironment.application, null);
|
||||
assertEquals("sans-serif", options.getLocalIdeographFontFamily());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user