diff options
author | Andy Scherzinger <info@andy-scherzinger.de> | 2019-03-12 20:14:50 +0300 |
---|---|---|
committer | Andy Scherzinger <info@andy-scherzinger.de> | 2019-03-12 20:14:50 +0300 |
commit | 2cdf384100e20de535bfe4162d72e2af2a7e0d8c (patch) | |
tree | 21f8ee973ca7f3b571111d561a219b9fd7db2d17 | |
parent | cfca43bd9f6912fdf87971c8ae17af38536749f8 (diff) |
remove description and run refresh on UI thread
3 files changed, 10 insertions, 21 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardAdapter.java index c37398ea6..fd43d58dd 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardAdapter.java @@ -84,11 +84,8 @@ public class CardAdapter extends RecyclerView.Adapter<CardAdapter.CardViewHolder viewHolder.cardTitle.setText(card.getCard().getTitle()); if (card.getCard().getDescription() != null && !card.getCard().getDescription().isEmpty()) { - viewHolder.cardDescription.setText(card.getCard().getDescription()); - viewHolder.cardDescription.setVisibility(View.VISIBLE); viewHolder.cardDescriptionIcon.setVisibility(View.VISIBLE); } else { - viewHolder.cardDescription.setVisibility(View.GONE); viewHolder.cardDescriptionIcon.setVisibility(View.GONE); } @@ -220,8 +217,6 @@ public class CardAdapter extends RecyclerView.Adapter<CardAdapter.CardViewHolder MaterialCardView card; @BindView(R.id.card_title) TextView cardTitle; - @BindView(R.id.card_description) - TextView cardDescription; @BindView(R.id.labels) ChipGroup labels; @BindView(R.id.card_description_icon) 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 6d682cd39..bf20a1355 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 @@ -94,15 +94,17 @@ public class StackFragment extends Fragment { } private void refreshView() { - 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) { - adapter.setCardList(cards); + getActivity().runOnUiThread(() -> + 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) { + adapter.setCardList(cards); + } + }); } - }); - } - }); + }) + ); } diff --git a/app/src/main/res/layout/fragment_card.xml b/app/src/main/res/layout/fragment_card.xml index 0f2e5d59c..f036e6c38 100644 --- a/app/src/main/res/layout/fragment_card.xml +++ b/app/src/main/res/layout/fragment_card.xml @@ -24,14 +24,6 @@ android:textSize="18sp" tools:text="Card Title" /> - <TextView - android:id="@+id/card_description" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:ellipsize="end" - android:maxLines="3" - tools:text="Card detailed description\nmultiline\n3 lines tops." /> - <com.google.android.material.chip.ChipGroup android:id="@+id/labels" android:layout_width="match_parent" |