Updated libraries
This commit is contained in:
		@@ -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();
 | 
			
		||||
                }
 | 
			
		||||
 
 | 
			
		||||
@@ -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();
 | 
			
		||||
 
 | 
			
		||||
@@ -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"/>
 | 
			
		||||
 | 
			
		||||
    <!-- Add from current position FAB -->
 | 
			
		||||
    <com.google.android.material.floatingactionbutton.FloatingActionButton
 | 
			
		||||
@@ -179,7 +180,8 @@
 | 
			
		||||
        android:layout_height="wrap_content"
 | 
			
		||||
        app:fabSize="mini"
 | 
			
		||||
        android:src="@drawable/ic_add_gps"
 | 
			
		||||
        app:backgroundTint="@color/defaultBrand"/>
 | 
			
		||||
        app:backgroundTint="@color/defaultBrand"
 | 
			
		||||
        app:tint="@color/white"/>
 | 
			
		||||
 | 
			
		||||
    <!-- Main FAB -->
 | 
			
		||||
    <com.google.android.material.floatingactionbutton.FloatingActionButton
 | 
			
		||||
@@ -189,6 +191,7 @@
 | 
			
		||||
        android:layout_width="wrap_content"
 | 
			
		||||
        android:layout_height="wrap_content"
 | 
			
		||||
        android:src="@drawable/ic_add"
 | 
			
		||||
        app:backgroundTint="@color/defaultBrand"/>
 | 
			
		||||
        app:backgroundTint="@color/defaultBrand"
 | 
			
		||||
        app:tint="@color/white"/>
 | 
			
		||||
 | 
			
		||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
 | 
			
		||||
@@ -17,7 +17,8 @@
 | 
			
		||||
 | 
			
		||||
<resources>
 | 
			
		||||
    <!-- 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="colorControlNormal">?attr/colorAccent</item>
 | 
			
		||||
        <item name="windowActionModeOverlay">true</item>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user