Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,17 @@ protected void bindSearchableContent(@NonNull Context context, @NonNull TextView
}
}

protected void bindNoteSharedIcon(@NonNull Context context, boolean shared, @NonNull ImageView noteShareIcon, int color) {
if (shared) {
noteShareIcon.setVisibility(VISIBLE);
} else {
noteShareIcon.setVisibility(INVISIBLE);
Comment thread
alperozturk96 marked this conversation as resolved.
Outdated
}

final var util = BrandingUtil.of(color, context);
util.platform.colorImageView(noteShareIcon,ColorRole.PRIMARY);
}
Comment thread
alperozturk96 marked this conversation as resolved.

public abstract void showSwipe(float dX);

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public void bind(boolean isSelected, @NonNull Note note, boolean showCategory, @
bindModified(binding.noteModified, note.getModified());
bindSearchableContent(context, binding.noteTitle, searchQuery, note.getTitle(), color);
bindSearchableContent(context, binding.noteExcerpt, searchQuery, note.getExcerpt().replace(EXCERPT_LINE_SEPARATOR, "\n"), color);
bindNoteSharedIcon(context, note.isShared(), binding.noteShared, color);
binding.noteExcerpt.setVisibility(TextUtils.isEmpty(note.getExcerpt()) ? GONE : VISIBLE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public void bind(boolean isSelected, @NonNull Note note, boolean showCategory, i
bindFavorite(binding.noteFavorite, note.getFavorite());
bindModified(binding.noteModified, note.getModified());
bindSearchableContent(context, binding.noteTitle, searchQuery, note.getTitle(), color);
bindNoteSharedIcon(context, note.isShared(), binding.noteShared, color);
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public void bind(boolean isSelected, @NonNull Note note, boolean showCategory, @
} else {
bindSearchableContent(context, binding.noteExcerpt, searchQuery, note.getExcerpt(), color);
}

bindNoteSharedIcon(context, note.isShared(), binding.noteShared, color);
}

@NonNull
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/res/layout/item_notes_list_note_item_grid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,18 @@
android:layout_marginEnd="@dimen/spacer_2x"
tools:text="27.11." />

<ImageView
android:id="@+id/noteShared"
android:layout_width="@dimen/note_shared_icon_size"
android:layout_height="@dimen/note_shared_icon_size"
android:layout_gravity="end"
android:contentDescription="@string/menu_shared_note"
android:visibility="gone"
app:srcCompat="@drawable/ic_share_white_24dp"
android:layout_marginEnd="@dimen/spacer_2x"
app:tint="@color/defaultBrand"
tools:visibility="visible" />

</LinearLayout>
</LinearLayout>
</LinearLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,18 @@
android:layout_marginEnd="@dimen/spacer_2x"
tools:text="27.11." />

<ImageView
android:id="@+id/noteShared"
android:layout_width="@dimen/note_shared_icon_size"
android:layout_height="@dimen/note_shared_icon_size"
android:layout_gravity="end"
android:contentDescription="@string/menu_shared_note"
android:visibility="gone"
app:srcCompat="@drawable/ic_share_white_24dp"
android:layout_marginEnd="@dimen/spacer_2x"
app:tint="@color/defaultBrand"
tools:visibility="visible" />

</LinearLayout>
</LinearLayout>
</LinearLayout>
Expand Down
14 changes: 14 additions & 0 deletions app/src/main/res/layout/item_notes_list_note_item_with_excerpt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@

<LinearLayout
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content">

<TextView
Expand All @@ -135,8 +136,10 @@

</LinearLayout>


<LinearLayout
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content">

<TextView
Expand Down Expand Up @@ -164,6 +167,17 @@
android:textSize="@dimen/secondary_font_size"
tools:maxLength="15"
tools:text="@tools:sample/lorem/random" />

<ImageView
android:id="@+id/noteShared"
android:layout_marginStart="@dimen/spacer_1x"
android:layout_width="@dimen/note_shared_icon_size"
android:layout_height="@dimen/note_shared_icon_size"
android:contentDescription="@string/menu_shared_note"
android:visibility="gone"
app:srcCompat="@drawable/ic_share_white_24dp"
app:tint="@color/defaultBrand"
tools:visibility="visible" />
</LinearLayout>
</LinearLayout>

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
<dimen name="button_extra_width">180dp</dimen>
<dimen name="bottom_navigation_view_margin">100dp</dimen>

<dimen name="note_shared_icon_size">16dp</dimen>

<dimen name="avatar_size">40dp</dimen>
<dimen name="user_status_icon_size">16dp</dimen>

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<string name="menu_favorite">Favorite</string>
<string name="menu_preview">Preview</string>
<string name="menu_share">Share</string>
<string name="menu_shared_note">Shared note</string>
<string name="common_loading">Loading…</string>


Expand Down
Loading