Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e22e748b28 | |||
| 339ee7629b |
@@ -1,6 +1,7 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
<queries>
|
||||
<package android:name="com.nextcloud.client" />
|
||||
<!-- To see if Google Maps is installed, as it needs a specific intent Uri) -->
|
||||
<package android:name="com.google.android.apps.maps" />
|
||||
</queries>
|
||||
|
||||
<application
|
||||
|
||||
@@ -2,6 +2,7 @@ package it.danieleverducci.nextcloudmaps.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
|
||||
import androidx.preference.PreferenceManager;
|
||||
import it.danieleverducci.nextcloudmaps.activity.main.GeofavoriteAdapter;
|
||||
@@ -50,7 +51,7 @@ public class SettingsManager {
|
||||
|
||||
public static boolean isUseGoogleMaps(Context context) {
|
||||
return PreferenceManager.getDefaultSharedPreferences(context)
|
||||
.getBoolean(SETTING_USE_GOOGLE_MAPS, true);
|
||||
.getBoolean(SETTING_USE_GOOGLE_MAPS, isGoogleMapsInstalled(context));
|
||||
}
|
||||
|
||||
public static void setUseGoogleMaps(Context context, boolean value) {
|
||||
@@ -65,4 +66,13 @@ public class SettingsManager {
|
||||
.putFloat(SETTING_LAST_MAP_POSITION_ZOOM, (float)zoom)
|
||||
.apply();
|
||||
}
|
||||
|
||||
private static boolean isGoogleMapsInstalled(Context context) {
|
||||
try {
|
||||
context.getPackageManager().getApplicationInfo("com.google.android.apps.maps", 0);
|
||||
return true;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ buildscript {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:9.2.1'
|
||||
classpath 'com.android.tools.build:gradle:9.3.0'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
#Sun Feb 20 08:50:37 CET 2022
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
Reference in New Issue
Block a user