Stuff with removing online presence

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-08-23 14:18:52 +02:00
parent 48ff5247b0
commit 1961947b91
7 changed files with 83 additions and 89 deletions

View File

@ -206,18 +206,6 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
switch (conversation.getType()) { switch (conversation.getType()) {
case ROOM_TYPE_ONE_TO_ONE_CALL: case ROOM_TYPE_ONE_TO_ONE_CALL:
holder.onlineIndicator.setVisibility(View.VISIBLE);
if (conversation.getCount() > 0) {
if (conversation.getCount() == 2 || (conversation.getCount() == 1 &&
conversation.getSessionId().equals("0"))) {
holder.onlineIndicator.setBackground(context.getDrawable(R.drawable.shape_bubble_online));
} else {
holder.onlineIndicator.setBackground(context.getDrawable(R.drawable.shape_bubble_offline));
}
} else {
holder.onlineIndicator.setBackground(context.getDrawable(R.drawable.shape_bubble_offline));
}
if (!TextUtils.isEmpty(conversation.getName())) { if (!TextUtils.isEmpty(conversation.getName())) {
GlideUrl glideUrl = new GlideUrl(ApiUtils.getUrlForAvatarWithName(userEntity.getBaseUrl(), GlideUrl glideUrl = new GlideUrl(ApiUtils.getUrlForAvatarWithName(userEntity.getBaseUrl(),
@ -240,7 +228,6 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
} }
break; break;
case ROOM_GROUP_CALL: case ROOM_GROUP_CALL:
holder.onlineIndicator.setVisibility(View.GONE);
GlideApp.with(context) GlideApp.with(context)
.asBitmap() .asBitmap()
@ -252,7 +239,6 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
.into(holder.dialogAvatar); .into(holder.dialogAvatar);
break; break;
case ROOM_PUBLIC_CALL: case ROOM_PUBLIC_CALL:
holder.onlineIndicator.setVisibility(View.GONE);
GlideApp.with(context) GlideApp.with(context)
.asBitmap() .asBitmap()
.diskCacheStrategy(DiskCacheStrategy.NONE) .diskCacheStrategy(DiskCacheStrategy.NONE)
@ -264,7 +250,6 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
break; break;
default: default:
holder.onlineIndicator.setVisibility(View.GONE);
holder.dialogAvatar.setVisibility(View.GONE); holder.dialogAvatar.setVisibility(View.GONE);
} }
@ -290,8 +275,6 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
TextView dialogLastMessage; TextView dialogLastMessage;
@BindView(R.id.dialogUnreadBubble) @BindView(R.id.dialogUnreadBubble)
TextView dialogUnreadBubble; TextView dialogUnreadBubble;
@BindView(R.id.onlineIndicator)
ImageView onlineIndicator;
@BindView(R.id.passwordProtectedRoomImageView) @BindView(R.id.passwordProtectedRoomImageView)
ImageView passwordProtectedRoomImageView; ImageView passwordProtectedRoomImageView;
@BindView(R.id.favoriteConversationImageView) @BindView(R.id.favoriteConversationImageView)

View File

@ -1,13 +0,0 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#AAAAAA"/>
<stroke
android:width="2dp"
android:color="@color/white"/>
<size
android:width="20dp"
android:height="20dp"/>
</shape>

View File

@ -1,13 +0,0 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#38C059"/>
<stroke
android:width="2dp"
android:color="@color/white"/>
<size
android:width="20dp"
android:height="20dp"/>
</shape>

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Nextcloud Talk application
~
~ @author Mario Danic
~ Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com>
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape
android:shape="oval">
<solid android:color="@color/white"/>
</shape>
</item>
<item android:drawable="@drawable/ic_star_grey600_24dp"/>
</layer-list>

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Nextcloud Talk application
~
~ @author Mario Danic
~ Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com>
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape
android:shape="oval">
<solid android:color="@color/white"/>
</shape>
</item>
<item android:drawable="@drawable/ic_lock_grey600_24px"/>
</layer-list>

View File

@ -34,10 +34,10 @@
android:layout_margin="16dp"> android:layout_margin="16dp">
<FrameLayout <FrameLayout
android:id="@+id/dialogAvatarFrameLayout"
android:layout_width="@dimen/avatar_size" android:layout_width="@dimen/avatar_size"
android:layout_height="@dimen/avatar_size" android:layout_height="@dimen/avatar_size"
android:layout_centerVertical="true" android:layout_centerVertical="true">
android:id="@+id/dialogAvatarFrameLayout">
<ImageView <ImageView
android:id="@id/dialogAvatar" android:id="@id/dialogAvatar"
@ -45,28 +45,33 @@
android:layout_height="@dimen/avatar_size"/> android:layout_height="@dimen/avatar_size"/>
<ImageView <ImageView
android:id="@+id/onlineIndicator" android:id="@+id/passwordProtectedRoomImageView"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_gravity="bottom|end"
android:background="@drawable/shape_lock_bubble"/>
<ImageView
android:id="@+id/favoriteConversationImageView"
android:layout_width="12dp" android:layout_width="12dp"
android:layout_height="12dp" android:layout_height="12dp"
android:layout_gravity="top|end" android:layout_gravity="top|end"
android:background="@drawable/shape_bubble_online" android:background="@drawable/shape_favorite_bubble"/>
/>
</FrameLayout> </FrameLayout>
<TextView <TextView
android:id="@id/dialogName" android:id="@id/dialogName"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/nc_incoming_text_default"
android:textSize="16sp"
android:layout_alignTop="@id/dialogAvatarFrameLayout" android:layout_alignTop="@id/dialogAvatarFrameLayout"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_toEndOf="@id/dialogAvatarFrameLayout" android:layout_toEndOf="@id/dialogAvatarFrameLayout"
android:layout_toStartOf="@id/dialogDate" android:layout_toStartOf="@id/dialogDate"
android:ellipsize="end" android:ellipsize="end"
android:includeFontPadding="false" android:includeFontPadding="false"
android:maxLines="1"/> android:maxLines="1"
android:textColor="@color/nc_incoming_text_default"
android:textSize="16sp"/>
<TextView <TextView
android:id="@id/dialogDate" android:id="@id/dialogDate"
@ -74,8 +79,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:ellipsize="end" android:ellipsize="end"
android:textColor="@color/warm_grey_two" android:maxLines="1"
android:maxLines="1"/> android:textColor="@color/warm_grey_two"/>
<RelativeLayout <RelativeLayout
android:id="@+id/dialogLastMessageLayout" android:id="@+id/dialogLastMessageLayout"
@ -90,8 +95,8 @@
android:id="@id/dialogLastMessageUserAvatar" android:id="@id/dialogLastMessageUserAvatar"
android:layout_width="@dimen/small_item_height" android:layout_width="@dimen/small_item_height"
android:layout_height="@dimen/small_item_height" android:layout_height="@dimen/small_item_height"
android:layout_marginEnd="8dp" android:layout_centerVertical="true"
android:layout_centerVertical="true"/> android:layout_marginEnd="8dp"/>
<TextView <TextView
android:id="@id/dialogLastMessage" android:id="@id/dialogLastMessage"
@ -100,54 +105,26 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_toEndOf="@id/dialogLastMessageUserAvatar" android:layout_toEndOf="@id/dialogLastMessageUserAvatar"
android:layout_toStartOf="@id/dialogUnreadBubble" android:layout_toStartOf="@id/dialogUnreadBubble"
android:textColor="@color/warm_grey_four"
android:ellipsize="end" android:ellipsize="end"
android:gravity="top" android:gravity="top"
android:maxLines="2"
android:singleLine="false" android:singleLine="false"
android:maxLines="2"/> android:textColor="@color/warm_grey_four"/>
<TextView <TextView
android:id="@id/dialogUnreadBubble" android:id="@id/dialogUnreadBubble"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:background="@drawable/bubble_circle_unread" android:background="@drawable/bubble_circle_unread"
android:gravity="center" android:gravity="center"
android:textAlignment="center"
android:lines="1" android:lines="1"
android:textAlignment="center"
android:textColor="@color/white"/> android:textColor="@color/white"/>
</RelativeLayout> </RelativeLayout>
</RelativeLayout> </RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="8dp">
<ImageView
android:id="@+id/passwordProtectedRoomImageView"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_marginBottom="4dp"
android:layout_toStartOf="@id/favoriteConversationImageView"
android:src="@drawable/ic_lock_grey600_24px"
android:visibility="visible"/>
<ImageView
android:id="@+id/favoriteConversationImageView"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_marginBottom="4dp"
android:layout_alignParentEnd="true"
android:src="@drawable/ic_star_grey600_24dp"
android:visibility="visible"/>
</RelativeLayout>
</RelativeLayout> </RelativeLayout>