Updated libraries

This commit is contained in:
Daniele Verducci (Slimpenguin) 2024-02-16 08:11:58 +01:00
parent 334b540721
commit b15236580b
8 changed files with 50 additions and 30 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="CompilerConfiguration"> <component name="CompilerConfiguration">
<bytecodeTargetLevel target="11" /> <bytecodeTargetLevel target="17" />
</component> </component>
</project> </project>

View File

@ -7,11 +7,11 @@
<deviceKey> <deviceKey>
<Key> <Key>
<type value="VIRTUAL_DEVICE_PATH" /> <type value="VIRTUAL_DEVICE_PATH" />
<value value="$USER_HOME$/.android/avd/Pixel_5_API_29.avd" /> <value value="$USER_HOME$/.android/avd/Pixel_XL_Android_12.avd" />
</Key> </Key>
</deviceKey> </deviceKey>
</Target> </Target>
</targetSelectedWithDropDown> </targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2023-02-15T07:23:10.782369Z" /> <timeTargetWasSelectedWithDropDown value="2024-02-16T05:59:01.340872Z" />
</component> </component>
</project> </project>

View File

@ -26,5 +26,5 @@
</option> </option>
</component> </component>
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK" /> <component name="ProjectRootManager" version="2" languageLevel="JDK_17_PREVIEW" project-jdk-name="11" project-jdk-type="JavaSDK" />
</project> </project>

View File

