aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--res/drawable-hdpi/ic_indicator.pngbin0 -> 684 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator.pngbin0 -> 490 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator.pngbin0 -> 915 bytes
-rw-r--r--res/drawable-xxhdpi/ic_indicator.pngbin0 -> 1298 bytes
-rw-r--r--res/layout/message_recieved.xml23
-rw-r--r--res/layout/message_sent.xml87
-rw-r--r--src/eu/siacs/conversations/ui/ConversationFragment.java12
7 files changed, 85 insertions, 37 deletions
diff --git a/res/drawable-hdpi/ic_indicator.png b/res/drawable-hdpi/ic_indicator.png
new file mode 100644
index 00000000..6de8969f
--- /dev/null
+++ b/res/drawable-hdpi/ic_indicator.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_indicator.png b/res/drawable-mdpi/ic_indicator.png
new file mode 100644
index 00000000..bb4fee10
--- /dev/null
+++ b/res/drawable-mdpi/ic_indicator.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_indicator.png b/res/drawable-xhdpi/ic_indicator.png
new file mode 100644
index 00000000..3e5141c2
--- /dev/null
+++ b/res/drawable-xhdpi/ic_indicator.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_indicator.png b/res/drawable-xxhdpi/ic_indicator.png
new file mode 100644
index 00000000..2c51b8b7
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_indicator.png
Binary files differ
diff --git a/res/layout/message_recieved.xml b/res/layout/message_recieved.xml
index 2ae83034..c11c0087 100644
--- a/res/layout/message_recieved.xml
+++ b/res/layout/message_recieved.xml
@@ -23,20 +23,37 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="Hi, how are you?"
- android:autoLink="all"
+ android:autoLink="web"
android:textSize="16sp"
android:id="@+id/message_body"
android:textColor="#333333"/>
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="1dp"
+ android:paddingRight="8dp"
android:text="@string/sending"
android:textColor="#8e8e8e"
android:textSize="12sp"
- android:id="@+id/message_time"/>
+ android:id="@+id/message_time"
+ android:layout_gravity="center_vertical"
+ android:gravity="center_vertical"/>
+ <ImageView
+ android:id="@+id/security_indicator"
+ android:layout_width="14sp"
+ android:layout_height="14sp"
+ android:layout_gravity="center_vertical"
+ android:gravity="center_vertical"
+ android:paddingTop="2dp"
+ android:src="@drawable/ic_indicator"
+ android:visibility="gone"/>
+
+</LinearLayout>
</LinearLayout>
</LinearLayout>
<ImageView
diff --git a/res/layout/message_sent.xml b/res/layout/message_sent.xml
index b553ff62..c966d009 100644
--- a/res/layout/message_sent.xml
+++ b/res/layout/message_sent.xml
@@ -3,42 +3,61 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- android:padding="8dp">
+ android:padding="8dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:background="@drawable/message_border"
+ android:layout_alignParentBottom="true"
android:layout_toLeftOf="@+id/message_photo"
- android:layout_alignParentBottom="true"
- android:minHeight="48dp"
- >
-<LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="fill_parent"
- android:orientation="vertical"
- android:background="#ededed"
- android:padding="5dp">
+ android:background="@drawable/message_border"
+ android:minHeight="48dp" >
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:background="#ededed"
+ android:orientation="vertical"
+ android:padding="5dp" >
+
+ <TextView
+ android:id="@+id/message_body"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:autoLink="all"
+ android:textColor="#333333"
+ android:textSize="16sp" />
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal" >
+
+ <TextView
+ android:id="@+id/message_time"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:gravity="center_vertical"
+ android:paddingRight="8dp"
+ android:paddingTop="1dp"
+ android:text="@string/sending"
+ android:textColor="#8e8e8e"
+ android:textSize="12sp" />
+
+ <ImageView
+ android:id="@+id/security_indicator"
+ android:layout_width="14sp"
+ android:layout_height="14sp"
+ android:layout_gravity="center_vertical"
+ android:gravity="center_vertical"
+ android:paddingTop="2dp"
+ android:src="@drawable/ic_indicator"
+ android:visibility="gone"/>
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hi, how are you?"
- android:textSize="16sp"
- android:id="@+id/message_body"
- android:autoLink="all"
- android:textColor="#333333"/>
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:paddingTop="1dp"
- android:text="@string/sending"
- android:textColor="#8e8e8e"
- android:textSize="12sp"
- android:id="@+id/message_time"/>
-
- </LinearLayout>
-</LinearLayout>
<ImageView
android:id="@+id/message_photo"
android:layout_width="48dp"
@@ -47,7 +66,7 @@
android:layout_alignParentRight="true"
android:layout_marginLeft="-1.5dp"
android:padding="0dp"
- android:src="@drawable/ic_profile"
- android:scaleType="fitXY"/>
-
-</RelativeLayout>
+ android:scaleType="fitXY"
+ android:src="@drawable/ic_profile" />
+
+</RelativeLayout> \ No newline at end of file
diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java
index d8ead9a6..7385d8a9 100644
--- a/src/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/eu/siacs/conversations/ui/ConversationFragment.java
@@ -239,6 +239,7 @@ public class ConversationFragment extends Fragment {
.findViewById(R.id.message_body);
viewHolder.time = (TextView) view
.findViewById(R.id.message_time);
+ viewHolder.indicator = (ImageView) view.findViewById(R.id.security_indicator);
view.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) view.getTag();
@@ -266,12 +267,22 @@ public class ConversationFragment extends Fragment {
viewHolder.messageBody.setTextColor(0xff33B5E5);
viewHolder.messageBody.setTypeface(null,
Typeface.ITALIC);
+ viewHolder.indicator.setVisibility(View.VISIBLE);
+ } else if ((item.getEncryption() == Message.ENCRYPTION_OTR)||(item.getEncryption() == Message.ENCRYPTION_DECRYPTED)) {
+ viewHolder.messageBody.setText(body.trim());
+ viewHolder.messageBody.setTextColor(0xff000000);
+ viewHolder.messageBody.setTypeface(null,
+ Typeface.NORMAL);
+ viewHolder.indicator.setVisibility(View.VISIBLE);
} else {
viewHolder.messageBody.setText(body.trim());
viewHolder.messageBody.setTextColor(0xff000000);
viewHolder.messageBody.setTypeface(null,
Typeface.NORMAL);
+ viewHolder.indicator.setVisibility(View.GONE);
}
+ } else {
+ viewHolder.indicator.setVisibility(View.GONE);
}
if (item.getStatus() == Message.STATUS_UNSEND) {
viewHolder.time.setTypeface(null, Typeface.ITALIC);
@@ -554,6 +565,7 @@ public class ConversationFragment extends Fragment {
private static class ViewHolder {
+ protected ImageView indicator;
protected TextView time;
protected TextView messageBody;
protected ImageView imageView;