Skip to content

Commit 784f631

Browse files
committed
brand features can now be loaded lazily per-country
1 parent fcf0740 commit 784f631

17 files changed

+359
-175
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ Requires Java 8.
1010

1111
## Installation
1212

13-
Add [`de.westnordost:osmfeatures:3.0`](https://mvnrepository.com/artifact/de.westnordost/osmfeatures/3.0/) as a Maven dependency or download the jar from there.
13+
Add [`de.westnordost:osmfeatures:4.0`](https://mvnrepository.com/artifact/de.westnordost/osmfeatures/4.0/) as a Maven dependency or download the jar from there.
1414

15-
For Android, use [`de.westnordost:osmfeatures-android:3.0`](https://mvnrepository.com/artifact/de.westnordost/osmfeatures-android/3.0/).
15+
For Android, use [`de.westnordost:osmfeatures-android:4.0`](https://mvnrepository.com/artifact/de.westnordost/osmfeatures-android/4.0/).
1616

1717
## Usage
1818

library-android/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
id 'signing'
55
}
66

7-
version = "3.0"
7+
version = "4.0"
88
group "de.westnordost"
99

1010
repositories {
@@ -15,18 +15,18 @@ repositories {
1515

1616
dependencies {
1717
//api (project(':library')) {
18-
api ('de.westnordost:osmfeatures:3.0') {
18+
api ('de.westnordost:osmfeatures:4.0') {
1919
// it's already included in Android
2020
exclude group: 'org.json', module: 'json'
2121
}
2222
}
2323

2424
android {
25-
compileSdkVersion 29
25+
compileSdkVersion 31
2626

2727
defaultConfig {
2828
minSdkVersion 9
29-
targetSdkVersion 29
29+
targetSdkVersion 31
3030
versionCode 1
3131
versionName project.version
3232
}

library-android/src/main/java/de/westnordost/osmfeatures/AndroidFeatureDictionary.java

+5-7
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
import android.content.res.AssetManager;
44

5-
import java.util.Arrays;
6-
75
public class AndroidFeatureDictionary
86
{
97
private AndroidFeatureDictionary() {} // cannot be instantiated
@@ -16,13 +14,13 @@ public static FeatureDictionary create(AssetManager assetManager, String presets
1614
/** Create a new FeatureDictionary which gets its data from the given directory in the app's
1715
* asset folder. Optionally, the path to the brand presets can be specified. */
1816
public static FeatureDictionary create(AssetManager assetManager, String presetsBasePath, String brandPresetsBasePath) {
19-
FeatureCollection featureCollection =
20-
new IDFeatureCollection(new AssetManagerAccess(assetManager, presetsBasePath));
17+
LocalizedFeatureCollection featureCollection =
18+
new IDLocalizedFeatureCollection(new AssetManagerAccess(assetManager, presetsBasePath));
2119

22-
FeatureCollection brandsFeatureCollection = brandPresetsBasePath != null
23-
? new IDBaseFeatureCollection(new AssetManagerAccess(assetManager, brandPresetsBasePath))
20+
PerCountryFeatureCollection brandsFeatureCollection = brandPresetsBasePath != null
21+
? new IDBrandPresetsFeatureCollection(new AssetManagerAccess(assetManager, brandPresetsBasePath))
2422
: null;
2523

26-
return new FeatureDictionary(Arrays.asList(featureCollection), Arrays.asList(brandsFeatureCollection));
24+
return new FeatureDictionary(featureCollection, brandsFeatureCollection);
2725
}
2826
}

library/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
id 'signing'
55
}
66

7-
version = "3.0"
7+
version = "4.0"
88
group "de.westnordost"
99

1010
repositories {

0 commit comments

Comments
 (0)