From 1411051bba78a9eb6d296a7ba14e7a2e51c8e03b Mon Sep 17 00:00:00 2001
From: Yenel Rodriguez <yr@mega.nz>
Date: Thu, 4 Apr 2019 15:57:38 +0200
Subject: [PATCH] Add new private icon to chat conversation screen

---
 .../megachat/ChatActivityLollipop.java        | 11 ++--
 app/src/main/res/layout/activity_chat.xml     | 50 +++++++++++--------
 2 files changed, 32 insertions(+), 29 deletions(-)

diff --git a/app/src/main/java/mega/privacy/android/app/lollipop/megachat/ChatActivityLollipop.java b/app/src/main/java/mega/privacy/android/app/lollipop/megachat/ChatActivityLollipop.java
index d0734154421..48ba98a827a 100644
--- a/app/src/main/java/mega/privacy/android/app/lollipop/megachat/ChatActivityLollipop.java
+++ b/app/src/main/java/mega/privacy/android/app/lollipop/megachat/ChatActivityLollipop.java
@@ -992,15 +992,10 @@ public void onClick(DialogInterface dialog, int whichButton) {
                 titleToolbar.setText(chatRoom.getTitle());
                 setChatSubtitle();
 
-                if (!chatRoom.isPublic() && chatRoom.isGroup()) {
-                    RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) titleToolbar.getLayoutParams();
-                    params.addRule(RelativeLayout.LEFT_OF, privateIconToolbar.getId());
-                    titleToolbar.setLayoutParams(params);
+                if (!chatRoom.isPublic()) {
                     privateIconToolbar.setVisibility(View.VISIBLE);
-                } else {
-                    RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) titleToolbar.getLayoutParams();
-                    params.addRule(RelativeLayout.LEFT_OF, iconStateToolbar.getId());
-                    titleToolbar.setLayoutParams(params);
+                }
+                else {
                     privateIconToolbar.setVisibility(View.GONE);
                 }
 
diff --git a/app/src/main/res/layout/activity_chat.xml b/app/src/main/res/layout/activity_chat.xml
index 664b3f10d2c..9f78292b237 100644
--- a/app/src/main/res/layout/activity_chat.xml
+++ b/app/src/main/res/layout/activity_chat.xml
@@ -54,32 +54,40 @@
                             android:layout_gravity="left"
                             android:textSize="20sp"
                             android:maxLines="1"
-                            android:layout_toLeftOf="@+id/state_icon_toolbar"
+                            android:layout_toLeftOf="@+id/icons_layout"
                             android:ellipsize="end"/>
-                        <ImageView
-                            android:id="@+id/state_icon_toolbar"
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:background="@null"
-                            android:layout_marginTop="7dp"
-                            android:layout_marginRight="3dp"
-                            android:layout_alignParentRight="true"
-                            android:layout_marginLeft="3dp"
-                            android:layout_alignParentTop="true"
-                            android:visibility="gone"/>
 
-                        <ImageView
-                            android:id="@+id/private_icon_toolbar"
+                        <LinearLayout
+                            android:id="@+id/icons_layout"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
-                            android:background="@null"
-                            android:layout_marginTop="2dp"
-                            android:layout_marginRight="4dp"
+                            android:orientation="horizontal"
                             android:layout_alignParentRight="true"
-                            android:src="@drawable/ic_w_make_private_small"
-                            android:layout_marginLeft="3dp"
-                            android:layout_alignParentTop="true"
-                            android:visibility="gone"/>
+                            android:layout_alignParentTop="true">
+
+                            <ImageView
+                                android:id="@+id/state_icon_toolbar"
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:background="@null"
+                                android:layout_marginTop="7dp"
+                                android:layout_marginRight="1.5dp"
+                                android:layout_marginLeft="3dp"
+                                android:visibility="gone"/>
+
+                            <ImageView
+                                android:id="@+id/private_icon_toolbar"
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:background="@null"
+                                android:layout_marginTop="2dp"
+                                android:layout_marginRight="1.5dp"
+                                android:layout_marginLeft="1.5dp"
+                                android:tint="@color/white"
+                                android:src="@drawable/ic_private_chat"
+                                android:visibility="gone"/>
+                        </LinearLayout>
+
                     </RelativeLayout>
 
                     <mega.privacy.android.app.components.MarqueeTextView