show a green dot if user is using the app

This commit is contained in:
Christian Schneppe 2022-09-26 17:51:16 +02:00 committed by Arne
parent 06fb90706e
commit c852082312
3 changed files with 28 additions and 0 deletions

View file

@ -260,6 +260,11 @@ public class ConversationAdapter
conversation,
viewHolder.binding.conversationImage,
R.dimen.avatar_on_conversation_overview);
if (conversation.getMode() == Conversational.MODE_SINGLE && conversation.getContact().isActive()) {
viewHolder.binding.userActiveIndicator.setVisibility(View.VISIBLE);
} else {
viewHolder.binding.userActiveIndicator.setVisibility(View.GONE);
}
viewHolder.itemView.setOnClickListener(v -> listener.onConversationClick(v, conversation));
}

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid
android:color="#ff388e3c"/>
<size
android:width="10dp"
android:height="10dp"/>
</shape>

View file

@ -26,6 +26,17 @@
android:layout_alignParentStart="true"
android:scaleType="centerCrop" />
<ImageView
android:id="@+id/user_active_indicator"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_alignBottom="@+id/conversation_image"
android:layout_alignEnd="@+id/conversation_image"
android:layout_marginBottom="0dp"
android:layout_marginEnd="0dp"
android:visibility="visible"
android:src="@drawable/active_indicator" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"