Skip to content

Commit

Permalink
Add new private icon to chat conversation screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Yenel committed Apr 4, 2019
1 parent 38c2356 commit 1411051
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
50 changes: 29 additions & 21 deletions app/src/main/res/layout/activity_chat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1411051

Please sign in to comment.