diff options
author | Stefan Niedermann <info@niedermann.it> | 2023-03-24 17:46:25 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2023-03-24 17:46:25 +0300 |
commit | 6e3d7d6a52a9a6e680ab653b6ae42fbeeba2dcc2 (patch) | |
tree | bf408504570c38cf4f29c4e58742d7bf856701c7 /app/src | |
parent | 732fdae40d4d9c30509fe78b9fc18b07806e013a (diff) |
fix(import): Fix welcome message when importing first account
Signed-off-by: Stefan Niedermann <info@niedermann.it>
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountActivity.java | 2 | ||||
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountViewModel.java | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountActivity.java index 8702569dd..c8c6447d0 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountActivity.java @@ -72,7 +72,7 @@ public class ImportAccountActivity extends AppCompatActivity { originalWifiOnlyValue = sharedPreferences.getBoolean(prefKeyWifiOnly, false); - importAccountViewModel.hasAccounts().observe(this, hasAccounts -> binding.welcomeText.setText(hasAccounts + importAccountViewModel.hasAccounts().observeOnce(this, hasAccounts -> binding.welcomeText.setText(hasAccounts ? getString(R.string.welcome_text_further_accounts) : getString(R.string.welcome_text, getString(R.string.app_name)))); diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountViewModel.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountViewModel.java index c391bf01a..bdb7473cd 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountViewModel.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/ImportAccountViewModel.java @@ -3,8 +3,8 @@ package it.niedermann.nextcloud.deck.ui; import android.app.Application; import androidx.annotation.NonNull; -import androidx.lifecycle.LiveData; +import it.niedermann.android.reactivelivedata.ReactiveLiveData; import it.niedermann.nextcloud.deck.model.Account; import it.niedermann.nextcloud.deck.remote.api.IResponseCallback; import it.niedermann.nextcloud.deck.ui.viewmodel.BaseViewModel; @@ -15,8 +15,8 @@ public class ImportAccountViewModel extends BaseViewModel { super(application); } - public LiveData<Boolean> hasAccounts() { - return baseRepository.hasAccounts(); + public ReactiveLiveData<Boolean> hasAccounts() { + return new ReactiveLiveData<>(baseRepository.hasAccounts()); } public void saveCurrentAccount(@NonNull Account account) { |