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

@ -22,29 +22,18 @@
android:layout_toLeftOf="@id/delete_message"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:gravity="center_vertical">
<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"/>
android:gravity="center"
android:background="@drawable/event_decoration_gray">
<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"/>
<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

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>