File tree Expand file tree Collapse file tree 4 files changed +36
-2
lines changed
java/it/niedermann/owncloud/notes Expand file tree Collapse file tree 4 files changed +36
-2
lines changed Original file line number Diff line number Diff line change 2121
2222import com .google .android .material .dialog .MaterialAlertDialogBuilder ;
2323import com .owncloud .android .lib .resources .users .Status ;
24+ import com .owncloud .android .lib .resources .users .StatusType ;
2425
2526import java .util .concurrent .ExecutorService ;
2627import java .util .concurrent .Executors ;
3940import it .niedermann .owncloud .notes .share .helper .AvatarLoader ;
4041import it .niedermann .owncloud .notes .shared .util .DisplayUtils ;
4142import it .niedermann .owncloud .notes .util .ActivityExtensionsKt ;
43+ import it .niedermann .owncloud .notes .util .StatusTypeExtensionsKt ;
4244import kotlin .Unit ;
4345
4446/**
@@ -97,6 +99,10 @@ private void initRepositoryAndFetchCurrentStatus() {
9799 if (emoji != null ) {
98100 binding .accountStatusEmoji .setVisibility (View .VISIBLE );
99101 binding .accountStatusEmoji .setText (emoji );
102+ } else {
103+ final var status = currentStatus .getStatus ();
104+ binding .accountStatusIcon .setVisibility (View .VISIBLE );
105+ binding .accountStatusIcon .setImageResource (StatusTypeExtensionsKt .getImageResource (status ));
100106 }
101107 });
102108 });
Original file line number Diff line number Diff line change 1+ /*
2+ * Nextcloud Notes - Android Client
3+ *
4+ * SPDX-FileCopyrightText: 2015-2025 Nextcloud GmbH and Nextcloud contributors
5+ * SPDX-License-Identifier: GPL-3.0-or-later
6+ */
7+ package it.niedermann.owncloud.notes.util
8+
9+ import com.owncloud.android.lib.resources.users.StatusType
10+ import it.niedermann.owncloud.notes.R
11+
12+ val StatusType .imageResource: Int
13+ get() = when (this ) {
14+ StatusType .ONLINE -> R .drawable.ic_user_status_online
15+ StatusType .OFFLINE -> R .drawable.ic_user_status_busy
16+ StatusType .DND -> R .drawable.ic_user_status_dnd
17+ StatusType .AWAY -> R .drawable.ic_user_status_away
18+ StatusType .INVISIBLE -> R .drawable.ic_user_status_invisible
19+ StatusType .BUSY -> R .drawable.ic_user_status_busy
20+ }
Original file line number Diff line number Diff line change 4141 android : layout_gravity =" bottom|end"
4242 android : textSize =" @dimen/emoji_size"
4343 android : visibility =" gone"
44- android : translationX =" 2dp"
45- android : translationY =" 2dp"
4644 tools : visibility =" visible"
4745 tools : text =" 😀"
4846 android : background =" @android:color/transparent" />
47+
48+ <androidx .appcompat.widget.AppCompatImageView
49+ android : id =" @+id/accountStatusIcon"
50+ android : layout_width =" @dimen/user_status_icon_size"
51+ android : layout_height =" @dimen/user_status_icon_size"
52+ android : layout_gravity =" bottom|end"
53+ android : visibility =" gone"
54+ app : srcCompat =" @drawable/ic_user_status_away"
55+ tools : visibility =" visible" />
4956 </FrameLayout >
5057
5158 <LinearLayout
Original file line number Diff line number Diff line change 2626 <dimen name =" bottom_navigation_view_margin" >100dp</dimen >
2727
2828 <dimen name =" avatar_size" >40dp</dimen >
29+ <dimen name =" user_status_icon_size" >16dp</dimen >
2930
3031 <dimen name =" activity_row_layout_min_width_independent" >196dip</dimen >
3132 <dimen name =" activity_row_layout_height" >48dp</dimen >
You can’t perform that action at this time.
0 commit comments