diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index fb7f4a8..b589d56 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml
index 0f21aad..dd779ac 100644
--- a/.idea/deploymentTargetDropDown.xml
+++ b/.idea/deploymentTargetDropDown.xml
@@ -7,11 +7,11 @@
-
+
-
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 0a57690..09ec3ac 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -26,5 +26,5 @@
-
+
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index 69f38aa..26fbc7d 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -18,12 +18,12 @@
apply plugin: 'com.android.application'
android {
- compileSdkVersion 33
+ compileSdkVersion 34
defaultConfig {
applicationId "it.danieleverducci.nextcloudmaps"
minSdkVersion 23
- targetSdkVersion 33
+ targetSdkVersion 34
versionCode 8
versionName "0.3.6"
@@ -55,28 +55,34 @@ repositories {
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
- implementation 'com.android.support:design:31.0.0'
- implementation 'androidx.appcompat:appcompat:1.3.1'
- implementation 'androidx.recyclerview:recyclerview:1.2.1'
+ implementation 'com.android.support:design:34.0.0'
+ implementation 'androidx.appcompat:appcompat:1.6.1'
+ implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation "androidx.cardview:cardview:1.0.0"
- implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
- implementation "androidx.preference:preference:1.1.1"
-
- testImplementation 'junit:junit:4.13.2'
- androidTestImplementation 'androidx.test.ext:junit:1.1.3'
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
+ implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
+ implementation "androidx.preference:preference:1.2.1"
+ implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
// Retrofif2
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.6.1'
// Nextcloud SSO
- implementation "com.github.nextcloud:Android-SingleSignOn:0.6.1"
+ implementation "com.github.nextcloud:Android-SingleSignOn:1.0.0"
// OSMDroid
- implementation 'org.osmdroid:osmdroid-android:6.1.10'
+ implementation 'org.osmdroid:osmdroid-android:6.1.18'
//Threeten-Backport (ports Java 8 Date API on Java 6+)
implementation 'org.threeten:threetenbp:1.5.1'
+ // https://mvnrepository.com/artifact/commons-io/commons-io
+ implementation 'commons-io:commons-io:2.11.0'
+
+ configurations.all {
+ resolutionStrategy {
+ force 'commons-io:commons-io:2.11.0'
+ }
+ }
+
}
diff --git a/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/login/LoginActivity.java b/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/login/LoginActivity.java
index 00d3ecf..f9a55b9 100644
--- a/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/login/LoginActivity.java
+++ b/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/login/LoginActivity.java
@@ -20,6 +20,8 @@ package it.danieleverducci.nextcloudmaps.activity.login;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
+import android.os.Handler;
+import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ProgressBar;
@@ -45,6 +47,7 @@ import it.danieleverducci.nextcloudmaps.api.API;
import it.danieleverducci.nextcloudmaps.api.ApiProvider;
public class LoginActivity extends NextcloudMapsStyledActivity {
+ private static final String TAG = "LoginActivity";
protected ProgressBar progress;
protected Button button;
@@ -63,18 +66,25 @@ public class LoginActivity extends NextcloudMapsStyledActivity {
openAccountChooser();
});
- try {
- ssoAccount = SingleAccountHelper.getCurrentSingleSignOnAccount(getApplicationContext());
- SingleAccountHelper.setCurrentAccount(getApplicationContext(), ssoAccount.name);
- accountAccessDone();
- } catch (NextcloudFilesAppAccountNotFoundException | NoCurrentAccountSelectedException e) {
- }
+ Handler h = new Handler();
+ h.post(() -> {
+ try {
+ ssoAccount = SingleAccountHelper.getCurrentSingleSignOnAccount(getApplicationContext());
+ SingleAccountHelper.applyCurrentAccount(getApplicationContext(), ssoAccount.name);
+ accountAccessDone();
+ } catch (NextcloudFilesAppAccountNotFoundException | NoCurrentAccountSelectedException e) {
+ Log.e(TAG, "Autologin: " + e.toString());
+ }
+ });
}
private void openAccountChooser() {
try {
AccountImporter.pickNewAccount(this);
} catch (NextcloudFilesAppNotInstalledException | AndroidGetAccountsPermissionNotGranted e) {
UiExceptionManager.showDialogForException(this, e);
+
+ Log.e(TAG, "openAccountChooser: " + e.toString());
+ progress.setVisibility(View.GONE);
}
}
@@ -98,7 +108,7 @@ public class LoginActivity extends NextcloudMapsStyledActivity {
@Override
public void accountAccessGranted(SingleSignOnAccount account) {
Context l_context = getApplicationContext();
- SingleAccountHelper.setCurrentAccount(l_context, account.name);
+ SingleAccountHelper.applyCurrentAccount(l_context, account.name);
accountAccessDone();
}
diff --git a/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/main/MainActivity.java b/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/main/MainActivity.java
index 41eb4e5..004578a 100644
--- a/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/main/MainActivity.java
+++ b/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/main/MainActivity.java
@@ -41,7 +41,6 @@ import androidx.lifecycle.ViewModelProvider;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
-import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.google.android.material.card.MaterialCardView;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
@@ -69,6 +68,7 @@ import static it.danieleverducci.nextcloudmaps.activity.main.GeofavoriteAdapter.
import static it.danieleverducci.nextcloudmaps.activity.main.GeofavoriteAdapter.SORT_BY_CREATED;
import static it.danieleverducci.nextcloudmaps.activity.main.GeofavoriteAdapter.SORT_BY_TITLE;
import androidx.lifecycle.Observer;
+import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
public class MainActivity extends NextcloudMapsStyledActivity implements OnSortingOrderListener {
@@ -299,7 +299,7 @@ public class MainActivity extends NextcloudMapsStyledActivity implements OnSorti
private void switch_account() {
ApiProvider.logout();
- SingleAccountHelper.setCurrentAccount(this, null);
+ SingleAccountHelper.applyCurrentAccount(this, null);
Intent intent = new Intent(MainActivity.this, LoginActivity.class);
startActivity(intent);
finish();
diff --git a/app/src/main/res/layout/activity_list_view.xml b/app/src/main/res/layout/activity_list_view.xml
index d4b5675..8c5230e 100644
--- a/app/src/main/res/layout/activity_list_view.xml
+++ b/app/src/main/res/layout/activity_list_view.xml
@@ -168,7 +168,8 @@
android:layout_height="wrap_content"
app:fabSize="mini"
android:src="@drawable/ic_add_map"
- app:backgroundTint="@color/defaultBrand"/>
+ app:backgroundTint="@color/defaultBrand"
+ app:tint="@color/white"/>
+ app:backgroundTint="@color/defaultBrand"
+ app:tint="@color/white"/>
+ app:backgroundTint="@color/defaultBrand"
+ app:tint="@color/white"/>
\ No newline at end of file
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index cf80e46..e5b3f1a 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -17,7 +17,8 @@
-