Add chat view and otger stuff
This commit is contained in:
parent
7388723f40
commit
c6035e841f
9 changed files with 346 additions and 268 deletions
|
@ -13,61 +13,23 @@
|
|||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:contentDescription="@string/content_description_back"
|
||||
android:src="@drawable/back"
|
||||
android:background="@drawable/toolbar_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:contentDescription="@string/content_description_back"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:padding="10dp"
|
||||
android:adjustViewBounds="true"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/delete"
|
||||
android:src="@drawable/delete"
|
||||
android:background="@drawable/toolbar_button"
|
||||
android:contentDescription="@string/content_description_valid"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentRight="true"
|
||||
android:padding="10dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/select_all"
|
||||
android:src="@drawable/select_all"
|
||||
android:background="@drawable/toolbar_button"
|
||||
android:contentDescription="@string/content_description_valid"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_toLeftOf="@id/delete"
|
||||
android:padding="10dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/deselect_all"
|
||||
android:src="@drawable/deselect_all"
|
||||
android:background="@drawable/toolbar_button"
|
||||
android:contentDescription="@string/content_description_valid"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_toLeftOf="@id/delete"
|
||||
android:padding="10dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"/>
|
||||
android:padding="20dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/edit"
|
||||
android:src="@drawable/edit_list_button"
|
||||
android:background="@drawable/toolbar_button"
|
||||
android:contentDescription="@string/content_description_edit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentRight="true"
|
||||
android:padding="10dp"
|
||||
android:adjustViewBounds="true"/>
|
||||
android:padding="15dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/start_call"
|
||||
|
@ -75,10 +37,9 @@
|
|||
android:background="@drawable/toolbar_button"
|
||||
android:contentDescription="@string/content_description_call"
|
||||
android:layout_toLeftOf="@id/edit"
|
||||
android:padding="10dp"
|
||||
android:gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="15dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/contact_name"
|
||||
|
@ -91,9 +52,10 @@
|
|||
android:layout_toLeftOf="@id/start_call"
|
||||
android:paddingLeft="10dp"
|
||||
android:gravity="center"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<include layout="@layout/edit_list"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/footer"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -161,33 +123,6 @@
|
|||
android:layout_alignParentRight="true"
|
||||
android:padding="20dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@id/cancelUpload"
|
||||
android:layout_toLeftOf="@id/cancelUpload"
|
||||
android:paddingBottom="20dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/progressBarText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/uploading_image"
|
||||
android:textColor="@android:color/black"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="15dp"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingLeft="2dp"
|
||||
android:paddingRight="2dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
|
|
@ -7,13 +7,34 @@
|
|||
android:gravity="left"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture"
|
||||
android:src="@drawable/avatar"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingLeft="10dp"/>
|
||||
<RelativeLayout
|
||||
android:id="@+id/avatar_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture"
|
||||
android:src="@drawable/avatar"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginLeft="5dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mask"
|
||||
android:src="@drawable/avatar_mask"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginLeft="5dp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -41,9 +62,9 @@
|
|||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:visibility="gone"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:scaleType="center"
|
||||
android:maxWidth="250dp"
|
||||
android:maxHeight="250dp" />
|
||||
|
||||
|
|
|
@ -38,12 +38,21 @@
|
|||
|
||||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
android:scaleType="center"
|
||||
android:maxWidth="250dp"
|
||||
android:maxHeight="250dp" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/spinner"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="5dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
|
|
|
@ -43,18 +43,35 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@drawable/avatar"
|
||||
android:layout_centerHorizontal="true"/>
|
||||
<RelativeLayout
|
||||
android:id="@+id/avatar_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerHorizontal="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture"
|
||||
android:src="@drawable/avatar"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:adjustViewBounds="true"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mask"
|
||||
android:src="@drawable/avatar_mask"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:adjustViewBounds="true"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/contact_picture"
|
||||
android:layout_below="@id/avatar_layout"
|
||||
style="@style/font2"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -83,7 +100,7 @@
|
|||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:background="@drawable/chat_list_indicator"
|
||||
style="@style/font17"
|
||||
style="@style/font18"
|
||||
android:gravity="center"
|
||||
android:layout_above="@+id/lastMessage"
|
||||
android:layout_alignParentRight="true"
|
||||
|
|
|
@ -1,41 +1,48 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:linphone="http://schemas.android.com/apk/res-auto"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="75dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:background="@color/colorF">
|
||||
android:background="@color/colorH">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="10dp">
|
||||
|
||||
<TextView
|
||||
android:text="@string/conference"
|
||||
style="@style/font5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<Chronometer
|
||||
android:id="@+id/callTimer"
|
||||
style="@style/font2"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical|left"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="10dp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/text_header"
|
||||
android:text="@string/conference"
|
||||
android:textSize="26dp" />
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_pause"
|
||||
android:id="@+id/conferenceStatus"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/pause" />
|
||||
android:layout_centerInParent="true"
|
||||
android:padding="10dp"
|
||||
android:src="@drawable/pause_big_default"/>
|
||||
|
||||
<Chronometer
|
||||
android:visibility="invisible"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="20dp"
|
||||
android:gravity="center_vertical|right"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="22dp" />
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/colorE"
|
||||
android:layout_alignParentBottom="true"/>
|
||||
|
||||
</TableRow>
|
||||
</RelativeLayout>
|
|
@ -20,7 +20,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:padding="10dp"
|
||||
android:padding="20dp"
|
||||
android:adjustViewBounds="true"/>
|
||||
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
|||
android:background="@drawable/toolbar_button"
|
||||
android:contentDescription="@string/content_description_add_contact"
|
||||
android:layout_alignParentRight="true"
|
||||
android:padding="10dp"
|
||||
android:padding="15dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:adjustViewBounds="true"/>
|
||||
|
@ -57,8 +57,8 @@
|
|||
android:id="@+id/contact_picture"
|
||||
android:src="@drawable/avatar"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginLeft="5dp"/>
|
||||
|
@ -67,8 +67,8 @@
|
|||
android:id="@+id/mask"
|
||||
android:src="@drawable/avatar_mask"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginLeft="5dp"/>
|
||||
|
@ -78,6 +78,7 @@
|
|||
<TextView
|
||||
android:id="@+id/contact_name"
|
||||
style="@style/font5"
|
||||
android:singleLine="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
@ -96,40 +97,26 @@
|
|||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp">
|
||||
<ImageView
|
||||
android:id="@+id/call"
|
||||
android:src="@drawable/call_start_body_default"
|
||||
android:contentDescription="@string/content_description_dial_back"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_margin="10dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_centerInParent="true"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/call"
|
||||
android:src="@drawable/call_start_body_default"
|
||||
android:contentDescription="@string/content_description_dial_back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_centerInParent="true"/>
|
||||
<ImageView
|
||||
android:id="@+id/chat"
|
||||
android:src="@drawable/chat_start_body_default"
|
||||
android:contentDescription="@string/content_description_chat"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_margin="10dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/chat_row"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/chat"
|
||||
android:src="@drawable/chat_start_body_default"
|
||||
android:contentDescription="@string/content_description_chat"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
|
|
@ -22,6 +22,7 @@ import java.io.ByteArrayInputStream;
|
|||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.app.Fragment;
|
||||
import android.graphics.Matrix;
|
||||
import java.util.ArrayList;
|
||||
|
@ -78,9 +79,11 @@ import android.view.ViewGroup;
|
|||
import android.view.ViewTreeObserver;
|
||||
import android.view.WindowManager;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Filter;
|
||||
|
@ -115,14 +118,16 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
private String displayName;
|
||||
private String pictureUri;
|
||||
private EditText message;
|
||||
private ImageView cancelUpload, edit, selectAll, deselectAll, startCall, delete, sendImage, sendMessage;
|
||||
private ImageView cancelUpload, edit, selectAll, deselectAll, startCall, delete, sendImage, sendMessage, cancel;
|
||||
private TextView contactName, remoteComposing;
|
||||
private ImageView back;
|
||||
private AutoCompleteTextView searchContactField;
|
||||
private RelativeLayout uploadLayout, textLayout, topBar;
|
||||
private RelativeLayout uploadLayout, textLayout, topBar, editList;
|
||||
private ListView messagesList;
|
||||
|
||||
private ProgressBar progressBar;
|
||||
private boolean isEditMode = false;
|
||||
private Contact contact;
|
||||
private Uri imageToUploadUri;
|
||||
private String filePathToUpload;
|
||||
private TextWatcher textWatcher;
|
||||
|
@ -164,7 +169,6 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
searchContactField = (AutoCompleteTextView) view.findViewById(R.id.searchContactField);
|
||||
|
||||
textLayout = (RelativeLayout) view.findViewById(R.id.messageLayout);
|
||||
progressBar = (ProgressBar) view.findViewById(R.id.progressbar);
|
||||
topBar = (RelativeLayout) view.findViewById(R.id.top_bar);
|
||||
|
||||
sendMessage = (ImageView) view.findViewById(R.id.sendMessage);
|
||||
|
@ -176,6 +180,11 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
uploadLayout = (RelativeLayout) view.findViewById(R.id.uploadLayout);
|
||||
uploadLayout.setVisibility(View.GONE);
|
||||
|
||||
editList = (RelativeLayout) view.findViewById(R.id.edit_list);
|
||||
|
||||
cancel = (ImageView) view.findViewById(R.id.cancel);
|
||||
cancel.setOnClickListener(this);
|
||||
|
||||
edit = (ImageView) view.findViewById(R.id.edit);
|
||||
edit.setOnClickListener(this);
|
||||
|
||||
|
@ -206,6 +215,14 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
}
|
||||
}
|
||||
|
||||
LinphoneAddress lAddress;
|
||||
try {
|
||||
lAddress = LinphoneCoreFactory.instance().createLinphoneAddress(sipUri);
|
||||
contact = ContactsManager.getInstance().findContactWithAddress(getActivity().getContentResolver(), lAddress);
|
||||
} catch (Exception e){
|
||||
|
||||
}
|
||||
|
||||
//Manage multiline
|
||||
message = (EditText) view.findViewById(R.id.message);
|
||||
if (!getResources().getBoolean(R.bool.allow_chat_multiline)) {
|
||||
|
@ -228,10 +245,10 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
|
||||
back = (ImageView) view.findViewById(R.id.back);
|
||||
if (back != null) {
|
||||
back.setOnClickListener(new View.OnClickListener() {
|
||||
back.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
getActivity().finish();
|
||||
getFragmentManager().popBackStackImmediate();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -371,7 +388,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
LinphoneChatMessage message = history[position];
|
||||
|
||||
BubbleChat bubble = new BubbleChat(context, message);
|
||||
BubbleChat bubble = new BubbleChat(context, message, contact);
|
||||
View v = bubble.getView();
|
||||
|
||||
registerForContextMenu(v);
|
||||
|
@ -400,28 +417,15 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
}
|
||||
|
||||
private void displayChatHeader(String displayName, String pictureUri) {
|
||||
LinphoneAddress lAddress;
|
||||
try {
|
||||
lAddress = LinphoneCoreFactory.instance().createLinphoneAddress(sipUri);
|
||||
Contact contact = ContactsManager.getInstance().findContactWithAddress(getActivity().getContentResolver(), lAddress);
|
||||
if (contact != null) {
|
||||
//LinphoneUtils.setImagePictureFromUri(getActivity(), contactPicture.getView(), contact.getPhotoUri(), contact.getThumbnailUri(), R.drawable.unknown_small);
|
||||
|
||||
} else {
|
||||
//contactPicture.setImageResource(R.drawable.unknown_small);
|
||||
}
|
||||
} catch (LinphoneCoreException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (displayName == null && getResources().getBoolean(R.bool.only_display_username_if_unknown) && LinphoneUtils.isSipAddress(sipUri)) {
|
||||
if(contact != null) {
|
||||
contactName.setText(contact.getName());
|
||||
} else if (displayName == null && getResources().getBoolean(R.bool.only_display_username_if_unknown) && LinphoneUtils.isSipAddress(sipUri)) {
|
||||
contactName.setText(LinphoneUtils.getUsernameFromAddress(sipUri));
|
||||
} else if (displayName == null) {
|
||||
contactName.setText(sipUri);
|
||||
} else {
|
||||
contactName.setText(displayName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void changeDisplayedChat(String newSipUri, String displayName, String pictureUri) {
|
||||
|
@ -447,6 +451,14 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
message.setText(draft);
|
||||
}
|
||||
|
||||
LinphoneAddress lAddress;
|
||||
try {
|
||||
lAddress = LinphoneCoreFactory.instance().createLinphoneAddress(sipUri);
|
||||
contact = ContactsManager.getInstance().findContactWithAddress(getActivity().getContentResolver(), lAddress);
|
||||
} catch (Exception e){
|
||||
|
||||
}
|
||||
|
||||
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
||||
if (lc != null) {
|
||||
chatRoom = lc.getOrCreateChatRoom(sipUri);
|
||||
|
@ -532,9 +544,9 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
|
||||
onSaveInstanceState(getArguments());
|
||||
|
||||
uploadLayout.setVisibility(View.GONE);
|
||||
textLayout.setVisibility(View.VISIBLE);
|
||||
progressBar.setProgress(0);
|
||||
// uploadLayout.setVisibility(View.GONE);
|
||||
// textLayout.setVisibility(View.VISIBLE);
|
||||
//progressBar.setProgress(0);
|
||||
|
||||
//Hide keybord
|
||||
InputMethodManager imm = (InputMethodManager)getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
|
@ -560,17 +572,25 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
LinphoneActivity.instance().updateChatFragment(this);
|
||||
}
|
||||
|
||||
LinphoneAddress lAddress;
|
||||
try {
|
||||
lAddress = LinphoneCoreFactory.instance().createLinphoneAddress(sipUri);
|
||||
contact = ContactsManager.getInstance().findContactWithAddress(getActivity().getContentResolver(), lAddress);
|
||||
} catch (Exception e){
|
||||
|
||||
}
|
||||
|
||||
LinphoneManager.addListener(this);
|
||||
|
||||
final LinphoneChatMessage msg = LinphoneManager.getInstance().getMessageUploadPending();
|
||||
if(msg != null && msg.getTo().asString().equals(sipUri)){
|
||||
uploadLayout.setVisibility(View.VISIBLE);
|
||||
textLayout.setVisibility(View.GONE);
|
||||
if(msg.getFileTransferInformation() != null){
|
||||
progressBar.setProgress(msg.getFileTransferInformation().getRealSize());
|
||||
}
|
||||
//uploadLayout.setVisibility(View.VISIBLE);
|
||||
// textLayout.setVisibility(View.GONE);
|
||||
// if(msg.getFileTransferInformation() != null){
|
||||
// progressBar.setProgress(msg.getFileTransferInformation().getRealSize());
|
||||
// }
|
||||
|
||||
cancelUpload.setOnClickListener(new View.OnClickListener() {
|
||||
/* cancelUpload.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
uploadLayout.setVisibility(View.GONE);
|
||||
|
@ -580,7 +600,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
LinphoneManager.getInstance().setUploadPendingFileMessage(null);
|
||||
|
||||
}
|
||||
});
|
||||
});*/
|
||||
}
|
||||
|
||||
String draft = getArguments().getString("messageDraft");
|
||||
|
@ -594,34 +614,68 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
super.onResume();
|
||||
}
|
||||
|
||||
private void selectAllList(boolean isSelectAll){
|
||||
//TODO
|
||||
}
|
||||
|
||||
public void quitEditMode(){
|
||||
isEditMode = false;
|
||||
editList.setVisibility(View.GONE);
|
||||
topBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int id = v.getId();
|
||||
|
||||
if(id == R.id.sendMessage){
|
||||
sendTextMessage();
|
||||
} else if (id == R.id.delete) {
|
||||
edit.setVisibility(View.VISIBLE);
|
||||
selectAll.setVisibility(View.GONE);
|
||||
deselectAll.setVisibility(View.GONE);
|
||||
startCall.setVisibility(View.VISIBLE);
|
||||
delete.setVisibility(View.GONE);;
|
||||
}
|
||||
else if (id == R.id.select_all) {
|
||||
if (id == R.id.select_all) {
|
||||
deselectAll.setVisibility(View.VISIBLE);
|
||||
selectAll.setVisibility(View.GONE);
|
||||
//TODO select all chatrooms
|
||||
//selectAllList(true);
|
||||
return;
|
||||
}
|
||||
else if (id == R.id.deselect_all) {
|
||||
if (id == R.id.deselect_all) {
|
||||
deselectAll.setVisibility(View.GONE);
|
||||
selectAll.setVisibility(View.VISIBLE);
|
||||
//TODO deselect all chatrooms
|
||||
//selectAllList(false);
|
||||
return;
|
||||
}
|
||||
else if (id == R.id.edit) {
|
||||
startCall.setVisibility(View.INVISIBLE);
|
||||
edit.setVisibility(View.GONE);
|
||||
selectAll.setVisibility(View.VISIBLE);
|
||||
delete.setVisibility(View.VISIBLE);
|
||||
|
||||
if (id == R.id.cancel) {
|
||||
quitEditMode();
|
||||
return;
|
||||
}
|
||||
|
||||
if (id == R.id.delete) {
|
||||
final Dialog dialog = LinphoneActivity.instance().displayDialog(getString(R.string.delete_text));
|
||||
Button delete = (Button) dialog.findViewById(R.id.delete);
|
||||
Button cancel = (Button) dialog.findViewById(R.id.cancel);
|
||||
|
||||
delete.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
// removeCallLogs();
|
||||
dialog.dismiss();
|
||||
quitEditMode();
|
||||
}
|
||||
});
|
||||
|
||||
cancel.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
dialog.dismiss();
|
||||
quitEditMode();
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
return;
|
||||
}
|
||||
|
||||
if(id == R.id.sendMessage){
|
||||
sendTextMessage();
|
||||
} else if (id == R.id.edit) {
|
||||
topBar.setVisibility(View.GONE);
|
||||
editList.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else if (id == R.id.new_discussion) {
|
||||
//TODO call sipUri
|
||||
|
@ -643,17 +697,15 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
if(newChatConversation){
|
||||
String address = searchContactField.getText().toString();
|
||||
if(address != null && !address.equals("")) {
|
||||
if(!address.startsWith("sip:"))
|
||||
address = "sip:" + address;
|
||||
if (!LinphoneUtils.isSipAddress(address)) {
|
||||
if (LinphoneManager.getLc().getDefaultProxyConfig() == null) {
|
||||
Log.w("Error");
|
||||
}
|
||||
address = address + "@" + LinphoneManager.getLc().getDefaultProxyConfig().getDomain();
|
||||
if (!LinphoneUtils.isStrictSipAddress(address)) {
|
||||
address = "sip:" + address;
|
||||
}
|
||||
}
|
||||
|
||||
Log.w(address);
|
||||
LinphoneAddress lAddress;
|
||||
try {
|
||||
lAddress = LinphoneCoreFactory.instance().createLinphoneAddress(address);
|
||||
|
@ -667,7 +719,12 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
if (chatRoom != null && messageToSend != null && messageToSend.length() > 0 && isNetworkReachable) {
|
||||
LinphoneChatMessage message = chatRoom.createLinphoneChatMessage(messageToSend);
|
||||
chatRoom.sendChatMessage(message);
|
||||
LinphoneActivity.instance().displayChat(lAddress.toString());
|
||||
message.setListener(LinphoneManager.getInstance());
|
||||
Contact lContact = ContactsManager.getInstance().findContactWithAddress(getActivity().getContentResolver(), lAddress);
|
||||
if(lContact != null)
|
||||
exitNewConversationMode(lContact,lAddress.asStringUriOnly(),null);
|
||||
else
|
||||
exitNewConversationMode(null,lAddress.asStringUriOnly(),lAddress.getUserName());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -692,6 +749,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
private void sendImageMessage(String path, int imageSize) {
|
||||
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
||||
boolean isNetworkReachable = lc == null ? false : lc.isNetworkReachable();
|
||||
invalidate();
|
||||
|
||||
if (chatRoom != null && path != null && path.length() > 0 && isNetworkReachable) {
|
||||
try {
|
||||
|
@ -718,8 +776,8 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
public FileUploadPrepareTask(Context context, String fileToUploadPath, int size) {
|
||||
path = fileToUploadPath;
|
||||
imageSize = size;
|
||||
uploadLayout.setVisibility(View.VISIBLE);
|
||||
textLayout.setVisibility(View.GONE);
|
||||
//uploadLayout.setVisibility(View.VISIBLE);
|
||||
//textLayout.setVisibility(View.GONE);
|
||||
|
||||
progressDialog = new ProgressDialog(context);
|
||||
progressDialog.setIndeterminate(true);
|
||||
|
@ -860,6 +918,24 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
return null;
|
||||
}
|
||||
|
||||
private void exitNewConversationMode(Contact c, String address, String username){
|
||||
searchContactField.setVisibility(View.GONE);
|
||||
sipUri = address;
|
||||
messagesList.setVisibility(View.VISIBLE);
|
||||
contactName.setVisibility(View.VISIBLE);
|
||||
edit.setVisibility(View.VISIBLE);
|
||||
back.setVisibility(View.VISIBLE);
|
||||
startCall.setVisibility(View.VISIBLE);
|
||||
newChatConversation = false;
|
||||
chatRoom = LinphoneManager.getLc().getOrCreateChatRoom(address);
|
||||
|
||||
if(c != null)
|
||||
changeDisplayedChat(address,c.getName(),null);
|
||||
else
|
||||
changeDisplayedChat(address,username,null);
|
||||
dispayMessageList();
|
||||
}
|
||||
|
||||
private void showPopupMenuAskingImageSize(final String filePath) {
|
||||
filePathToUpload = filePath;
|
||||
try {
|
||||
|
@ -891,12 +967,12 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
|
||||
@Override
|
||||
public void onLinphoneChatMessageStateChanged(LinphoneChatMessage msg, State state) {
|
||||
if (state == State.FileTransferDone || state == State.FileTransferError) {
|
||||
uploadLayout.setVisibility(View.GONE);
|
||||
textLayout.setVisibility(View.VISIBLE);
|
||||
progressBar.setProgress(0);
|
||||
currentMessageInFileTransferUploadState = null;
|
||||
}
|
||||
//if (state == State.FileTransferDone || state == State.FileTransferError) {
|
||||
// uploadLayout.setVisibility(View.GONE);
|
||||
// textLayout.setVisibility(View.VISIBLE);
|
||||
// progressBar.setProgress(0);
|
||||
// currentMessageInFileTransferUploadState = null;
|
||||
//}
|
||||
invalidate();
|
||||
}
|
||||
|
||||
|
@ -937,7 +1013,6 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
FilterResults results) {
|
||||
|
||||
if (results.count > 0) {
|
||||
Log.w(results.count);
|
||||
contacts.clear();
|
||||
contacts = (List<ContactAddress>) results.values;
|
||||
notifyDataSetChanged();
|
||||
|
@ -953,9 +1028,6 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
List<ContactAddress> result = new ArrayList<ContactAddress>();
|
||||
if(constraint != null) {
|
||||
for (ContactAddress c : contacts) {
|
||||
Log.w(constraint.toString());
|
||||
Log.w(c.mContact.getName());
|
||||
Log.w(c.mAddress);
|
||||
if (c.mContact.getName().toLowerCase().startsWith(constraint.toString()) || c.mAddress.startsWith(constraint.toString())) {
|
||||
result.add(c);
|
||||
}
|
||||
|
@ -1025,15 +1097,14 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
final TextView address = (TextView) view.findViewById(R.id.contact_address);
|
||||
address.setText(contact.mAddress);
|
||||
|
||||
final String a = contact.mAddress;
|
||||
final Contact c = contact.mContact;
|
||||
|
||||
view.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
searchContactField.setVisibility(View.GONE);
|
||||
sipUri = address.getText().toString();
|
||||
messagesList.setVisibility(View.VISIBLE);
|
||||
newChatConversation = false;
|
||||
chatRoom = LinphoneManager.getLc().getOrCreateChatRoom(address.getText().toString());
|
||||
dispayMessageList();
|
||||
exitNewConversationMode(c, a,null);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@ import android.widget.CheckBox;
|
|||
import android.widget.CompoundButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
/**
|
||||
|
@ -69,7 +70,8 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
private List<String> mConversations, mDrafts;
|
||||
private ListView chatList;
|
||||
private TextView noChatHistory;
|
||||
private ImageView edit, selectAll, deselectAll, delete, newDiscussion, contactPicture;
|
||||
private ImageView edit, selectAll, deselectAll, delete, newDiscussion, contactPicture, cancel;
|
||||
private RelativeLayout editList, topbar;
|
||||
private boolean isEditMode = false;
|
||||
private boolean useLinphoneStorage;
|
||||
|
||||
|
@ -85,6 +87,12 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
|
||||
noChatHistory = (TextView) view.findViewById(R.id.noChatHistory);
|
||||
|
||||
editList = (RelativeLayout) view.findViewById(R.id.edit_list);
|
||||
topbar = (RelativeLayout) view.findViewById(R.id.top_bar);
|
||||
|
||||
cancel = (ImageView) view.findViewById(R.id.cancel);
|
||||
cancel.setOnClickListener(this);
|
||||
|
||||
edit = (ImageView) view.findViewById(R.id.edit);
|
||||
edit.setOnClickListener(this);
|
||||
|
||||
|
@ -99,7 +107,6 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
|
||||
delete = (ImageView) view.findViewById(R.id.delete);
|
||||
delete.setOnClickListener(this);
|
||||
delete.setVisibility(View.INVISIBLE);
|
||||
return view;
|
||||
}
|
||||
|
||||
|
@ -127,10 +134,8 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
|
||||
public void quitEditMode(){
|
||||
isEditMode = false;
|
||||
selectAll.setVisibility(View.GONE);
|
||||
deselectAll.setVisibility(View.GONE);
|
||||
delete.setVisibility(View.GONE);
|
||||
edit.setVisibility(View.VISIBLE);
|
||||
editList.setVisibility(View.GONE);
|
||||
topbar.setVisibility(View.VISIBLE);
|
||||
refresh();
|
||||
}
|
||||
|
||||
|
@ -257,6 +262,11 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
return;
|
||||
}
|
||||
|
||||
if (id == R.id.cancel) {
|
||||
quitEditMode();
|
||||
return;
|
||||
}
|
||||
|
||||
if (id == R.id.delete) {
|
||||
final Dialog dialog = LinphoneActivity.instance().displayDialog(getString(R.string.delete_text));
|
||||
Button delete = (Button) dialog.findViewById(R.id.delete);
|
||||
|
@ -282,9 +292,8 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
return;
|
||||
}
|
||||
else if (id == R.id.edit) {
|
||||
edit.setVisibility(View.GONE);
|
||||
selectAll.setVisibility(View.VISIBLE);
|
||||
delete.setVisibility(View.VISIBLE);
|
||||
topbar.setVisibility(View.GONE);
|
||||
editList.setVisibility(View.VISIBLE);
|
||||
isEditMode = true;
|
||||
hideAndDisplayMessageIfNoChat();
|
||||
}
|
||||
|
@ -461,26 +470,22 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
Contact lContact = ContactsManager.getInstance().findContactWithAddress(getActivity().getContentResolver(), address);
|
||||
|
||||
String message = "";
|
||||
Long time = null;
|
||||
Long time;
|
||||
TextView lastMessageView = (TextView) view.findViewById(R.id.lastMessage);
|
||||
LinphoneChatRoom chatRoom = LinphoneManager.getLc().getOrCreateChatRoom(contact);
|
||||
LinphoneChatMessage[] history = chatRoom.getHistory(1);
|
||||
LinphoneChatMessage msg = history[0];
|
||||
if (msg.getText() != null && msg.getText().length() > 0) {
|
||||
TextView date = (TextView) view.findViewById(R.id.date);
|
||||
if(msg.getFileTransferInformation() != null || msg.getExternalBodyUrl() != null || msg.getAppData() != null ){
|
||||
lastMessageView.setBackgroundResource(R.drawable.chat_file_message);
|
||||
time = msg.getTime();
|
||||
date.setText(timestampToHumanDate(time));
|
||||
} else if (msg.getText() != null && msg.getText().length() > 0 ){
|
||||
message = msg.getText();
|
||||
time = msg.getTime();
|
||||
lastMessageView.setText(message);
|
||||
} else {
|
||||
if(msg.getFileTransferInformation() != null || msg.getExternalBodyUrl() != null){
|
||||
lastMessageView.setBackgroundResource(R.drawable.chat_file_message);
|
||||
time = msg.getTime();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
TextView date = (TextView) view.findViewById(R.id.date);
|
||||
if(time != null)
|
||||
date.setText(timestampToHumanDate(time));
|
||||
lastMessageView.setText(message);
|
||||
}
|
||||
|
||||
TextView sipUri = (TextView) view.findViewById(R.id.sipUri);
|
||||
sipUri.setSelected(true); // For animation
|
||||
|
@ -495,8 +500,11 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
view.findViewById(R.id.draft).setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
TextView unreadMessages = (TextView) view.findViewById(R.id.unreadMessages);
|
||||
|
||||
CheckBox select = (CheckBox) view.findViewById(R.id.delete);
|
||||
if (isEditMode) {
|
||||
unreadMessages.setVisibility(View.GONE);
|
||||
select.setVisibility(View.VISIBLE);
|
||||
select.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
|
@ -510,11 +518,10 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
select.setChecked(false);
|
||||
}
|
||||
} else {
|
||||
delete.setVisibility(View.GONE);
|
||||
unreadMessages.setVisibility(View.GONE);
|
||||
//delete.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
TextView unreadMessages = (TextView) view.findViewById(R.id.unreadMessages);
|
||||
|
||||
if (unreadMessagesCount > 0) {
|
||||
unreadMessages.setVisibility(View.VISIBLE);
|
||||
unreadMessages.setText(String.valueOf(unreadMessagesCount));
|
||||
|
|
|
@ -26,6 +26,8 @@ import java.util.Calendar;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.linphone.Contact;
|
||||
import org.linphone.ContactsManager;
|
||||
import org.linphone.LinphoneManager;
|
||||
import org.linphone.LinphoneUtils;
|
||||
import org.linphone.R;
|
||||
|
@ -73,7 +75,7 @@ public class BubbleChat implements LinphoneChatMessage.LinphoneChatMessageListen
|
|||
private static final HashMap<String, Integer> emoticons = new HashMap<String, Integer>();
|
||||
|
||||
private LinearLayout view;
|
||||
private ImageView statusView;
|
||||
private ImageView statusView, contactPicture;
|
||||
private LinphoneChatMessage nativeMessage;
|
||||
private Context mContext;
|
||||
private static final int SIZE_MAX = 512;
|
||||
|
@ -81,7 +83,7 @@ public class BubbleChat implements LinphoneChatMessage.LinphoneChatMessageListen
|
|||
private Bitmap defaultBitmap;
|
||||
|
||||
@SuppressLint("InflateParams")
|
||||
public BubbleChat(final Context context, LinphoneChatMessage message) {
|
||||
public BubbleChat(final Context context, LinphoneChatMessage message, Contact c) {
|
||||
if (message == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -94,7 +96,7 @@ public class BubbleChat implements LinphoneChatMessage.LinphoneChatMessageListen
|
|||
view = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.chat_bubble_incoming, null);
|
||||
}
|
||||
|
||||
defaultBitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.chat_photo_default);
|
||||
defaultBitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.chat_picture_over);
|
||||
|
||||
view.setId(message.getStorageId());
|
||||
|
||||
|
@ -102,6 +104,12 @@ public class BubbleChat implements LinphoneChatMessage.LinphoneChatMessageListen
|
|||
|
||||
String externalBodyUrl = message.getExternalBodyUrl();
|
||||
LinphoneContent fileTransferContent = message.getFileTransferInformation();
|
||||
|
||||
if(LinphoneManager.getInstance().getMessageUploadPending() != null){
|
||||
spinner.setVisibility(View.VISIBLE);
|
||||
nativeMessage.setListener(LinphoneManager.getInstance());
|
||||
}
|
||||
|
||||
if (externalBodyUrl != null || fileTransferContent != null) {
|
||||
Button download = (Button) view.findViewById(R.id.download);
|
||||
ImageView imageView = (ImageView) view.findViewById(R.id.image);
|
||||
|
@ -158,7 +166,23 @@ public class BubbleChat implements LinphoneChatMessage.LinphoneChatMessageListen
|
|||
}
|
||||
|
||||
TextView contact = (TextView) view.findViewById(R.id.contact_header);
|
||||
contact.setText(timestampToHumanDate(context, message.getTime()) + " - " + LinphoneUtils.getUsernameFromAddress(message.getFrom().asStringUriOnly()));
|
||||
|
||||
|
||||
|
||||
contactPicture = (ImageView) view.findViewById(R.id.contact_picture);
|
||||
|
||||
String displayName = nativeMessage.getFrom().getUserName();
|
||||
final String sipUri = nativeMessage.getFrom().asStringUriOnly();
|
||||
if(!nativeMessage.isOutgoing()) {
|
||||
if (c != null) {
|
||||
displayName = c.getName();
|
||||
LinphoneUtils.setImagePictureFromUri(view.getContext(), contactPicture, c.getPhotoUri(), c.getThumbnailUri());
|
||||
} else {
|
||||
contactPicture.setImageResource(R.drawable.avatar);
|
||||
}
|
||||
}
|
||||
|
||||
contact.setText(timestampToHumanDate(context, message.getTime()) + " - " + displayName);
|
||||
|
||||
LinphoneChatMessage.State status = message.getStatus();
|
||||
statusView = (ImageView) view.findViewById(R.id.status);
|
||||
|
|
Loading…
Reference in a new issue