diff options
author | stefan-niedermann <info@niedermann.it> | 2019-09-15 16:57:00 +0300 |
---|---|---|
committer | stefan-niedermann <info@niedermann.it> | 2019-09-15 16:57:00 +0300 |
commit | c71d4e9f40f0a30f80090dcf17600d3c061d52a8 (patch) | |
tree | 0ce58a11084708718e9f595ca38c518f467f0143 /app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java | |
parent | a78a2bcef238ce8f6eca2f316c8884d003602069 (diff) |
Introduce "no cards yet"-view
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java index 01da756da..804bfb3e6 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/StackFragment.java @@ -5,6 +5,7 @@ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.LinearLayout; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; @@ -41,6 +42,8 @@ public class StackFragment extends Fragment { SwipeRefreshLayout swipeRefreshLayout; @BindView(R.id.recycler_view) RecyclerView recyclerView; + @BindView(R.id.no_cards) + LinearLayout noCards; /** * @param boardId of the current stack @@ -76,7 +79,7 @@ public class StackFragment extends Fragment { initRecyclerView(); if (getActivity() != null) { - if (syncManager == null){ + if (syncManager == null) { syncManager = new SyncManager(getActivity()); initRecyclerView(); } @@ -111,7 +114,10 @@ public class StackFragment extends Fragment { syncManager.getStack(account.getId(), stackId).observe(StackFragment.this, (FullStack stack) -> { if (stack != null) { syncManager.getFullCardsForStack(account.getId(), stack.getLocalId()).observe(StackFragment.this, (List<FullCard> cards) -> { - if (cards != null) { + if (cards == null || cards.size() == 0) { + this.noCards.setVisibility(View.VISIBLE); + } else { + this.noCards.setVisibility(View.GONE); adapter.setCardList(cards); } }); |