Chat update
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 746 B After Width: | Height: | Size: 879 B |
|
@ -2,8 +2,6 @@
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:state_pressed="true"
|
<item android:state_pressed="true"
|
||||||
android:drawable="@drawable/chat_send_over" />
|
android:drawable="@drawable/chat_send_over" />
|
||||||
<item android:state_enabled="false"
|
|
||||||
android:drawable="@drawable/chat_send_default" />
|
|
||||||
<item
|
<item
|
||||||
android:drawable="@drawable/chat_send_default" />
|
android:drawable="@drawable/chat_send_default" />
|
||||||
</selector>
|
</selector>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:state_enabled="false"
|
<item android:state_pressed="true"
|
||||||
android:drawable="@drawable/chat_photo_disabled" />
|
android:drawable="@drawable/chat_picture_over" />
|
||||||
<item
|
<item
|
||||||
android:drawable="@drawable/chat_photo_default" />
|
android:drawable="@drawable/chat_picture_default" />
|
||||||
</selector>
|
</selector>
|
||||||
|
|
||||||
|
|
|
@ -104,37 +104,34 @@
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:background="@color/colorD">
|
android:background="@color/colorF">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/messageLayout"
|
android:id="@+id/messageLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:id="@+id/sendPicture"
|
android:id="@+id/sendPicture"
|
||||||
android:gravity="center"
|
android:padding="5dp"
|
||||||
|
android:scaleType="center"
|
||||||
android:textColor="@drawable/text_color"
|
android:textColor="@drawable/text_color"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:drawableTop="@drawable/chat_send_picture"
|
android:src="@drawable/chat_send_picture" />
|
||||||
android:paddingLeft="10dp"
|
|
||||||
android:paddingRight="10dp" />
|
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:id="@+id/sendMessage"
|
android:id="@+id/sendMessage"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textColor="@drawable/text_color"
|
android:padding="5dp"
|
||||||
|
android:scaleType="center"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:drawableTop="@drawable/chat_send_message"
|
android:src="@drawable/chat_send_message"
|
||||||
android:paddingRight="10dp"
|
|
||||||
android:paddingLeft="10dp"
|
|
||||||
android:layout_alignTop="@+id/message"
|
android:layout_alignTop="@+id/message"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"/>
|
||||||
android:layout_alignParentEnd="true"/>
|
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:imeOptions="flagNoExtractUi"
|
android:imeOptions="flagNoExtractUi"
|
||||||
|
@ -212,11 +209,12 @@
|
||||||
android:id="@+id/chatMessageList"
|
android:id="@+id/chatMessageList"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:layout_margin="10dp"
|
||||||
android:divider="@android:color/transparent"
|
android:divider="@android:color/transparent"
|
||||||
android:stackFromBottom="true"
|
android:stackFromBottom="true"
|
||||||
android:transcriptMode="alwaysScroll"
|
android:transcriptMode="alwaysScroll"
|
||||||
android:cacheColorHint="@color/transparent"
|
android:cacheColorHint="@color/transparent"
|
||||||
android:dividerHeight="1dp"
|
android:dividerHeight="10dp"
|
||||||
android:layout_above="@id/remoteComposing"
|
android:layout_above="@id/remoteComposing"
|
||||||
android:layout_below="@+id/relativeLayout"/>
|
android:layout_below="@+id/relativeLayout"/>
|
||||||
|
|
||||||
|
|
|
@ -1,54 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:id="@+id/bubble"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal" >
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/message"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/image"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:maxWidth="250dp"
|
|
||||||
android:maxHeight="250dp" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/download"
|
|
||||||
android:text="@string/download_image"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<ProgressBar
|
|
||||||
android:id="@+id/spinner"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:indeterminate="true"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/time"
|
|
||||||
android:textColor="@android:color/darker_gray"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:gravity="bottom"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:paddingLeft="5dp"
|
|
||||||
android:linksClickable="true"
|
|
||||||
android:autoLink="web"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
|
@ -1,51 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:id="@+id/bubble"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal" >
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:contentDescription="@string/content_description_message_status"
|
|
||||||
android:id="@+id/status"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_gravity="bottom"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:adjustViewBounds="true" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/time"
|
|
||||||
android:textColor="@android:color/darker_gray"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:gravity="bottom"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:paddingRight="5dp"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/message"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:linksClickable="true"
|
|
||||||
android:autoLink="web"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/image"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:maxWidth="250dp"
|
|
||||||
android:maxHeight="250dp" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/download"
|
|
||||||
android:text="@string/download_image"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
|
@ -1,34 +1,52 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/bubble"
|
android:id="@+id/bubble"
|
||||||
|
android:padding="10dp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="left"
|
android:gravity="left"
|
||||||
android:orientation="vertical" >
|
android:orientation="horizontal" >
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/message"
|
<ImageView
|
||||||
android:layout_gravity="left"
|
android:id="@+id/contact_picture"
|
||||||
android:visibility="gone"
|
android:layout_width="40dp"
|
||||||
android:textColor="@android:color/black"
|
android:layout_height="40dp"
|
||||||
android:layout_width="wrap_content"
|
android:src="@drawable/avatar"/>
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
<LinearLayout
|
||||||
<ImageView
|
android:layout_width="wrap_content"
|
||||||
android:id="@+id/image"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone"
|
android:orientation="vertical"
|
||||||
android:adjustViewBounds="true"
|
android:paddingLeft="10dp">
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
<TextView
|
||||||
android:maxWidth="250dp"
|
android:id="@+id/contact_header"
|
||||||
android:maxHeight="250dp" />
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
<Button
|
android:singleLine="true"
|
||||||
android:id="@+id/download"
|
android:paddingRight="5dp"
|
||||||
android:visibility="gone"
|
style="@style/font3"/>
|
||||||
android:text="@string/download_image"
|
|
||||||
android:layout_width="wrap_content"
|
<TextView
|
||||||
android:layout_height="wrap_content" />
|
android:id="@+id/message"
|
||||||
|
android:layout_gravity="left"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:linksClickable="true"
|
||||||
|
android:autoLink="web"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxWidth="250dp"
|
||||||
|
android:maxHeight="250dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/spinner"
|
android:id="@+id/spinner"
|
||||||
|
|
|
@ -1,60 +1,64 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/bubble"
|
android:id="@+id/bubble"
|
||||||
android:layout_width="wrap_content"
|
android:padding="10dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:gravity="left"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical" >
|
android:orientation="horizontal" >
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:id="@+id/message"
|
android:id="@+id/contact_picture"
|
||||||
android:layout_gravity="right"
|
android:layout_width="40dp"
|
||||||
android:visibility="gone"
|
android:layout_height="40dp"
|
||||||
android:textColor="@android:color/black"
|
android:src="@drawable/avatar"/>
|
||||||
android:linksClickable="true"
|
|
||||||
android:autoLink="web"
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
<ImageView
|
android:paddingLeft="10dp">
|
||||||
android:id="@+id/image"
|
|
||||||
android:visibility="gone"
|
<TextView
|
||||||
android:adjustViewBounds="true"
|
android:id="@+id/contact_header"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:maxWidth="250dp"
|
android:singleLine="true"
|
||||||
android:maxHeight="250dp" />
|
android:paddingRight="5dp"
|
||||||
|
style="@style/font3"/>
|
||||||
<Button
|
|
||||||
android:id="@+id/download"
|
<TextView
|
||||||
android:visibility="gone"
|
android:id="@+id/message"
|
||||||
android:text="@string/download_image"
|
android:visibility="gone"
|
||||||
android:layout_width="wrap_content"
|
android:linksClickable="true"
|
||||||
android:layout_height="wrap_content" />
|
android:autoLink="web"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxWidth="250dp"
|
||||||
|
android:maxHeight="250dp" />
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="right"
|
|
||||||
android:orientation="horizontal" >
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/time"
|
|
||||||
android:textColor="@android:color/darker_gray"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:paddingRight="5dp"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:contentDescription="@string/content_description_message_status"
|
|
||||||
android:id="@+id/status"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:layout_width="0dip"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:adjustViewBounds="true" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:contentDescription="@string/content_description_message_status"
|
||||||
|
android:id="@+id/status"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:adjustViewBounds="true" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/download"
|
||||||
|
android:text="@string/download_image"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -47,7 +47,6 @@
|
||||||
<bool name="only_display_username_if_unknown">true</bool> <!-- Display username for all sip addresses (if not in contact and display name empty) -->
|
<bool name="only_display_username_if_unknown">true</bool> <!-- Display username for all sip addresses (if not in contact and display name empty) -->
|
||||||
<bool name="never_display_sip_addresses">false</bool> <!-- To use only with the above setting set to true -->
|
<bool name="never_display_sip_addresses">false</bool> <!-- To use only with the above setting set to true -->
|
||||||
<bool name="display_messages_time_and_status">true</bool> <!-- Used to show the time of each message arrival -->
|
<bool name="display_messages_time_and_status">true</bool> <!-- Used to show the time of each message arrival -->
|
||||||
<bool name="display_time_aside">false</bool> <!-- if display_messages_time = true, display time on the side of the message instead of below -->
|
|
||||||
|
|
||||||
<bool name="enable_linphone_friends">false</bool>
|
<bool name="enable_linphone_friends">false</bool>
|
||||||
<bool name="use_linphone_tag">true</bool>
|
<bool name="use_linphone_tag">true</bool>
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
<style name="font3" parent="@android:style/TextAppearance.Medium">
|
<style name="font3" parent="@android:style/TextAppearance.Medium">
|
||||||
<item name="android:textColor">@color/colorA</item>
|
<item name="android:textColor">@color/colorA</item>
|
||||||
<item name="android:textSize">20sp</item>
|
<item name="android:textSize">18sp</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="font4" parent="@android:style/TextAppearance.Medium">
|
<style name="font4" parent="@android:style/TextAppearance.Medium">
|
||||||
|
|
|
@ -99,9 +99,9 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
private String displayName;
|
private String displayName;
|
||||||
private String pictureUri;
|
private String pictureUri;
|
||||||
private EditText message;
|
private EditText message;
|
||||||
private ImageView cancelUpload, edit, selectAll, deselectAll, startCall, delete;
|
private ImageView cancelUpload, edit, selectAll, deselectAll, startCall, delete, sendImage, sendMessage;
|
||||||
private LinearLayout topBar;
|
private LinearLayout topBar;
|
||||||
private TextView sendImage, sendMessage, contactName, remoteComposing;
|
private TextView contactName, remoteComposing;
|
||||||
private ImageView back;
|
private ImageView back;
|
||||||
private RelativeLayout uploadLayout, textLayout;
|
private RelativeLayout uploadLayout, textLayout;
|
||||||
private ListView messagesList;
|
private ListView messagesList;
|
||||||
|
@ -144,7 +144,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
progressBar = (ProgressBar) view.findViewById(R.id.progressbar);
|
progressBar = (ProgressBar) view.findViewById(R.id.progressbar);
|
||||||
topBar = (LinearLayout) view.findViewById(R.id.topbar);
|
topBar = (LinearLayout) view.findViewById(R.id.topbar);
|
||||||
|
|
||||||
sendMessage = (TextView) view.findViewById(R.id.sendMessage);
|
sendMessage = (ImageView) view.findViewById(R.id.sendMessage);
|
||||||
sendMessage.setOnClickListener(this);
|
sendMessage.setOnClickListener(this);
|
||||||
|
|
||||||
remoteComposing = (TextView) view.findViewById(R.id.remoteComposing);
|
remoteComposing = (TextView) view.findViewById(R.id.remoteComposing);
|
||||||
|
@ -178,7 +178,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
message.setMaxLines(1);
|
message.setMaxLines(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
sendImage = (TextView) view.findViewById(R.id.sendPicture);
|
sendImage = (ImageView) view.findViewById(R.id.sendPicture);
|
||||||
if (!getResources().getBoolean(R.bool.disable_chat_send_file)) {
|
if (!getResources().getBoolean(R.bool.disable_chat_send_file)) {
|
||||||
sendImage.setOnClickListener(new View.OnClickListener() {
|
sendImage.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -25,6 +25,7 @@ import java.util.Calendar;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import org.linphone.LinphoneUtils;
|
||||||
import org.linphone.R;
|
import org.linphone.R;
|
||||||
import org.linphone.core.LinphoneChatMessage;
|
import org.linphone.core.LinphoneChatMessage;
|
||||||
import org.linphone.core.LinphoneChatMessage.State;
|
import org.linphone.core.LinphoneChatMessage.State;
|
||||||
|
@ -88,32 +89,26 @@ public class BubbleChat {
|
||||||
|
|
||||||
if (message.isOutgoing()) {
|
if (message.isOutgoing()) {
|
||||||
layoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
|
layoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
|
||||||
|
layoutParams.setMargins(10, 0, 10, 0);
|
||||||
view.setBackgroundResource(R.drawable.resizable_chat_bubble_outgoing);
|
view.setBackgroundResource(R.drawable.resizable_chat_bubble_outgoing);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
layoutParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
|
layoutParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
|
||||||
|
layoutParams.setMargins(10, 0, 10, 0);
|
||||||
view.setBackgroundResource(R.drawable.resizable_chat_bubble_incoming);
|
view.setBackgroundResource(R.drawable.resizable_chat_bubble_incoming);
|
||||||
}
|
}
|
||||||
|
|
||||||
layoutParams.setMargins(10, 0, 10, 0);
|
|
||||||
|
|
||||||
view.setId(message.getStorageId());
|
view.setId(message.getStorageId());
|
||||||
view.setLayoutParams(layoutParams);
|
view.setLayoutParams(layoutParams);
|
||||||
|
|
||||||
LinearLayout layout;
|
LinearLayout layout;
|
||||||
if (context.getResources().getBoolean(R.bool.display_time_aside)) {
|
|
||||||
if (message.isOutgoing()) {
|
if (message.isOutgoing()) {
|
||||||
layout = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.chat_bubble_alt_outgoing, null);
|
layout = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.chat_bubble_outgoing, null);
|
||||||
} else {
|
} else {
|
||||||
layout = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.chat_bubble_alt_incoming, null);
|
layout = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.chat_bubble_incoming, null);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (message.isOutgoing()) {
|
|
||||||
layout = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.chat_bubble_outgoing, null);
|
|
||||||
} else {
|
|
||||||
layout = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.chat_bubble_incoming, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String externalBodyUrl = message.getExternalBodyUrl();
|
String externalBodyUrl = message.getExternalBodyUrl();
|
||||||
LinphoneContent fileTransferContent = message.getFileTransferInformation();
|
LinphoneContent fileTransferContent = message.getFileTransferInformation();
|
||||||
|
@ -158,8 +153,8 @@ public class BubbleChat {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TextView timeView = (TextView) layout.findViewById(R.id.time);
|
TextView contact = (TextView) layout.findViewById(R.id.contact_header);
|
||||||
timeView.setText(timestampToHumanDate(context, message.getTime()));
|
contact.setText(timestampToHumanDate(context, message.getTime()) + " - " + LinphoneUtils.getUsernameFromAddress(message.getFrom().asStringUriOnly()));
|
||||||
|
|
||||||
LinphoneChatMessage.State status = message.getStatus();
|
LinphoneChatMessage.State status = message.getStatus();
|
||||||
statusView = (ImageView) layout.findViewById(R.id.status);
|
statusView = (ImageView) layout.findViewById(R.id.status);
|
||||||
|
@ -289,7 +284,7 @@ public class BubbleChat {
|
||||||
public void loadBitmap(String path, ImageView imageView) {
|
public void loadBitmap(String path, ImageView imageView) {
|
||||||
if (cancelPotentialWork(path, imageView)) {
|
if (cancelPotentialWork(path, imageView)) {
|
||||||
BitmapWorkerTask task = new BitmapWorkerTask(imageView);
|
BitmapWorkerTask task = new BitmapWorkerTask(imageView);
|
||||||
Bitmap defaultBitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.chat_photo_default);
|
Bitmap defaultBitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.chat_picture_default);
|
||||||
final AsyncBitmap asyncBitmap = new AsyncBitmap(mContext.getResources(), defaultBitmap, task);
|
final AsyncBitmap asyncBitmap = new AsyncBitmap(mContext.getResources(), defaultBitmap, task);
|
||||||
imageView.setImageDrawable(asyncBitmap);
|
imageView.setImageDrawable(asyncBitmap);
|
||||||
task.execute(path);
|
task.execute(path);
|
||||||
|
|