diff options
author | Stefan Niedermann <info@niedermann.it> | 2020-04-25 20:05:31 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2020-04-25 20:05:31 +0300 |
commit | fa8c686fa8c8a328cefdca99c70af5a3801897d4 (patch) | |
tree | 707fe09155caa57e2f9b09b5ecfbbdddedcdabdd /app/src/main/java/it/niedermann/nextcloud/deck/ui/MainViewModel.java | |
parent | 5cc4efcf91101e925c0daff63fcde10f755e16f5 (diff) |
Use ViewModel for current Board
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/ui/MainViewModel.java')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/MainViewModel.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainViewModel.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainViewModel.java index 64e20157b..a3d6d4492 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainViewModel.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainViewModel.java @@ -7,15 +7,16 @@ import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.ViewModel; import it.niedermann.nextcloud.deck.model.Account; -import it.niedermann.nextcloud.deck.model.full.FullBoard; +import it.niedermann.nextcloud.deck.model.Board; import it.niedermann.nextcloud.deck.model.internal.FilterInformation; +@SuppressWarnings("WeakerAccess") public class MainViewModel extends ViewModel { @NonNull private MutableLiveData<FilterInformation> filterInformation = new MutableLiveData<>(); private Account currentAccount; - private FullBoard currentBoard; + private Board currentBoard; public void postFilterInformation(@Nullable FilterInformation filterInformation) { this.filterInformation.postValue(filterInformation); @@ -34,11 +35,15 @@ public class MainViewModel extends ViewModel { this.currentAccount = currentAccount; } - public FullBoard getCurrentBoard() { - return currentBoard; + public void setCurrentBoard(Board currentBoard) { + this.currentBoard = currentBoard; } - public void setCurrentBoard(FullBoard currentBoard) { - this.currentBoard = currentBoard; + public Long getCurrentBoardLocalId() { + return this.currentBoard.getLocalId(); + } + + public boolean currentBoardHasEditPermission() { + return this.currentBoard.isPermissionEdit(); } } |