From de129d895a4795e2f2c69af8be2f49177c2ba4f6 Mon Sep 17 00:00:00 2001 From: Ray Yuan Liu Date: Sat, 4 Dec 2021 16:52:33 +0800 Subject: [PATCH] fix: fix the google map version to play services edition. --- app/build.gradle | 7 ++----- .../coffeefinder/details/DetailsFragment.kt | 2 +- .../coffeefinder/mainpage/MainActivity.kt | 2 +- .../louis383/coffeefinder/mainpage/MainView.kt | 2 +- .../louis383/coffeefinder/maps/MapsFragment.kt | 16 ++++++++-------- .../louis383/coffeefinder/maps/MapsPresenter.kt | 10 +++++----- .../com/louis383/coffeefinder/maps/MapsView.kt | 6 +++--- .../coffeefinder/uimodel/CoffeeShopUiModel.kt | 2 +- .../louis383/coffeefinder/utils/Extensions.kt | 2 +- .../coffeefinder/view/CoffeeListAdapter.kt | 2 +- app/src/main/res/layout/fragment_maps.xml | 2 +- 11 files changed, 25 insertions(+), 28 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index aa5296c..b3abefb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -112,11 +112,8 @@ dependencies { implementation project(":core") implementation project(":anchor-bottom-sheet-behavior") coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' - // FIXME:: map 3.1.0 use volley 1.1.0 which is not available on mavenCentral and google - // so we include it explicitly - implementation 'com.google.maps.android:maps-v3-ktx:3.1.0' - implementation 'com.google.android.libraries.maps:maps:3.1.0-beta' - implementation 'com.android.volley:volley:1.2.0' + implementation 'com.google.android.gms:play-services-maps:17.0.1' + implementation "com.google.android.gms:play-services-location:${gms_version}" // ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== implementation platform("org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.5.1") diff --git a/app/src/main/java/tw/com/louis383/coffeefinder/details/DetailsFragment.kt b/app/src/main/java/tw/com/louis383/coffeefinder/details/DetailsFragment.kt index 4d32954..de073b8 100644 --- a/app/src/main/java/tw/com/louis383/coffeefinder/details/DetailsFragment.kt +++ b/app/src/main/java/tw/com/louis383/coffeefinder/details/DetailsFragment.kt @@ -12,7 +12,7 @@ import android.widget.TextView import androidx.core.widget.NestedScrollView import androidx.fragment.app.Fragment import androidx.lifecycle.Lifecycle -import com.google.android.libraries.maps.model.LatLng +import com.google.android.gms.maps.model.LatLng import dagger.hilt.android.AndroidEntryPoint import tw.com.louis383.coffeefinder.R import tw.com.louis383.coffeefinder.core.CurrentLocationCarrier diff --git a/app/src/main/java/tw/com/louis383/coffeefinder/mainpage/MainActivity.kt b/app/src/main/java/tw/com/louis383/coffeefinder/mainpage/MainActivity.kt index 1f8b230..36d15c2 100644 --- a/app/src/main/java/tw/com/louis383/coffeefinder/mainpage/MainActivity.kt +++ b/app/src/main/java/tw/com/louis383/coffeefinder/mainpage/MainActivity.kt @@ -26,7 +26,7 @@ import androidx.core.splashscreen.SplashScreenViewProvider import androidx.lifecycle.LifecycleOwner import androidx.viewpager.widget.ViewPager import com.google.android.gms.common.api.ResolvableApiException -import com.google.android.libraries.maps.model.LatLng +import com.google.android.gms.maps.model.LatLng import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.snackbar.Snackbar import com.trafi.anchorbottomsheetbehavior.AnchorBottomSheetBehavior diff --git a/app/src/main/java/tw/com/louis383/coffeefinder/mainpage/MainView.kt b/app/src/main/java/tw/com/louis383/coffeefinder/mainpage/MainView.kt index 99189f7..97456d7 100644 --- a/app/src/main/java/tw/com/louis383/coffeefinder/mainpage/MainView.kt +++ b/app/src/main/java/tw/com/louis383/coffeefinder/mainpage/MainView.kt @@ -4,7 +4,7 @@ import android.content.Intent import androidx.annotation.StringRes import androidx.viewpager.widget.ViewPager import com.google.android.gms.common.api.ResolvableApiException -import com.google.android.libraries.maps.model.LatLng +import com.google.android.gms.maps.model.LatLng import com.trafi.anchorbottomsheetbehavior.AnchorBottomSheetBehavior import tw.com.louis383.coffeefinder.BaseView import tw.com.louis383.coffeefinder.core.domain.model.CoffeeShop diff --git a/app/src/main/java/tw/com/louis383/coffeefinder/maps/MapsFragment.kt b/app/src/main/java/tw/com/louis383/coffeefinder/maps/MapsFragment.kt index fdc9f34..8ab6d14 100644 --- a/app/src/main/java/tw/com/louis383/coffeefinder/maps/MapsFragment.kt +++ b/app/src/main/java/tw/com/louis383/coffeefinder/maps/MapsFragment.kt @@ -10,14 +10,14 @@ import android.view.View import android.view.ViewGroup import androidx.core.content.ContextCompat import androidx.lifecycle.LifecycleOwner -import com.google.android.libraries.maps.CameraUpdateFactory -import com.google.android.libraries.maps.GoogleMap -import com.google.android.libraries.maps.MapView -import com.google.android.libraries.maps.OnMapReadyCallback -import com.google.android.libraries.maps.model.BitmapDescriptor -import com.google.android.libraries.maps.model.LatLng -import com.google.android.libraries.maps.model.Marker -import com.google.android.libraries.maps.model.MarkerOptions +import com.google.android.gms.maps.CameraUpdateFactory +import com.google.android.gms.maps.GoogleMap +import com.google.android.gms.maps.MapView +import com.google.android.gms.maps.OnMapReadyCallback +import com.google.android.gms.maps.model.BitmapDescriptor +import com.google.android.gms.maps.model.LatLng +import com.google.android.gms.maps.model.Marker +import com.google.android.gms.maps.model.MarkerOptions import com.google.android.material.dialog.MaterialAlertDialogBuilder import dagger.hilt.android.AndroidEntryPoint import tw.com.louis383.coffeefinder.BaseFragment diff --git a/app/src/main/java/tw/com/louis383/coffeefinder/maps/MapsPresenter.kt b/app/src/main/java/tw/com/louis383/coffeefinder/maps/MapsPresenter.kt index d874172..9384d21 100644 --- a/app/src/main/java/tw/com/louis383/coffeefinder/maps/MapsPresenter.kt +++ b/app/src/main/java/tw/com/louis383/coffeefinder/maps/MapsPresenter.kt @@ -2,11 +2,11 @@ package tw.com.louis383.coffeefinder.maps import android.graphics.Bitmap import android.graphics.Canvas -import com.google.android.libraries.maps.GoogleMap -import com.google.android.libraries.maps.model.BitmapDescriptor -import com.google.android.libraries.maps.model.BitmapDescriptorFactory -import com.google.android.libraries.maps.model.LatLng -import com.google.android.libraries.maps.model.Marker +import com.google.android.gms.maps.GoogleMap +import com.google.android.gms.maps.model.BitmapDescriptor +import com.google.android.gms.maps.model.BitmapDescriptorFactory +import com.google.android.gms.maps.model.LatLng +import com.google.android.gms.maps.model.Marker import dagger.hilt.android.scopes.FragmentScoped import tw.com.louis383.coffeefinder.BasePresenter import tw.com.louis383.coffeefinder.R diff --git a/app/src/main/java/tw/com/louis383/coffeefinder/maps/MapsView.kt b/app/src/main/java/tw/com/louis383/coffeefinder/maps/MapsView.kt index d6eaa76..8e547a2 100644 --- a/app/src/main/java/tw/com/louis383/coffeefinder/maps/MapsView.kt +++ b/app/src/main/java/tw/com/louis383/coffeefinder/maps/MapsView.kt @@ -2,9 +2,9 @@ package tw.com.louis383.coffeefinder.maps import android.graphics.drawable.Drawable import androidx.annotation.DrawableRes -import com.google.android.libraries.maps.model.BitmapDescriptor -import com.google.android.libraries.maps.model.LatLng -import com.google.android.libraries.maps.model.Marker +import com.google.android.gms.maps.model.BitmapDescriptor +import com.google.android.gms.maps.model.LatLng +import com.google.android.gms.maps.model.Marker import tw.com.louis383.coffeefinder.BaseView import tw.com.louis383.coffeefinder.core.domain.model.CoffeeShop diff --git a/app/src/main/java/tw/com/louis383/coffeefinder/uimodel/CoffeeShopUiModel.kt b/app/src/main/java/tw/com/louis383/coffeefinder/uimodel/CoffeeShopUiModel.kt index 576d3fa..ac9428e 100644 --- a/app/src/main/java/tw/com/louis383/coffeefinder/uimodel/CoffeeShopUiModel.kt +++ b/app/src/main/java/tw/com/louis383/coffeefinder/uimodel/CoffeeShopUiModel.kt @@ -3,7 +3,7 @@ package tw.com.louis383.coffeefinder.uimodel import android.content.Context import android.net.Uri import android.text.TextUtils -import com.google.android.libraries.maps.model.LatLng +import com.google.android.gms.maps.model.LatLng import tw.com.louis383.coffeefinder.R import tw.com.louis383.coffeefinder.core.domain.model.CoffeeShop import tw.com.louis383.coffeefinder.utils.toMapLocation diff --git a/app/src/main/java/tw/com/louis383/coffeefinder/utils/Extensions.kt b/app/src/main/java/tw/com/louis383/coffeefinder/utils/Extensions.kt index c00f8ef..9b7913a 100644 --- a/app/src/main/java/tw/com/louis383/coffeefinder/utils/Extensions.kt +++ b/app/src/main/java/tw/com/louis383/coffeefinder/utils/Extensions.kt @@ -4,7 +4,7 @@ import android.app.Activity import android.location.Location import android.view.View import androidx.annotation.IdRes -import com.google.android.libraries.maps.model.LatLng +import com.google.android.gms.maps.model.LatLng import tw.com.louis383.coffeefinder.core.domain.model.MapLocation fun Activity.bindView(@IdRes resId: Int): Lazy = lazy { diff --git a/app/src/main/java/tw/com/louis383/coffeefinder/view/CoffeeListAdapter.kt b/app/src/main/java/tw/com/louis383/coffeefinder/view/CoffeeListAdapter.kt index c885997..da645fe 100644 --- a/app/src/main/java/tw/com/louis383/coffeefinder/view/CoffeeListAdapter.kt +++ b/app/src/main/java/tw/com/louis383/coffeefinder/view/CoffeeListAdapter.kt @@ -9,7 +9,7 @@ import android.widget.RatingBar import android.widget.TextView import androidx.core.content.ContextCompat import androidx.recyclerview.widget.RecyclerView -import com.google.android.libraries.maps.model.LatLng +import com.google.android.gms.maps.model.LatLng import tw.com.louis383.coffeefinder.R import tw.com.louis383.coffeefinder.core.domain.model.CoffeeShop import tw.com.louis383.coffeefinder.list.ListAdapterHandler diff --git a/app/src/main/res/layout/fragment_maps.xml b/app/src/main/res/layout/fragment_maps.xml index 150cb5a..bba6feb 100644 --- a/app/src/main/res/layout/fragment_maps.xml +++ b/app/src/main/res/layout/fragment_maps.xml @@ -1,4 +1,4 @@ -