diff --git a/README.md b/README.md index 99f9afa..3f0c362 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ UnifiedPush provider for Nextcloud - android application height="80">](https://f-droid.org/packages/org.unifiedpush.distributor.nextpush/) ## Usage -This application require the [server application](https://github.com/UP-NextPush/server-app) to be intalled on the server and the [Nextcloud application](https://apps.nextcloud.com/apps/android_nextcloud_app) on the mobile phone. +This application require the [server application](https://github.com/UP-NextPush/server-app) to be installed on the server and the [Nextcloud application](https://apps.nextcloud.com/apps/android_nextcloud_app) on the mobile phone. ## Credit This application has been inspired by [Nextcloud Push Notifier](https://gitlab.com/Nextcloud-Push/nextcloud-push-notifier) diff --git a/app/build.gradle b/app/build.gradle index dda1928..7a9c0a0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,8 +17,8 @@ android { applicationId "org.unifiedpush.distributor.nextpush" minSdkVersion 24 targetSdkVersion 30 - versionCode 6 - versionName "1.0.1" + versionCode 7 + versionName "1.1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/java/org/unifiedpush/distributor/nextpush/account/AccountUtils.kt b/app/src/main/java/org/unifiedpush/distributor/nextpush/account/AccountUtils.kt index 67d1bd3..796b303 100644 --- a/app/src/main/java/org/unifiedpush/distributor/nextpush/account/AccountUtils.kt +++ b/app/src/main/java/org/unifiedpush/distributor/nextpush/account/AccountUtils.kt @@ -65,11 +65,14 @@ fun nextcloudAppNotInstalledDialog(context: Context) { builder.show() } -fun isConnected(context: Context) : Boolean { +fun isConnected(context: Context, showDialog: Boolean = false) : Boolean { try { ssoAccount = SingleAccountHelper.getCurrentSingleSignOnAccount(context) } catch (e: NextcloudFilesAppAccountNotFoundException) { - nextcloudAppNotInstalledDialog(context) + if (showDialog) { + nextcloudAppNotInstalledDialog(context) + } + return false } catch (e: NoCurrentAccountSelectedException) { Log.d(TAG,"Device is not connected") return false diff --git a/app/src/main/java/org/unifiedpush/distributor/nextpush/activities/MainActivity.kt b/app/src/main/java/org/unifiedpush/distributor/nextpush/activities/MainActivity.kt index 0a55a86..ebc35c8 100644 --- a/app/src/main/java/org/unifiedpush/distributor/nextpush/activities/MainActivity.kt +++ b/app/src/main/java/org/unifiedpush/distributor/nextpush/activities/MainActivity.kt @@ -46,7 +46,7 @@ class MainActivity : AppCompatActivity() { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) setSupportActionBar(findViewById(R.id.toolbar)) - if (isConnected(this)) { + if (isConnected(this, showDialog = true)) { showMain() } else { findViewById