Skip to content

Commit d1708ed

Browse files
style(list): Make list item design more compact/dense
Signed-off-by: Andy Scherzinger <[email protected]>
1 parent bcccc25 commit d1708ed

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

app/src/main/java/it/niedermann/owncloud/notes/main/items/ItemAdapter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,18 @@ public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int
140140
BrandingUtil.of(color, parent.getContext()).platform.colorTextView(binding.sectionTitle);
141141
return new SectionViewHolder(binding);
142142
}
143-
case TYPE_NOTE_WITH_EXCERPT -> {
143+
case TYPE_NOTE_WITH_EXCERPT,TYPE_NOTE_ONLY_TITLE, TYPE_NOTE_WITHOUT_EXCERPT -> {
144144
ItemNotesListNoteItemWithExcerptBinding binding = ItemNotesListNoteItemWithExcerptBinding.inflate(inflater, parent, false);
145145
BrandingUtil.of(color, parent.getContext()).notes.themeCard(binding.noteCard);
146146
return new NoteViewHolderWithExcerpt(binding, noteClickListener);
147147
}
148+
/*
148149
case TYPE_NOTE_ONLY_TITLE, TYPE_NOTE_WITHOUT_EXCERPT -> {
149150
ItemNotesListNoteItemWithoutExcerptBinding binding = ItemNotesListNoteItemWithoutExcerptBinding.inflate(inflater, parent, false);
150151
BrandingUtil.of(color, parent.getContext()).notes.themeCard(binding.noteCard);
151152
return new NoteViewHolderWithoutExcerpt(binding, noteClickListener);
152153
}
154+
*/
153155
default -> {
154156
throw new IllegalArgumentException("Not supported viewType: " + viewType);
155157
}

app/src/main/res/layout/item_notes_list_note_item_with_excerpt.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,21 @@
6868

6969
<ImageView
7070
android:id="@+id/noteFavorite"
71-
android:layout_width="56dp"
71+
android:layout_width="wrap_content"
7272
android:layout_height="match_parent"
7373
android:background="?attr/selectableItemBackgroundBorderless"
7474
android:contentDescription="@string/menu_favorite"
75-
android:padding="@dimen/spacer_2x"
75+
android:padding="@dimen/spacer_1x"
7676
tools:src="@drawable/ic_star_yellow_24dp" />
7777

7878
<ImageView
7979
android:id="@+id/custom_checkbox"
80-
android:layout_width="56dp"
80+
android:layout_width="wrap_content"
8181
android:layout_height="match_parent"
8282
android:clickable="false"
8383
android:contentDescription="@null"
8484
android:focusable="false"
85-
android:padding="@dimen/spacer_2x"
85+
android:padding="@dimen/spacer_1x"
8686
android:src="@drawable/ic_checkbox_blank_outline" />
8787

8888
<androidx.appcompat.widget.AppCompatImageView
@@ -101,9 +101,10 @@
101101
android:layout_height="wrap_content"
102102
android:layout_weight="1"
103103
android:orientation="vertical"
104-
android:paddingVertical="@dimen/spacer_2x"
104+
android:paddingTop="@dimen/spacer_1hx"
105+
android:paddingBottom="@dimen/spacer_1x"
105106
android:paddingStart="@dimen/zero"
106-
android:paddingEnd="@dimen/spacer_2x">
107+
android:paddingEnd="@dimen/spacer_1x">
107108

108109
<LinearLayout
109110
android:layout_width="match_parent"

0 commit comments

Comments
 (0)