Choose OpenStreetMaps or Google Maps

pull/1375/head
Alex Baker 5 years ago
parent b3ea0abdee
commit 9096c5a687

@ -206,8 +206,7 @@ dependencies {
implementation("com.etebase:client:2.3.2") implementation("com.etebase:client:2.3.2")
implementation("com.github.QuadFlask:colorpicker:0.0.15") implementation("com.github.QuadFlask:colorpicker:0.0.15")
implementation("com.github.openid:AppAuth-Android:0.8.0") implementation("com.github.openid:AppAuth-Android:0.8.0")
implementation("org.osmdroid:osmdroid-android:6.1.10@aar")
genericImplementation("org.osmdroid:osmdroid-android:6.1.10@aar")
googleplayImplementation("com.google.firebase:firebase-crashlytics:${Versions.crashlytics}") googleplayImplementation("com.google.firebase:firebase-crashlytics:${Versions.crashlytics}")
googleplayImplementation("com.google.firebase:firebase-analytics:${Versions.analytics}") { googleplayImplementation("com.google.firebase:firebase-analytics:${Versions.analytics}") {

@ -814,3 +814,9 @@
name: google-http-client-gson name: google-http-client-gson
copyrightHolder: Google Inc. copyrightHolder: Google Inc.
license: The Apache Software License, Version 2.0 license: The Apache Software License, Version 2.0
- artifact: org.osmdroid:osmdroid-android:+
name: osmdroid-android
copyrightHolder: The OsmDroid Authors
license: The Apache Software License, Version 2.0
licenseUrl: http://www.apache.org/licenses/LICENSE-2.0
url: https://github.com/osmdroid/osmdroid

@ -6,4 +6,5 @@
<!--suppress CheckTagEmptyBody --> <!--suppress CheckTagEmptyBody -->
<string name="manage_subscription_url">%s</string> <string name="manage_subscription_url">%s</string>
<string name="support_email">support@tasks.org</string> <string name="support_email">support@tasks.org</string>
<string name="default_maps">1</string> <!-- OpenStreetMaps -->
</resources> </resources>

@ -9,6 +9,7 @@ import dagger.hilt.android.components.ViewModelComponent
import dagger.hilt.android.qualifiers.ApplicationContext import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.android.scopes.ActivityScoped import dagger.hilt.android.scopes.ActivityScoped
import dagger.hilt.android.scopes.ViewModelScoped import dagger.hilt.android.scopes.ViewModelScoped
import org.tasks.R
import org.tasks.billing.Inventory import org.tasks.billing.Inventory
import org.tasks.gtasks.PlayServices import org.tasks.gtasks.PlayServices
import org.tasks.location.* import org.tasks.location.*
@ -42,6 +43,11 @@ internal class LocationModule {
@Provides @Provides
@ActivityScoped @ActivityScoped
fun getMapFragment(@ApplicationContext context: Context): MapFragment = fun getMapFragment(
GoogleMapFragment(context) preferences: Preferences,
@ApplicationContext context: Context
): MapFragment = when (preferences.getIntegerFromString(R.string.p_map_tiles, 0)) {
1 -> OsmMapFragment(context)
else -> GoogleMapFragment(context)
}
} }

@ -6,4 +6,5 @@
<string name="p_purchases">purchases</string> <string name="p_purchases">purchases</string>
<string name="manage_subscription_url">https://play.google.com/store/account/subscriptions?sku=%s&amp;package=org.tasks</string> <string name="manage_subscription_url">https://play.google.com/store/account/subscriptions?sku=%s&amp;package=org.tasks</string>
<string name="support_email">play-support@tasks.org</string> <string name="support_email">play-support@tasks.org</string>
<string name="default_maps">0</string> <!-- Google Maps -->
</resources> </resources>

@ -1949,6 +1949,20 @@
"license": "The Apache Software License, Version 2.0", "license": "The Apache Software License, Version 2.0",
"normalizedLicense": "apache2", "normalizedLicense": "apache2",
"libraryName": "google-http-client-gson" "libraryName": "google-http-client-gson"
},
{
"artifactId": {
"name": "osmdroid-android",
"group": "org.osmdroid",
"version": "+"
},
"copyrightHolder": "The OsmDroid Authors",
"copyrightStatement": "Copyright &copy; The OsmDroid Authors. All rights reserved.",
"license": "The Apache Software License, Version 2.0",
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0",
"normalizedLicense": "apache2",
"url": "https://github.com/osmdroid/osmdroid",
"libraryName": "osmdroid-android"
} }
] ]
} }

