[Chat] update phone chat UI - message send bar + other updates

This commit is contained in:
Brieuc Viel 2016-04-25 11:34:23 +02:00
parent c1e9548348
commit 7c4c388706
4 changed files with 30 additions and 16 deletions

View file

@ -74,7 +74,7 @@
android:layout_centerHorizontal="true"
android:background="@color/colorD">
<LinearLayout
<RelativeLayout
android:id="@+id/message_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -103,20 +103,21 @@
<EditText
android:id="@+id/message"
android:imeOptions="flagNoExtractUi"
android:textCursorDrawable="@null"
android:inputType="textMultiLine"
android:maxLines="2"
android:textColor="@android:color/black"
android:layout_width="match_parent"
android:layout_height="40dp"
android:imeOptions="flagNoExtractUi"
android:textCursorDrawable="@null"
android:inputType="textMultiLine"
android:maxLines="2"
android:textColor="@android:color/black"
android:layout_width="match_parent"
android:layout_height="40dp"
android:padding="10dp"
android:layout_toRightOf="@id/send_picture"
android:layout_toLeftOf="@id/send_message"
android:background="@drawable/resizable_textfield"
android:layout_centerVertical="true"/>
android:layout_toRightOf="@id/send_picture"
android:layout_toLeftOf="@id/send_message"
android:background="@drawable/resizable_textfield"
android:layout_centerVertical="true"
/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
<TextView

View file

@ -1293,6 +1293,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
@Override
protected void onPause() {
LinphoneManager.getInstance().enableProxyPublish(false);
LinphoneManager.getInstance().subscribeFriendList(false);
getIntent().putExtra("PreviousActivity", 0);
super.onPause();
@ -1348,6 +1349,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
//LinphoneManager.getInstance().changeStatusToOnline();
LinphoneManager.getInstance().enableProxyPublish(true);
LinphoneManager.getInstance().subscribeFriendList(true);
if (getIntent().getIntExtra("PreviousActivity", 0) != CALL_ACTIVITY){
if (LinphoneManager.getLc().getCalls().length > 0) {

View file

@ -429,8 +429,6 @@ public class LinphoneContact implements Serializable, Comparable<LinphoneContact
friend.setIncSubscribePolicy(SubscribePolicy.SPAccept);
PresenceModel model = LinphoneCoreFactory.instance().createPresenceModel(PresenceActivityType.Online, null);
friend.setPresenceModel(model);
Log.e("===>>> LinphoneContact - isLinphoneFriend :" + getFriendPresenceModel().toString());
}
}

View file

@ -367,6 +367,19 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
}
}
//TODO to Complete
public void subscribeFriendList(boolean enabled){
LinphoneCore lc = getLcIfManagerNotDestroyedOrNull();
if(lc != null ) {
/* if (enabled) {
lc.linphone_friend_list_update_subscriptions(linphone_core_get_default_friend_list(LC), NULL, TRUE);
} else {
linphone_friend_list_close_subscriptions(linphone_core_get_default_friend_list(LC));
}
*/
}
}
public void changeStatusToOnline() {
LinphoneCore lc = getLcIfManagerNotDestroyedOrNull();
@ -866,7 +879,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
public void notifyPresenceReceived(LinphoneCore lc, LinphoneFriend lf) {
for(AvatarWithPresenceImage listener : listeners){
if(listener.isThisFriend(lf)){
//Log.e("===>> LinphoneManager : notifyPresenceReceived : "+lf.getName().toString()+" - "+lf.getPresenceModel().getActivity().getType());
Log.e("===>> LinphoneManager : notifyPresenceReceived : "+lf.getName().toString()+" - "+lf.getPresenceModel().getActivity().getType());
listener.updatePresenceIcon(lc, lf);
}
}