Use red color for security events + improved layout

This commit is contained in:
Sylvain Berfini 2018-11-19 17:18:13 +01:00
parent dc17d44347
commit c394285a87
8 changed files with 156 additions and 136 deletions

View file

@ -359,6 +359,9 @@ public class ChatEventsAdapter extends SelectableAdapter<ChatBubbleViewHolder> {
holder.bubbleLayout.setLayoutParams(layoutParams);
} else { // Event is not chat message
holder.eventLayout.setVisibility(View.VISIBLE);
holder.eventMessage.setTextColor(mContext.getResources().getColor(R.color.colorE));
holder.eventLayout.setBackgroundResource(R.drawable.event_decoration_gray);
holder.eventLayout.setBackgroundResource(R.drawable.event_decoration_gray);
Address address = event.getParticipantAddress();
String displayName = null;
@ -400,6 +403,10 @@ public class ChatEventsAdapter extends SelectableAdapter<ChatBubbleViewHolder> {
holder.eventMessage.setText(mContext.getString(R.string.device_removed).replace("%s", displayName));
break;
case ConferenceSecurityEvent:
holder.eventMessage.setTextColor(mContext.getResources().getColor(R.color.colorI));
holder.eventLayout.setBackgroundResource(R.drawable.event_decoration_red);
holder.eventLayout.setBackgroundResource(R.drawable.event_decoration_red);
switch (event.getSecurityEventType()) {
case LimeIdentityKeyChanged:
holder.eventMessage.setText(mContext.getString(R.string.lime_identity_key_changed).replace("%s", displayName));

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 B

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<stroke android:width="1dp" android:color="@color/colorE"/>
<size android:height="1dp" android:width="50dp" />
</shape>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<stroke android:width="50dp" android:color="@color/colorI"/>
<size android:height="1dp" />
</shape>

View file

@ -2,6 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/topLayout"
android:background="@color/colorB"
android:layout_width="match_parent"
android:layout_height="match_parent">

View file

@ -2,6 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/topLayout"
android:background="@color/colorB"
android:layout_width="match_parent"
android:layout_height="match_parent">

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_width="match_parent"
android:layout_height="wrap_content">
<CheckBox
android:id="@+id/delete_message"
@ -11,46 +11,35 @@
android:layout_width="30dp"
android:layout_height="30dp"
android:adjustViewBounds="true"
android:clickable="false"
android:clickable="false"
android:layout_alignParentRight="true"/>
<LinearLayout
android:id="@+id/event"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
<LinearLayout
android:id="@+id/event"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/delete_message"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:gravity="center_vertical">
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:gravity="center"
android:background="@drawable/event_decoration_gray">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginRight="10dp"
android:src="@drawable/event_gray"
android:scaleType="fitXY"/>
<TextView
android:id="@+id/event_text"
android:textAppearance="@style/font_group_chat_event"
android:background="@color/colorH"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/event_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="10dp"
android:src="@drawable/event_gray"
android:scaleType="fitXY"/>
</LinearLayout>
<RelativeLayout
android:id="@+id/bubble"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<RelativeLayout
android:id="@+id/bubble"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/delete_message">
<LinearLayout
@ -59,39 +48,39 @@
android:layout_height="10dp"
android:orientation="horizontal"/>
<LinearLayout
android:id="@+id/background"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/separator"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/background"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/separator"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingTop="10dp">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingTop="10dp">
<include layout="@layout/contact_avatar"/>
<include layout="@layout/contact_avatar"/>
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingRight="10dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingRight="10dp">
<TextView
android:id="@+id/contact_header"
android:maxLines="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/contact_header"
android:maxLines="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/file_name"
@ -118,7 +107,7 @@
android:layout_centerVertical="true"
android:visibility="gone"/>
</RelativeLayout>
</RelativeLayout>
<TextView
android:id="@+id/message"
@ -128,95 +117,95 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<RelativeLayout
android:id="@+id/file_transfer_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<RelativeLayout
android:id="@+id/file_transfer_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone">
<ProgressBar
android:id="@+id/progress_bar"
style="@android:style/Widget.ProgressBar.Horizontal"
android:paddingRight="5dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_width="150dp"
android:layout_height="5dp"/>
<ProgressBar
android:id="@+id/progress_bar"
style="@android:style/Widget.ProgressBar.Horizontal"
android:paddingRight="5dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_width="150dp"
android:layout_height="5dp"/>
<Button
android:id="@+id/file_transfer_action"
<Button
android:id="@+id/file_transfer_action"
android:textAppearance="@style/font8"
android:background="@drawable/resizable_assistant_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/progress_bar"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/progress_bar"/>
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:id="@+id/imdmLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:orientation="horizontal"
android:layout_gravity="right"
android:gravity="right"
android:visibility="invisible">
<LinearLayout
android:id="@+id/imdmLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:orientation="horizontal"
android:layout_gravity="right"
android:gravity="right"
android:visibility="invisible">
<TextView
android:id="@+id/imdmText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Displayed"
android:textSize="12sp"
android:paddingRight="3dp"/>
<TextView
android:id="@+id/imdmText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Displayed"
android:textSize="12sp"
android:paddingRight="3dp"/>
<ImageView
android:id="@+id/imdmIcon"
android:layout_width="10dp"
android:layout_height="10dp"
android:src="@drawable/valid"
android:scaleType="fitCenter"
android:layout_marginTop="2dp" />
<ImageView
android:id="@+id/imdmIcon"
android:layout_width="10dp"
android:layout_height="10dp"
android:src="@drawable/valid"
android:scaleType="fitCenter"
android:layout_marginTop="2dp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:layout_alignRight="@id/background"
android:layout_alignTop="@id/background"
android:layout_width="15dp"
android:layout_height="15dp"
android:paddingTop="5dp"
android:paddingBottom="3dp">
<RelativeLayout
android:layout_alignRight="@id/background"
android:layout_alignTop="@id/background"
android:layout_width="15dp"
android:layout_height="15dp"
android:paddingTop="5dp"
android:paddingBottom="3dp">
<ImageView
android:id="@+id/status"
android:contentDescription="@string/content_description_message_status"
android:visibility="invisible"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:paddingRight="5dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true" />
<ImageView
android:id="@+id/status"
android:contentDescription="@string/content_description_message_status"
android:visibility="invisible"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:paddingRight="5dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true" />
<ProgressBar
android:id="@+id/inprogress"
<ProgressBar
android:id="@+id/inprogress"
android:progressTint="@color/colorB"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:paddingRight="5dp"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:paddingRight="5dp"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>

View file

@ -197,4 +197,12 @@
<item name="android:lineSpacingExtra">8.3sp</item>
</style>
<style name="font_group_chat_event" parent="@android:style/TextAppearance.Medium">
<item name="android:textColor">@color/colorE</item>
<item name="android:textSize">13sp</item>
<item name="android:fontFamily">sans-serif</item>
<item name="android:lineSpacingExtra">0sp</item>
<item name="android:textStyle">italic</item>
</style>
</resources>