@ -26,6 +26,7 @@ class LocationPreferences : InjectingPreferenceFragment() {
.setOnPreferenceChangeListener(this::onPlaceSearchChanged) .setOnPreferenceChangeListener(this::onPlaceSearchChanged)
} else { } else {
disable( disable(
R.string.p_map_tiles,
R.string.p_place_provider, R.string.p_place_provider,
) )
} }

@ -258,6 +258,16 @@
<item>@drawable/ic_octocat</item> <item>@drawable/ic_octocat</item>
</array> </array>
<string-array name="map_tile_names">
<item>@string/google_maps</item>
<item>@string/openstreetmap</item>
</string-array>
<string-array name="map_tile_values">
<item>0</item>
<item>1</item>
</string-array>
<string-array name="map_search_provider_names"> <string-array name="map_search_provider_names">
<item>@string/mapbox</item> <item>@string/mapbox</item>
<item>@string/map_search_google_places</item> <item>@string/map_search_google_places</item>

@ -398,6 +398,8 @@
<string name="p_linkify_task_edit">linkify_task_edit</string> <string name="p_linkify_task_edit">linkify_task_edit</string>
<string name="mapbox">Mapbox</string> <string name="mapbox">Mapbox</string>
<string name="map_search_google_places">Google Places</string> <string name="map_search_google_places">Google Places</string>
<string name="google_maps">Google Maps</string>
<string name="openstreetmap">OpenStreetMap</string>
<string name="p_place_provider">place_provider_v2</string> <string name="p_place_provider">place_provider_v2</string>
<string name="preference_screen">preference_screen</string> <string name="preference_screen">preference_screen</string>
<string name="p_add_to_top">google_tasks_add_to_top</string> <string name="p_add_to_top">google_tasks_add_to_top</string>
@ -445,4 +447,5 @@
<string name="event_sync_add_account">sync_add_account</string> <string name="event_sync_add_account">sync_add_account</string>
<string name="legacy_etesync">legacy_etesync</string> <string name="legacy_etesync">legacy_etesync</string>
<string name="param_type">type</string> <string name="param_type">type</string>
<string name="p_map_tiles">map_tiles</string>
</resources> </resources>

@ -698,4 +698,6 @@ File %1$s contained %2$s.\n\n
<string name="tasks_org_account">Tasks.org account</string> <string name="tasks_org_account">Tasks.org account</string>
<string name="get_tasks_org_account">Get Tasks.org account</string> <string name="get_tasks_org_account">Get Tasks.org account</string>
<string name="account_not_included">Not included with \'Name your price\' subscriptions</string> <string name="account_not_included">Not included with \'Name your price\' subscriptions</string>
<string name="maps">Maps</string>
<string name="map_tiles">Map tiles</string>
</resources> </resources>

@ -2,6 +2,20 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:key="@string/preference_screen"> android:key="@string/preference_screen">
<PreferenceCategory
android:key="@string/maps"
android:title="@string/maps">
<ListPreference
android:defaultValue="@string/default_maps"
android:key="@string/p_map_tiles"
android:title="@string/map_tiles"
android:entries="@array/map_tile_names"
android:entryValues="@array/map_tile_values"
android:summary="%s" />
</PreferenceCategory>
<PreferenceCategory <PreferenceCategory
android:key="@string/places" android:key="@string/places"
android:title="@string/places"> android:title="@string/places">

