diff options
author | Stefan Niedermann <info@niedermann.it> | 2023-03-09 17:35:01 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2023-03-09 17:35:01 +0300 |
commit | f1c83d7fe8e7a114c66c9c9acefd0d8e5c2432c8 (patch) | |
tree | 974b213cd9822f0c4edbbe05d4876e5d063313ec /app/src | |
parent | 387508a4109baf7c287806a63288154d5ef6f287 (diff) |
feat: Simplify layout of title-only cards
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/card/CardAdapter.java | 6 | ||||
-rw-r--r-- | app/src/main/res/layout/item_card_default_only_title.xml | 49 |
2 files changed, 17 insertions, 38 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 38388615b..6ec82339d 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 @@ -87,9 +87,9 @@ public class CardAdapter extends RecyclerView.Adapter<AbstractCardViewHolder> im return R.layout.item_card_compact; } else { final var fullCard = cardList.get(position); - if (fullCard.getAttachments().size() == 0 - && fullCard.getAssignedUsers().size() == 0 - && fullCard.getLabels().size() == 0 + if (fullCard.getAttachments().isEmpty() + && fullCard.getAssignedUsers().isEmpty() + && fullCard.getLabels().isEmpty() && fullCard.getCommentCount() == 0 && fullCard.getCard().getTaskStatus().taskCount == 0) { return R.layout.item_card_default_only_title; diff --git a/app/src/main/res/layout/item_card_default_only_title.xml b/app/src/main/res/layout/item_card_default_only_title.xml index 868ff6594..1739a2905 100644 --- a/app/src/main/res/layout/item_card_default_only_title.xml +++ b/app/src/main/res/layout/item_card_default_only_title.xml @@ -9,31 +9,19 @@ android:layout_marginVertical="@dimen/spacer_1x"> <LinearLayout - android:id="@+id/coverImages" - android:layout_width="match_parent" - android:layout_height="130dp" - android:layout_rowWeight="1" - android:layout_columnWeight="1" - android:layout_marginBottom="@dimen/spacer_1x" - android:orientation="horizontal" - android:visibility="gone" - tools:visibility="visible" /> - - <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" + android:paddingVertical="@dimen/spacer_1x" android:paddingStart="@dimen/spacer_2x" - android:paddingTop="@dimen/spacer_1x" - android:paddingEnd="@dimen/spacer_1x" - android:paddingBottom="@dimen/spacer_1x"> + android:paddingEnd="@dimen/spacer_1x"> - <TextView + <com.google.android.material.textview.MaterialTextView android:id="@+id/card_title" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_marginTop="4sp" android:layout_weight="1" + android:paddingVertical="2sp" android:textColor="?attr/colorAccent" android:textSize="18sp" tools:ignore="RtlSymmetry" @@ -49,25 +37,16 @@ app:srcCompat="@drawable/ic_sync_blue_24dp" tools:visibility="visible" /> - <LinearLayout + <com.google.android.material.textview.MaterialTextView + android:id="@+id/card_due_date" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:orientation="horizontal" - android:paddingStart="@dimen/spacer_1hx" - tools:ignore="RtlSymmetry"> - - <androidx.appcompat.widget.AppCompatTextView - android:id="@+id/card_due_date" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:drawablePadding="@dimen/spacer_1hx" - android:gravity="center" - android:padding="@dimen/spacer_1hx" - android:paddingEnd="@dimen/spacer_1x" - app:drawableStartCompat="@drawable/calendar_blank_grey600_24dp" - tools:text="tomorrow" /> - - </LinearLayout> + android:drawablePadding="@dimen/spacer_1hx" + android:gravity="center" + android:paddingHorizontal="@dimen/spacer_1x" + android:paddingVertical="@dimen/spacer_1hx" + app:drawableStartCompat="@drawable/calendar_blank_grey600_24dp" + tools:text="tomorrow" /> <ImageView android:id="@+id/card_menu" @@ -76,7 +55,7 @@ android:background="?attr/selectableItemBackgroundBorderless" android:contentDescription="@string/label_menu" android:padding="@dimen/spacer_1hx" - android:tint="?attr/colorAccent" - app:srcCompat="@drawable/ic_menu" /> + app:srcCompat="@drawable/ic_menu" + app:tint="?attr/colorAccent" /> </LinearLayout> </com.google.android.material.card.MaterialCardView>
\ No newline at end of file |