Compare commits
4 Commits
46da74fa89
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 7848f9ad2d | |||
| 230421065b | |||
| e22e748b28 | |||
| 339ee7629b |
@@ -1,6 +1,7 @@
|
|||||||
*.iml
|
*.iml
|
||||||
.gradle
|
.gradle
|
||||||
/local.properties
|
/local.properties
|
||||||
|
/.idea
|
||||||
/.idea/caches
|
/.idea/caches
|
||||||
/.idea/libraries
|
/.idea/libraries
|
||||||
/.idea/modules.xml
|
/.idea/modules.xml
|
||||||
|
|||||||
+2
-2
@@ -23,8 +23,8 @@ android {
|
|||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 34
|
targetSdkVersion 34
|
||||||
compileSdkVersion 34
|
compileSdkVersion 34
|
||||||
versionCode 9
|
versionCode 10
|
||||||
versionName "0.4.0"
|
versionName "0.4.1"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
<queries>
|
<queries>
|
||||||
<package android:name="com.nextcloud.client" />
|
<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>
|
</queries>
|
||||||
|
|
||||||
<application
|
<application
|
||||||
|
|||||||
+4
-2
@@ -25,6 +25,7 @@ import android.util.Log;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
@@ -101,7 +102,8 @@ public class LoginActivity extends NextcloudMapsStyledActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
// TODO handle errors
|
Toast.makeText(LoginActivity.this, R.string.login_error, Toast.LENGTH_SHORT).show();
|
||||||
|
progress.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -114,7 +116,7 @@ public class LoginActivity extends NextcloudMapsStyledActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (AccountImportCancelledException e) {
|
} catch (AccountImportCancelledException e) {
|
||||||
e.printStackTrace();
|
progress.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package it.danieleverducci.nextcloudmaps.utils;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
import it.danieleverducci.nextcloudmaps.activity.main.GeofavoriteAdapter;
|
import it.danieleverducci.nextcloudmaps.activity.main.GeofavoriteAdapter;
|
||||||
@@ -50,7 +51,7 @@ public class SettingsManager {
|
|||||||
|
|
||||||
public static boolean isUseGoogleMaps(Context context) {
|
public static boolean isUseGoogleMaps(Context context) {
|
||||||
return PreferenceManager.getDefaultSharedPreferences(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) {
|
public static void setUseGoogleMaps(Context context, boolean value) {
|
||||||
@@ -65,4 +66,13 @@ public class SettingsManager {
|
|||||||
.putFloat(SETTING_LAST_MAP_POSITION_ZOOM, (float)zoom)
|
.putFloat(SETTING_LAST_MAP_POSITION_ZOOM, (float)zoom)
|
||||||
.apply();
|
.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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
<!-- Login Activity -->
|
<!-- Login Activity -->
|
||||||
<string name="choose_account">Scegli account</string>
|
<string name="choose_account">Scegli account</string>
|
||||||
|
<string name="login_error">Si è verificato un errore durante la login</string>
|
||||||
|
|
||||||
<!-- Geofavorites list -->
|
<!-- Geofavorites list -->
|
||||||
<string name="new_geobookmark">Nuovo geosegnalibro</string>
|
<string name="new_geobookmark">Nuovo geosegnalibro</string>
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
<!-- Login Activity -->
|
<!-- Login Activity -->
|
||||||
<string name="choose_account">Choose account</string>
|
<string name="choose_account">Choose account</string>
|
||||||
|
<string name="login_error">An error has occurred during the login</string>
|
||||||
|
|
||||||
<!-- Geofavorites list -->
|
<!-- Geofavorites list -->
|
||||||
<string name="new_geobookmark">New geofavorite</string>
|
<string name="new_geobookmark">New geofavorite</string>
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@ buildscript {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
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
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
#Sun Feb 20 08:50:37 CET 2022
|
#Sun Feb 20 08:50:37 CET 2022
|
||||||
distributionBase=GRADLE_USER_HOME
|
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
|
distributionPath=wrapper/dists
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
Reference in New Issue
Block a user