Use red color for security events + improved layout
This commit is contained in:
parent
dc17d44347
commit
c394285a87
8 changed files with 156 additions and 136 deletions
|
@ -359,6 +359,9 @@ public class ChatEventsAdapter extends SelectableAdapter<ChatBubbleViewHolder> {
|
||||||
holder.bubbleLayout.setLayoutParams(layoutParams);
|
holder.bubbleLayout.setLayoutParams(layoutParams);
|
||||||
} else { // Event is not chat message
|
} else { // Event is not chat message
|
||||||
holder.eventLayout.setVisibility(View.VISIBLE);
|
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();
|
Address address = event.getParticipantAddress();
|
||||||
String displayName = null;
|
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));
|
holder.eventMessage.setText(mContext.getString(R.string.device_removed).replace("%s", displayName));
|
||||||
break;
|
break;
|
||||||
case ConferenceSecurityEvent:
|
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()) {
|
switch (event.getSecurityEventType()) {
|
||||||
case LimeIdentityKeyChanged:
|
case LimeIdentityKeyChanged:
|
||||||
holder.eventMessage.setText(mContext.getString(R.string.lime_identity_key_changed).replace("%s", displayName));
|
holder.eventMessage.setText(mContext.getString(R.string.lime_identity_key_changed).replace("%s", displayName));
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 176 B |
7
app/src/main/res/drawable/event_decoration_gray.xml
Normal file
7
app/src/main/res/drawable/event_decoration_gray.xml
Normal 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>
|
7
app/src/main/res/drawable/event_decoration_red.xml
Normal file
7
app/src/main/res/drawable/event_decoration_red.xml
Normal 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>
|
|
@ -2,6 +2,7 @@
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/topLayout"
|
android:id="@+id/topLayout"
|
||||||
|
android:background="@color/colorB"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/topLayout"
|
android:id="@+id/topLayout"
|
||||||
|
android:background="@color/colorB"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
|
|
@ -22,29 +22,18 @@
|
||||||
android:layout_toLeftOf="@id/delete_message"
|
android:layout_toLeftOf="@id/delete_message"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
android:layout_marginBottom="5dp"
|
android:layout_marginBottom="5dp"
|
||||||
android:gravity="center_vertical">
|
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
|
<TextView
|
||||||
android:id="@+id/event_text"
|
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_width="wrap_content"
|
||||||
android:layout_height="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>
|
</LinearLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
|
|
|
@ -197,4 +197,12 @@
|
||||||
<item name="android:lineSpacingExtra">8.3sp</item>
|
<item name="android:lineSpacingExtra">8.3sp</item>
|
||||||
</style>
|
</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>
|
</resources>
|
Loading…
Reference in a new issue