@ -15,7 +15,6 @@
++--- androidx.databinding:databinding-adapters:4.1.2 ++--- androidx.databinding:databinding-adapters:4.1.2
+| +--- androidx.databinding:databinding-common:4.1.2 +| +--- androidx.databinding:databinding-common:4.1.2
+| \--- androidx.databinding:databinding-runtime:4.1.2 (*) +| \--- androidx.databinding:databinding-runtime:4.1.2 (*)
++--- org.osmdroid:osmdroid-android:6.1.10
++--- com.gitlab.bitfireAT:dav4jvm:2.1.1 ++--- com.gitlab.bitfireAT:dav4jvm:2.1.1
+| +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.4.30 +| +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.4.30
+| | +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.4.30 +| | +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.4.30
@ -364,14 +363,15 @@
+| \--- com.squareup.okhttp3:logging-interceptor:3.12.1 (*) +| \--- com.squareup.okhttp3:logging-interceptor:3.12.1 (*)
++--- com.github.QuadFlask:colorpicker:0.0.15 ++--- com.github.QuadFlask:colorpicker:0.0.15
+| \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*) +| \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
+\--- com.github.openid:AppAuth-Android:0.8.0 ++--- com.github.openid:AppAuth-Android:0.8.0
+ +--- androidx.browser:browser:1.2.0 +| +--- androidx.browser:browser:1.2.0
+ | +--- androidx.core:core:1.1.0 -> 1.3.2 (*) +| | +--- androidx.core:core:1.1.0 -> 1.3.2 (*)
+ | +--- androidx.annotation:annotation:1.1.0 +| | +--- androidx.annotation:annotation:1.1.0
+ | +--- com.google.guava:listenablefuture:1.0 -> 9999.0-empty-to-avoid-conflict-with-guava +| | +--- com.google.guava:listenablefuture:1.0 -> 9999.0-empty-to-avoid-conflict-with-guava
+ | +--- androidx.collection:collection:1.1.0 (*) +| | +--- androidx.collection:collection:1.1.0 (*)
+ | +--- androidx.concurrent:concurrent-futures:1.0.0 +| | +--- androidx.concurrent:concurrent-futures:1.0.0
+ | | +--- com.google.guava:listenablefuture:1.0 -> 9999.0-empty-to-avoid-conflict-with-guava +| | | +--- com.google.guava:listenablefuture:1.0 -> 9999.0-empty-to-avoid-conflict-with-guava
+ | | \--- androidx.annotation:annotation:1.1.0 +| | | \--- androidx.annotation:annotation:1.1.0
+ | \--- androidx.interpolator:interpolator:1.0.0 (*) +| | \--- androidx.interpolator:interpolator:1.0.0 (*)
+ \--- androidx.annotation:annotation:1.1.0 +| \--- androidx.annotation:annotation:1.1.0
+\--- org.osmdroid:osmdroid-android:6.1.10

@ -494,14 +494,15 @@
+| \--- com.squareup.okhttp3:logging-interceptor:3.12.1 (*) +| \--- com.squareup.okhttp3:logging-interceptor:3.12.1 (*)
++--- com.github.QuadFlask:colorpicker:0.0.15 ++--- com.github.QuadFlask:colorpicker:0.0.15
+| \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*) +| \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
+\--- com.github.openid:AppAuth-Android:0.8.0 ++--- com.github.openid:AppAuth-Android:0.8.0
+ +--- androidx.browser:browser:1.2.0 +| +--- androidx.browser:browser:1.2.0
+ | +--- androidx.core:core:1.1.0 -> 1.3.2 (*) +| | +--- androidx.core:core:1.1.0 -> 1.3.2 (*)
+ | +--- androidx.annotation:annotation:1.1.0 +| | +--- androidx.annotation:annotation:1.1.0
+ | +--- com.google.guava:listenablefuture:1.0 -> 9999.0-empty-to-avoid-conflict-with-guava +| | +--- com.google.guava:listenablefuture:1.0 -> 9999.0-empty-to-avoid-conflict-with-guava
+ | +--- androidx.collection:collection:1.1.0 (*) +| | +--- androidx.collection:collection:1.1.0 (*)
+ | +--- androidx.concurrent:concurrent-futures:1.0.0 +| | +--- androidx.concurrent:concurrent-futures:1.0.0
+ | | +--- com.google.guava:listenablefuture:1.0 -> 9999.0-empty-to-avoid-conflict-with-guava +| | | +--- com.google.guava:listenablefuture:1.0 -> 9999.0-empty-to-avoid-conflict-with-guava
+ | | \--- androidx.annotation:annotation:1.1.0 +| | | \--- androidx.annotation:annotation:1.1.0
+ | \--- androidx.interpolator:interpolator:1.0.0 (*) +| | \--- androidx.interpolator:interpolator:1.0.0 (*)
+ \--- androidx.annotation:annotation:1.1.0 +| \--- androidx.annotation:annotation:1.1.0
+\--- org.osmdroid:osmdroid-android:6.1.10

Loading…
Cancel
Save