mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-05-07 05:53:07 +00:00
[Chat] chat update on edit -> checkobox + subscription closed on background
This commit is contained in:
parent
7c4c388706
commit
88f9a5f886
7 changed files with 21 additions and 20 deletions
|
|
@ -7,6 +7,7 @@
|
|||
android:orientation="horizontal" >
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/message_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/resizable_chat_bubble_incoming"
|
||||
|
|
@ -80,7 +81,7 @@
|
|||
</LinearLayout>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/delete"
|
||||
android:id="@+id/delete_message"
|
||||
android:button="@drawable/checkbox"
|
||||
android:contentDescription="@string/content_description_delete"
|
||||
android:layout_marginLeft="5dp"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
android:orientation="horizontal">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/delete"
|
||||
android:id="@+id/delete_message"
|
||||
android:button="@drawable/checkbox"
|
||||
android:contentDescription="@string/content_description_delete"
|
||||
android:layout_marginLeft="5dp"
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
android:background="@drawable/resizable_chat_bubble_outgoing"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toLeftOf="@id/delete"
|
||||
android:layout_toLeftOf="@id/delete_message"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/avatar_with_presence"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@id/delete"
|
||||
android:layout_toLeftOf="@id/delete_message"
|
||||
android:layout_marginLeft="15dp" />
|
||||
|
||||
<CheckBox
|
||||
|
|
|
|||
|
|
@ -387,21 +387,21 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
registerForContextMenu(v);
|
||||
RelativeLayout rlayout = new RelativeLayout(context);
|
||||
|
||||
//CheckBox deleteChatBubble = (CheckBox) v.findViewById(R.id.delete_message);
|
||||
CheckBox deleteChatBubble = (CheckBox) v.findViewById(R.id.delete_message);
|
||||
|
||||
if(isEditMode) {
|
||||
//deleteChatBubble.setVisibility(View.VISIBLE);
|
||||
deleteChatBubble.setVisibility(View.VISIBLE);
|
||||
if(message.isOutgoing()){
|
||||
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
|
||||
layoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
|
||||
layoutParams.setMargins(100, 10, 10, 10);
|
||||
v.setLayoutParams(layoutParams);
|
||||
} else {
|
||||
LinearLayout message_layout = (LinearLayout) v.findViewById(R.id.message_layout);
|
||||
LinearLayout message_layout = (LinearLayout) v.findViewById(R.id.message_content);
|
||||
message_layout.setGravity(Gravity.RIGHT);
|
||||
}
|
||||
|
||||
/* deleteChatBubble.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
deleteChatBubble.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
|
||||
messagesList.setItemChecked(position, b);
|
||||
|
|
@ -429,7 +429,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
} else {
|
||||
deleteChatBubble.setChecked(false);
|
||||
}
|
||||
*/
|
||||
|
||||
rlayout.addView(v);
|
||||
} else {
|
||||
if(message.isOutgoing()){
|
||||
|
|
|
|||
|
|
@ -1293,7 +1293,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
@Override
|
||||
protected void onPause() {
|
||||
LinphoneManager.getInstance().enableProxyPublish(false);
|
||||
LinphoneManager.getInstance().subscribeFriendList(false);
|
||||
//LinphoneManager.getInstance().subscribeFriendList(false);
|
||||
getIntent().putExtra("PreviousActivity", 0);
|
||||
|
||||
super.onPause();
|
||||
|
|
@ -1349,7 +1349,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
|
||||
//LinphoneManager.getInstance().changeStatusToOnline();
|
||||
LinphoneManager.getInstance().enableProxyPublish(true);
|
||||
LinphoneManager.getInstance().subscribeFriendList(true);
|
||||
//LinphoneManager.getInstance().subscribeFriendList(true);
|
||||
|
||||
if (getIntent().getIntExtra("PreviousActivity", 0) != CALL_ACTIVITY){
|
||||
if (LinphoneManager.getLc().getCalls().length > 0) {
|
||||
|
|
|
|||
|
|
@ -353,7 +353,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
|||
|
||||
public void enableProxyPublish( boolean enabled) {
|
||||
LinphoneCore lc = getLcIfManagerNotDestroyedOrNull();
|
||||
if(lc != null ) {
|
||||
if(lc != null ) {
|
||||
LinphoneProxyConfig[] proxyList = lc.getProxyConfigList();
|
||||
if(!enabled)
|
||||
changeStatusToOffline();
|
||||
|
|
@ -362,21 +362,21 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
|||
proxyConfig.enablePublish(enabled);
|
||||
proxyConfig.done();
|
||||
}
|
||||
subscribeFriendList(enabled);
|
||||
if(enabled)
|
||||
changeStatusToOnline();
|
||||
}
|
||||
}
|
||||
|
||||
//TODO to Complete
|
||||
public void subscribeFriendList(boolean enabled){
|
||||
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);
|
||||
LinphoneFriendList mFriendList = (lc.getFriendLists())[0];
|
||||
if (enabled) {
|
||||
//mFriendList.updateSubscriptions(lc.getDefaultProxyConfig(), true);
|
||||
} else {
|
||||
linphone_friend_list_close_subscriptions(linphone_core_get_default_friend_list(LC));
|
||||
mFriendList.closeSubscriptions();
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -879,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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 6a02a570180eaedf0377317758481ec82cbc791f
|
||||
Subproject commit 9efcd5f61079571ddd220d97f10bc4543b99f09e
|
||||
Loading…
Add table
Reference in a new issue