@ -18,12 +18,12 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
android { android {
compileSdkVersion 33 compileSdkVersion 34
defaultConfig { defaultConfig {
applicationId "it.danieleverducci.nextcloudmaps" applicationId "it.danieleverducci.nextcloudmaps"
minSdkVersion 23 minSdkVersion 23
targetSdkVersion 33 targetSdkVersion 34
versionCode 8 versionCode 8
versionName "0.3.6" versionName "0.3.6"
@ -55,28 +55,34 @@ repositories {
dependencies { dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"]) implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'com.android.support:design:31.0.0' implementation 'com.android.support:design:34.0.0'
implementation 'androidx.appcompat:appcompat:1.3.1' implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.recyclerview:recyclerview:1.2.1' implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation "androidx.cardview:cardview:1.0.0" implementation "androidx.cardview:cardview:1.0.0"
implementation 'androidx.constraintlayout:constraintlayout:2.1.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "androidx.preference:preference:1.1.1" implementation "androidx.preference:preference:1.2.1"
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
// Retrofif2 // Retrofif2
implementation 'com.squareup.retrofit2:retrofit:2.9.0' implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.6.1' implementation 'com.squareup.retrofit2:converter-gson:2.6.1'
// Nextcloud SSO // Nextcloud SSO
implementation "com.github.nextcloud:Android-SingleSignOn:0.6.1" implementation "com.github.nextcloud:Android-SingleSignOn:1.0.0"
// OSMDroid // 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+) //Threeten-Backport (ports Java 8 Date API on Java 6+)
implementation 'org.threeten:threetenbp:1.5.1' 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'
}
}
} }

View File

@ -20,6 +20,8 @@ package it.danieleverducci.nextcloudmaps.activity.login;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
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;
@ -45,6 +47,7 @@ import it.danieleverducci.nextcloudmaps.api.API;
import it.danieleverducci.nextcloudmaps.api.ApiProvider; import it.danieleverducci.nextcloudmaps.api.ApiProvider;
public class LoginActivity extends NextcloudMapsStyledActivity { public class LoginActivity extends NextcloudMapsStyledActivity {
private static final String TAG = "LoginActivity";
protected ProgressBar progress; protected ProgressBar progress;
protected Button button; protected Button button;
@ -63,18 +66,25 @@ public class LoginActivity extends NextcloudMapsStyledActivity {
openAccountChooser(); openAccountChooser();
}); });
Handler h = new Handler();
h.post(() -> {
try { try {
ssoAccount = SingleAccountHelper.getCurrentSingleSignOnAccount(getApplicationContext()); ssoAccount = SingleAccountHelper.getCurrentSingleSignOnAccount(getApplicationContext());
SingleAccountHelper.setCurrentAccount(getApplicationContext(), ssoAccount.name); SingleAccountHelper.applyCurrentAccount(getApplicationContext(), ssoAccount.name);
accountAccessDone(); accountAccessDone();
} catch (NextcloudFilesAppAccountNotFoundException | NoCurrentAccountSelectedException e) { } catch (NextcloudFilesAppAccountNotFoundException | NoCurrentAccountSelectedException e) {
Log.e(TAG, "Autologin: " + e.toString());
} }
});
} }
private void openAccountChooser() { private void openAccountChooser() {
try { try {
AccountImporter.pickNewAccount(this); AccountImporter.pickNewAccount(this);
} catch (NextcloudFilesAppNotInstalledException | AndroidGetAccountsPermissionNotGranted e) { } catch (NextcloudFilesAppNotInstalledException | AndroidGetAccountsPermissionNotGranted e) {
UiExceptionManager.showDialogForException(this, 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 @Override
public void accountAccessGranted(SingleSignOnAccount account) { public void accountAccessGranted(SingleSignOnAccount account) {
Context l_context = getApplicationContext(); Context l_context = getApplicationContext();
SingleAccountHelper.setCurrentAccount(l_context, account.name); SingleAccountHelper.applyCurrentAccount(l_context, account.name);
accountAccessDone(); accountAccessDone();
} }

View File

@ -41,7 +41,6 @@ import androidx.lifecycle.ViewModelProvider;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager; import androidx.recyclerview.widget.StaggeredGridLayoutManager;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.google.android.material.card.MaterialCardView; import com.google.android.material.card.MaterialCardView;
import com.google.android.material.floatingactionbutton.FloatingActionButton; 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_CREATED;
import static it.danieleverducci.nextcloudmaps.activity.main.GeofavoriteAdapter.SORT_BY_TITLE; import static it.danieleverducci.nextcloudmaps.activity.main.GeofavoriteAdapter.SORT_BY_TITLE;
import androidx.lifecycle.Observer; import androidx.lifecycle.Observer;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
public class MainActivity extends NextcloudMapsStyledActivity implements OnSortingOrderListener { public class MainActivity extends NextcloudMapsStyledActivity implements OnSortingOrderListener {
@ -299,7 +299,7 @@ public class MainActivity extends NextcloudMapsStyledActivity implements OnSorti
private void switch_account() { private void switch_account() {
ApiProvider.logout(); ApiProvider.logout();
SingleAccountHelper.setCurrentAccount(this, null); SingleAccountHelper.applyCurrentAccount(this, null);
Intent intent = new Intent(MainActivity.this, LoginActivity.class); Intent intent = new Intent(MainActivity.this, LoginActivity.class);
startActivity(intent); startActivity(intent);
finish(); finish();

View File

@ -168,7 +168,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:fabSize="mini" app:fabSize="mini"
android:src="@drawable/ic_add_map" android:src="@drawable/ic_add_map"
app:backgroundTint="@color/defaultBrand"/> app:backgroundTint="@color/defaultBrand"
app:tint="@color/white"/>
<!-- Add from current position FAB --> <!-- Add from current position FAB -->
<com.google.android.material.floatingactionbutton.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
@ -179,7 +180,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:fabSize="mini" app:fabSize="mini"
android:src="@drawable/ic_add_gps" android:src="@drawable/ic_add_gps"
app:backgroundTint="@color/defaultBrand"/> app:backgroundTint="@color/defaultBrand"
app:tint="@color/white"/>
<!-- Main FAB --> <!-- Main FAB -->
<com.google.android.material.floatingactionbutton.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
@ -189,6 +191,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/ic_add" android:src="@drawable/ic_add"
app:backgroundTint="@color/defaultBrand"/> app:backgroundTint="@color/defaultBrand"
app:tint="@color/white"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -17,7 +17,8 @@
<resources> <resources>
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="BaseTheme" parent="Theme.AppCompat.DayNight.NoActionBar"> <!--<style name="BaseTheme" parent="Theme.AppCompat.DayNight.NoActionBar">-->
<style name="BaseTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="colorAccent">@color/defaultBrand</item> <item name="colorAccent">@color/defaultBrand</item>
<item name="colorControlNormal">?attr/colorAccent</item> <item name="colorControlNormal">?attr/colorAccent</item>
<item name="windowActionModeOverlay">true</item> <item name="windowActionModeOverlay">true</item>