forked from mirror/monocles_chat_clean
show a green dot if user is using the app
This commit is contained in:
parent
06fb90706e
commit
c852082312
3 changed files with 28 additions and 0 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
12
src/main/res/drawable/active_indicator.xml
Normal file
12
src/main/res/drawable/active_indicator.xml
Normal 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>
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue