Fixes & interface improvements
This commit is contained in:
parent
a0caddeb8b
commit
fa376612ed
6 changed files with 42 additions and 12 deletions
Binary file not shown.
Before Width: | Height: | Size: 6.1 KiB |
|
@ -43,6 +43,14 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/newFastChat"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/new_fast_chat"
|
||||
android:textColor="@color/text_default"
|
||||
android:inputType="textEmailAddress"/>
|
||||
|
||||
<ListView
|
||||
android:id="@+id/chatList"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -201,6 +201,7 @@
|
|||
|
||||
<string name="addressHint">Numéro ou adresse</string>
|
||||
<string name="conference">Conférence</string>
|
||||
<string name="new_fast_chat">Entrez une adresse SIP avec qui discuter…</string>
|
||||
|
||||
<!-- Used by Android to help blind people by describing them images -->
|
||||
<string name="content_description_add_contact"></string>
|
||||
|
|
|
@ -251,6 +251,7 @@
|
|||
|
||||
<string name="addressHint">Number or address</string>
|
||||
<string name="conference">Conference</string>
|
||||
<string name="new_fast_chat">Enter a SIP address to chat with…</string>
|
||||
|
||||
<!-- Used by Android to help blind people by describing them images -->
|
||||
<string name="content_description_add_contact">Add to contacts button</string>
|
||||
|
|
|
@ -24,6 +24,8 @@ import org.linphone.core.LinphoneCoreFactory;
|
|||
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.ContextMenu;
|
||||
import android.view.ContextMenu.ContextMenuInfo;
|
||||
import android.view.LayoutInflater;
|
||||
|
@ -35,6 +37,7 @@ import android.widget.AdapterView;
|
|||
import android.widget.AdapterView.AdapterContextMenuInfo;
|
||||
import android.widget.AdapterView.OnItemClickListener;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
@ -46,7 +49,8 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
private LayoutInflater mInflater;
|
||||
private List<String> mConversations;
|
||||
private ListView chatList;
|
||||
private ImageView edit, ok, newDiscussion;
|
||||
private ImageView edit, ok, newDiscussion, isFastNewChatAddressOk;
|
||||
private EditText fastNewChat;
|
||||
private boolean isEditMode = false;
|
||||
|
||||
@Override
|
||||
|
@ -66,6 +70,7 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
ok = (ImageView) view.findViewById(R.id.ok);
|
||||
ok.setOnClickListener(this);
|
||||
|
||||
fastNewChat = (EditText) view.findViewById(R.id.newFastChat);
|
||||
return view;
|
||||
}
|
||||
|
||||
|
@ -117,7 +122,18 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
chatList.setAdapter(new ChatListAdapter());
|
||||
}
|
||||
else if (id == R.id.newDiscussion) {
|
||||
String sipUri = fastNewChat.getText().toString();
|
||||
if (sipUri.equals("")) {
|
||||
LinphoneActivity.instance().displayContacts();
|
||||
} else {
|
||||
if (!LinphoneUtils.isSipAddress(sipUri)) {
|
||||
sipUri = sipUri + "@" + LinphoneManager.getLc().getDefaultProxyConfig().getDomain();
|
||||
}
|
||||
if (!LinphoneUtils.isStrictSipAddress(sipUri)) {
|
||||
sipUri = "sip:" + sipUri;
|
||||
}
|
||||
LinphoneActivity.instance().displayChat(sipUri);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -116,6 +116,7 @@ public class ChatStorage {
|
|||
Cursor c = db.query(TABLE_NAME, null, "remoteContact LIKE \"" + correspondent + "\"", null, null, null, "id ASC");
|
||||
|
||||
while (c.moveToNext()) {
|
||||
try {
|
||||
String message, timestamp;
|
||||
int id = c.getInt(c.getColumnIndex("id"));
|
||||
int direction = c.getInt(c.getColumnIndex("direction"));
|
||||
|
@ -126,6 +127,9 @@ public class ChatStorage {
|
|||
|
||||
ChatMessage chatMessage = new ChatMessage(id, message, rawImage, timestamp, direction == INCOMING, status);
|
||||
chatMessages.add(chatMessage);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
c.close();
|
||||
|
||||
|
|
Loading…
Reference in a new issue