diff --git a/app/build.gradle b/app/build.gradle index 7541169f7..0fe5e4794 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,13 +40,11 @@ android { debug { versionNameSuffix "Version: " resValue "string", "version", "${versionNameSuffix}${defaultConfig.versionName}" - resValue "string", "google_maps_key", google_key } release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' resValue "string", "version", "${defaultConfig.versionName}" - resValue "string", "google_maps_key", google_key if (LOCAL_KEY_PRESENT || TRAVIS_BUILD) signingConfig signingConfigs.release } @@ -114,10 +112,9 @@ dependencies { annotationProcessor "com.jakewharton:butterknife-compiler:$rootProject.butterKnifeVersion" // Map libraries - fdroidImplementation "org.osmdroid:osmdroid-android:$rootProject.osmVersion" - fdroidImplementation "org.osmdroid:osmdroid-mapsforge:$rootProject.mapsforgeVersion" - fdroidImplementation "org.osmdroid:osmdroid-geopackage:$rootProject.geoPackageVersion" - playstoreImplementation "com.google.android.gms:play-services-maps:$rootProject.googleMapsVersion" + implementation "org.osmdroid:osmdroid-android:$rootProject.osmVersion" + implementation "org.osmdroid:osmdroid-mapsforge:$rootProject.mapsforgeVersion" + implementation "org.osmdroid:osmdroid-geopackage:$rootProject.geoPackageVersion" implementation 'androidx.multidex:multidex:2.0.1' implementation "io.realm:android-adapters:$rootProject.realmAdapter" diff --git a/app/src/fdroid/java/io/pslab/activity/MapsActivity.java b/app/src/main/java/io/pslab/activity/MapsActivity.java similarity index 100% rename from app/src/fdroid/java/io/pslab/activity/MapsActivity.java rename to app/src/main/java/io/pslab/activity/MapsActivity.java diff --git a/app/src/playstore/AndroidManifest.xml b/app/src/playstore/AndroidManifest.xml deleted file mode 100644 index ebbe6f7b5..000000000 --- a/app/src/playstore/AndroidManifest.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/app/src/playstore/java/io/pslab/activity/MapsActivity.java b/app/src/playstore/java/io/pslab/activity/MapsActivity.java deleted file mode 100644 index c67acf9e5..000000000 --- a/app/src/playstore/java/io/pslab/activity/MapsActivity.java +++ /dev/null @@ -1,59 +0,0 @@ -package io.pslab.activity; - -import androidx.fragment.app.FragmentActivity; -import android.os.Bundle; -import com.google.android.material.snackbar.Snackbar; - -import com.google.android.gms.maps.CameraUpdateFactory; -import com.google.android.gms.maps.GoogleMap; -import com.google.android.gms.maps.OnMapReadyCallback; -import com.google.android.gms.maps.SupportMapFragment; -import com.google.android.gms.maps.model.LatLng; -import com.google.android.gms.maps.model.MarkerOptions; - -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import io.pslab.R; -import io.pslab.others.CustomSnackBar; - -public class MapsActivity extends FragmentActivity implements OnMapReadyCallback { - - private GoogleMap mMap; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_google_maps); - SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() - .findFragmentById(R.id.map); - mapFragment.getMapAsync(this); - } - - - @Override - public void onMapReady(GoogleMap googleMap) { - mMap = googleMap; - if (getIntent().getExtras() != null && getIntent().getExtras().getBoolean("hasMarkers")) { - try { - JSONArray markers = new JSONArray(getIntent().getExtras().getString("markers")); - addMarkers(markers); - } catch (JSONException e) { - e.printStackTrace(); - } - } else { - CustomSnackBar.showSnackBar(findViewById(android.R.id.content), - getString(R.string.no_location_specified),null,null, Snackbar.LENGTH_SHORT); - } - } - - private void addMarkers(JSONArray markers) throws JSONException { - for (int i = 0; i < markers.length(); i++) { - JSONObject marker = markers.getJSONObject(i); - LatLng location = new LatLng(marker.getDouble("lat"),marker.getDouble("lon")); - mMap.addMarker(new MarkerOptions().position(location).title("Location")); - mMap.moveCamera(CameraUpdateFactory.newLatLng(location)); - } - } -} diff --git a/app/src/playstore/res/layout/activity_google_maps.xml b/app/src/playstore/res/layout/activity_google_maps.xml deleted file mode 100644 index b60604cbf..000000000 --- a/app/src/playstore/res/layout/activity_google_maps.xml +++ /dev/null @@ -1,9 +0,0 @@ - - \ No newline at end of file