mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-02-07 06:49:45 +00:00
[Presence] AvatarPresenceImage implemented into Contact, History and chat
This commit is contained in:
parent
f85668437e
commit
42d3bd51f6
23 changed files with 725 additions and 111 deletions
|
|
@ -31,13 +31,21 @@
|
|||
android:layout_height="match_parent"
|
||||
android:gravity="center">
|
||||
|
||||
<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"/>
|
||||
<org.linphone.ui.AvatarWithPresenceImage
|
||||
android:id="@+id/avatar_with_presence"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture"
|
||||
android:src="@drawable/avatar"
|
||||
android:visibility="gone"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
android:adjustViewBounds="true"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
|
|
|
|||
|
|
@ -47,9 +47,17 @@
|
|||
android:padding="10dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<org.linphone.ui.AvatarWithPresenceImage
|
||||
android:id="@+id/avatar_with_presence"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture"
|
||||
android:src="@drawable/avatar"
|
||||
android:visibility="gone"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
|
|
|
|||
|
|
@ -39,9 +39,18 @@
|
|||
android:padding="20dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<org.linphone.ui.AvatarWithPresenceImage
|
||||
android:id="@+id/avatar_with_presence"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture"
|
||||
android:src="@drawable/avatar"
|
||||
android:visibility="gone"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
|
|
|
|||
|
|
@ -47,9 +47,17 @@
|
|||
android:padding="10dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<org.linphone.ui.AvatarWithPresenceImage
|
||||
android:id="@+id/avatar_with_presence"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture"
|
||||
android:src="@drawable/avatar"
|
||||
android:visibility="gone"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
|
|
|
|||
|
|
@ -39,9 +39,17 @@
|
|||
android:padding="20dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<org.linphone.ui.AvatarWithPresenceImage
|
||||
android:id="@+id/avatar_with_presence"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture"
|
||||
android:src="@drawable/avatar"
|
||||
android:visibility="gone"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture"
|
||||
android:id="@+id/contact_picture_small"
|
||||
android:src="@drawable/avatar"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="35dp"
|
||||
|
|
@ -17,16 +17,40 @@
|
|||
android:layout_marginLeft="5dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/friendStatus"
|
||||
android:id="@+id/friend_status_small"
|
||||
android:visibility="visible"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_alignBottom="@+id/contact_picture"
|
||||
android:layout_alignRight="@+id/contact_picture"
|
||||
android:layout_alignBottom="@+id/contact_picture_small"
|
||||
android:layout_alignRight="@+id/contact_picture_small"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_marginRight="2dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/presence_unregistered" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture_big"
|
||||
android:visibility="gone"
|
||||
android:src="@drawable/avatar"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginLeft="5dp"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/friend_status_big"
|
||||
android:visibility="gone"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_alignBottom="@+id/contact_picture_big"
|
||||
android:layout_alignRight="@+id/contact_picture_big"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_marginRight="7dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/presence_unregistered" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
|||
|
|
@ -36,9 +36,17 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true">
|
||||
|
||||
<org.linphone.ui.AvatarWithPresenceImage
|
||||
android:id="@+id/avatar_with_presence"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture"
|
||||
android:src="@drawable/avatar"
|
||||
android:visibility="gone"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
|
|
|
|||
|
|
@ -46,9 +46,17 @@
|
|||
android:padding="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<org.linphone.ui.AvatarWithPresenceImage
|
||||
android:id="@+id/avatar_with_presence"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture"
|
||||
android:src="@drawable/avatar"
|
||||
android:visibility="gone"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/separator"
|
||||
android:id="@+id/separatorLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/separatorText"
|
||||
android:id="@+id/separator"
|
||||
style="@style/font8"
|
||||
android:textStyle="bold"
|
||||
android:background="@color/colorA"
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
<org.linphone.ui.AvatarWithPresenceImage
|
||||
android:id="@+id/avatar_with_presence"
|
||||
android:layout_width="35dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
/>
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
android:layout_toRightOf="@id/avatar_with_presence"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@id/delete"
|
||||
android:layout_marginLeft="40dp" />
|
||||
android:layout_marginLeft="15dp" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/delete"
|
||||
|
|
|
|||
|
|
@ -22,9 +22,17 @@
|
|||
android:layout_margin="5dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<org.linphone.ui.AvatarWithPresenceImage
|
||||
android:id="@+id/avatar_with_presence"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture"
|
||||
android:src="@drawable/avatar"
|
||||
android:visibility="gone"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="35dp"
|
||||
|
|
@ -37,7 +45,7 @@
|
|||
android:src="@drawable/call_status_incoming"
|
||||
android:contentDescription="@string/content_description_call_direction"
|
||||
android:padding="7dp"
|
||||
android:layout_toRightOf="@id/contact_picture"
|
||||
android:layout_toRightOf="@id/avatar_with_presence"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:adjustViewBounds="true"
|
||||
|
|
|
|||
|
|
@ -38,8 +38,16 @@
|
|||
android:padding="20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<org.linphone.ui.AvatarWithPresenceImage
|
||||
android:id="@+id/avatar_with_presence"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contact_picture"
|
||||
android:visibility="gone"
|
||||
android:src="@drawable/avatar"
|
||||
android:contentDescription="@string/content_description_contact_picture"
|
||||
android:layout_width="80dp"
|
||||
|
|
|
|||
|
|
@ -1,24 +1,57 @@
|
|||
#
|
||||
#This file shall not contain path referencing package name, in order to be portable when app is renamed.
|
||||
#Paths to resources must be set from LinphoneManager, after creating LinphoneCore.
|
||||
|
||||
[net]
|
||||
download_bw=380
|
||||
upload_bw=380
|
||||
mtu=1300
|
||||
|
||||
[app]
|
||||
animations=0
|
||||
show_login_view=1
|
||||
debug_popup_magic=#1234
|
||||
debug=1
|
||||
server_url=http://85.233.205.218:443/xmlrpc
|
||||
firewall_policy=ice
|
||||
stun_server=85.233.205.218
|
||||
|
||||
[sip]
|
||||
contact="Linphone Android" <sip:linphone.android@unknown-host>
|
||||
use_info=0
|
||||
use_ipv6=0
|
||||
keepalive_period=30000
|
||||
guess_hostname=1
|
||||
inc_timeout=15
|
||||
register_only_when_network_is_up=1
|
||||
auto_net_state_mon=0
|
||||
auto_answer_replacing_calls=1
|
||||
ping_with_options=0
|
||||
root_ca=/data/user/0/org.linphone/files/rootca.pem
|
||||
verify_server_certs=1
|
||||
verify_server_cn=1
|
||||
media_encryption=zrtp
|
||||
multi_transport_migration_done=1
|
||||
in_call_timeout=0
|
||||
delayed_timeout=4
|
||||
register_only_when_upnp_is_ok=1
|
||||
media_encryption_mandatory=1
|
||||
sip_port=-1
|
||||
sip_tcp_port=-1
|
||||
sip_tls_port=-1
|
||||
srtp_crypto_suites=AES_CM_256_HMAC_SHA1_80
|
||||
default_proxy=0
|
||||
rls_uri=sip:rls@sip.example.org
|
||||
use_rls_presence=1
|
||||
|
||||
[video]
|
||||
size=qvga
|
||||
device=Android1
|
||||
display=1
|
||||
capture=1
|
||||
|
||||
[app]
|
||||
sharing_server=https://www.linphone.org:444/lft.php
|
||||
tunnel=disabled
|
||||
push_notification=1
|
||||
animations=0
|
||||
show_login_view=1
|
||||
debug_popup_magic=#1234
|
||||
debug=1
|
||||
server_url=http://85.233.205.218:443/xmlrpc
|
||||
first_launch=0
|
||||
|
||||
[tunnel]
|
||||
port=443
|
||||
|
||||
[rtp]
|
||||
audio_rtp_port=7076
|
||||
|
|
@ -27,16 +60,202 @@ audio_jitt_comp=60
|
|||
video_jitt_comp=60
|
||||
nortp_timeout=30
|
||||
disable_upnp=1
|
||||
text_rtp_port=11078
|
||||
audio_adaptive_jitt_comp_enabled=1
|
||||
video_adaptive_jitt_comp_enabled=1
|
||||
|
||||
[sound]
|
||||
playback_dev_id=
|
||||
ringer_dev_id=
|
||||
capture_dev_id=
|
||||
dtmf_player_amp=0.1
|
||||
|
||||
#remove this property for any application that is not Linphone public version itself
|
||||
ec_calibrator_cool_tones=1
|
||||
local_ring=/data/user/0/org.linphone/files/oldphone_mono.wav
|
||||
remote_ring=/data/user/0/org.linphone/files/ringback.wav
|
||||
playback_gain_db=0.000000
|
||||
mic_gain_db=0.000000
|
||||
#remove this property for any application that is not Linphone public version itself
|
||||
|
||||
[misc]
|
||||
max_calls=10
|
||||
log_collection_upload_server_url=https://www.linphone.org:444/lft.php
|
||||
log_collection_upload_server_url=https://www.linphone.org:444/lft.php
|
||||
uuid=3ac65678-272f-47d9-8aff-19950c565687
|
||||
friends_migration_done=1
|
||||
user_certificates_path=/data/user/0/org.linphone/files
|
||||
file_transfer_server_url=https://www.linphone.org:444/lft.php
|
||||
config-uri=https://85.233.205.218/xmlrpc?username=sylvain&password=cotcot&domain=sip.orangecyberdefense.com
|
||||
|
||||
[audio_codec_0]
|
||||
mime=opus
|
||||
rate=48000
|
||||
channels=2
|
||||
enabled=1
|
||||
|
||||
[audio_codec_1]
|
||||
mime=SILK
|
||||
rate=16000
|
||||
channels=1
|
||||
enabled=1
|
||||
|
||||
[audio_codec_2]
|
||||
mime=speex
|
||||
rate=16000
|
||||
channels=1
|
||||
enabled=1
|
||||
|
||||
[audio_codec_3]
|
||||
mime=speex
|
||||
rate=8000
|
||||
channels=1
|
||||
enabled=1
|
||||
|
||||
[audio_codec_4]
|
||||
mime=PCMU
|
||||
rate=8000
|
||||
channels=1
|
||||
enabled=1
|
||||
|
||||
[audio_codec_5]
|
||||
mime=PCMA
|
||||
rate=8000
|
||||
channels=1
|
||||
enabled=1
|
||||
|
||||
[audio_codec_6]
|
||||
mime=GSM
|
||||
rate=8000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_7]
|
||||
mime=G722
|
||||
rate=8000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_8]
|
||||
mime=iLBC
|
||||
rate=8000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_9]
|
||||
mime=mpeg4-generic
|
||||
rate=16000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_10]
|
||||
mime=mpeg4-generic
|
||||
rate=22050
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_11]
|
||||
mime=mpeg4-generic
|
||||
rate=32000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_12]
|
||||
mime=mpeg4-generic
|
||||
rate=44100
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_13]
|
||||
mime=mpeg4-generic
|
||||
rate=48000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_14]
|
||||
mime=iSAC
|
||||
rate=16000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_15]
|
||||
mime=speex
|
||||
rate=32000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_16]
|
||||
mime=SILK
|
||||
rate=8000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_17]
|
||||
mime=SILK
|
||||
rate=12000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_18]
|
||||
mime=SILK
|
||||
rate=24000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_19]
|
||||
mime=L16
|
||||
rate=44100
|
||||
channels=2
|
||||
enabled=0
|
||||
|
||||
[audio_codec_20]
|
||||
mime=L16
|
||||
rate=44100
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[video_codec_0]
|
||||
mime=VP8
|
||||
rate=90000
|
||||
enabled=1
|
||||
|
||||
[video_codec_1]
|
||||
mime=H264
|
||||
rate=90000
|
||||
enabled=1
|
||||
recv_fmtp=profile-level-id=42801F
|
||||
|
||||
|
||||
[friend_0]
|
||||
url="Jean Dupont" <sip:testios@sip.linphone.org>
|
||||
|
||||
[friend_1]
|
||||
url="Margaux Clerc" <sip:margaux@sip.linphone.org>
|
||||
|
||||
[friend_2]
|
||||
url="Jehan Monnier" <sip:jehan@sip.linphone.org>
|
||||
|
||||
[friend_3]
|
||||
url="Marielle Rellier" <sip:marielle@sip.linphone.org>
|
||||
|
||||
[friend_4]
|
||||
url="Simon Morlat" <sip:simon@sip.linphone.org>
|
||||
|
||||
[friend_5]
|
||||
url="François Grisez" <sip:francois@sip.linphone.org>
|
||||
|
||||
[proxy_0]
|
||||
reg_proxy=<sip:sip1.linphone.org;transport=tcp>
|
||||
reg_route=<sip:sip1.linphone.org;transport=tcp>
|
||||
reg_identity=sip:sylvain@sip.linphone.org
|
||||
quality_reporting_enabled=0
|
||||
quality_reporting_interval=0
|
||||
reg_expires=3600
|
||||
reg_sendregister=1
|
||||
publish=1
|
||||
avpf=-1
|
||||
avpf_rr_interval=5
|
||||
dial_escape_plus=0
|
||||
privacy=32768
|
||||
refkey=push_notification
|
||||
publish_expires=600
|
||||
|
||||
[auth_info_0]
|
||||
username=sylvain
|
||||
passwd=lucifer
|
||||
realm=sip.linphone.org
|
||||
domain=sip.linphone.org
|
||||
|
|
@ -1,24 +1,57 @@
|
|||
|
||||
#
|
||||
#This file shall not contain path referencing package name, in order to be portable when app is renamed.
|
||||
#Paths to resources must be set from LinphoneManager, after creating LinphoneCore.
|
||||
[net]
|
||||
download_bw=380
|
||||
upload_bw=380
|
||||
mtu=1300
|
||||
|
||||
[app]
|
||||
animations=0
|
||||
show_login_view=1
|
||||
debug_popup_magic=#1234
|
||||
debug=1
|
||||
server_url=http://85.233.205.218:443/xmlrpc
|
||||
firewall_policy=ice
|
||||
stun_server=85.233.205.218
|
||||
|
||||
[sip]
|
||||
contact="Linphone Android" <sip:linphone.android@unknown-host>
|
||||
use_info=0
|
||||
use_ipv6=0
|
||||
keepalive_period=30000
|
||||
guess_hostname=1
|
||||
inc_timeout=15
|
||||
register_only_when_network_is_up=1
|
||||
auto_net_state_mon=0
|
||||
auto_answer_replacing_calls=1
|
||||
ping_with_options=0
|
||||
root_ca=/data/user/0/org.linphone/files/rootca.pem
|
||||
verify_server_certs=1
|
||||
verify_server_cn=1
|
||||
media_encryption=zrtp
|
||||
multi_transport_migration_done=1
|
||||
in_call_timeout=0
|
||||
delayed_timeout=4
|
||||
register_only_when_upnp_is_ok=1
|
||||
media_encryption_mandatory=1
|
||||
sip_port=-1
|
||||
sip_tcp_port=-1
|
||||
sip_tls_port=-1
|
||||
srtp_crypto_suites=AES_CM_256_HMAC_SHA1_80
|
||||
default_proxy=0
|
||||
rls_uri=sip:rls@sip.example.org
|
||||
use_rls_presence=1
|
||||
|
||||
[video]
|
||||
size=qvga
|
||||
device=Android1
|
||||
display=1
|
||||
capture=1
|
||||
|
||||
[app]
|
||||
sharing_server=https://www.linphone.org:444/lft.php
|
||||
tunnel=disabled
|
||||
push_notification=1
|
||||
animations=0
|
||||
show_login_view=1
|
||||
debug_popup_magic=#1234
|
||||
debug=1
|
||||
server_url=http://85.233.205.218:443/xmlrpc
|
||||
first_launch=0
|
||||
|
||||
[tunnel]
|
||||
port=443
|
||||
|
||||
[rtp]
|
||||
audio_rtp_port=7076
|
||||
|
|
@ -27,17 +60,204 @@ audio_jitt_comp=60
|
|||
video_jitt_comp=60
|
||||
nortp_timeout=30
|
||||
disable_upnp=1
|
||||
text_rtp_port=11078
|
||||
audio_adaptive_jitt_comp_enabled=1
|
||||
video_adaptive_jitt_comp_enabled=1
|
||||
|
||||
[sound]
|
||||
playback_dev_id=
|
||||
ringer_dev_id=
|
||||
capture_dev_id=
|
||||
dtmf_player_amp=0.1
|
||||
|
||||
#remove this property for any application that is not Linphone public version itself
|
||||
ec_calibrator_cool_tones=1
|
||||
|
||||
local_ring=/data/user/0/org.linphone/files/oldphone_mono.wav
|
||||
remote_ring=/data/user/0/org.linphone/files/ringback.wav
|
||||
playback_gain_db=0.000000
|
||||
mic_gain_db=0.000000
|
||||
#remove this property for any application that is not Linphone public version itself
|
||||
|
||||
[misc]
|
||||
max_calls=10
|
||||
log_collection_upload_server_url=https://www.linphone.org:444/lft.php
|
||||
log_collection_upload_server_url=https://www.linphone.org:444/lft.php
|
||||
uuid=3ac65678-272f-47d9-8aff-19950c565687
|
||||
friends_migration_done=1
|
||||
user_certificates_path=/data/user/0/org.linphone/files
|
||||
file_transfer_server_url=https://www.linphone.org:444/lft.php
|
||||
config-uri=https://85.233.205.218/xmlrpc?username=sylvain&password=cotcot&domain=sip.orangecyberdefense.com
|
||||
|
||||
[audio_codec_0]
|
||||
mime=opus
|
||||
rate=48000
|
||||
channels=2
|
||||
enabled=1
|
||||
|
||||
[audio_codec_1]
|
||||
mime=SILK
|
||||
rate=16000
|
||||
channels=1
|
||||
enabled=1
|
||||
|
||||
[audio_codec_2]
|
||||
mime=speex
|
||||
rate=16000
|
||||
channels=1
|
||||
enabled=1
|
||||
|
||||
[audio_codec_3]
|
||||
mime=speex
|
||||
rate=8000
|
||||
channels=1
|
||||
enabled=1
|
||||
|
||||
[audio_codec_4]
|
||||
mime=PCMU
|
||||
rate=8000
|
||||
channels=1
|
||||
enabled=1
|
||||
|
||||
[audio_codec_5]
|
||||
mime=PCMA
|
||||
rate=8000
|
||||
channels=1
|
||||
enabled=1
|
||||
|
||||
[audio_codec_6]
|
||||
mime=GSM
|
||||
rate=8000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_7]
|
||||
mime=G722
|
||||
rate=8000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_8]
|
||||
mime=iLBC
|
||||
rate=8000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_9]
|
||||
mime=mpeg4-generic
|
||||
rate=16000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_10]
|
||||
mime=mpeg4-generic
|
||||
rate=22050
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_11]
|
||||
mime=mpeg4-generic
|
||||
rate=32000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_12]
|
||||
mime=mpeg4-generic
|
||||
rate=44100
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_13]
|
||||
mime=mpeg4-generic
|
||||
rate=48000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_14]
|
||||
mime=iSAC
|
||||
rate=16000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_15]
|
||||
mime=speex
|
||||
rate=32000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_16]
|
||||
mime=SILK
|
||||
rate=8000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_17]
|
||||
mime=SILK
|
||||
rate=12000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_18]
|
||||
mime=SILK
|
||||
rate=24000
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[audio_codec_19]
|
||||
mime=L16
|
||||
rate=44100
|
||||
channels=2
|
||||
enabled=0
|
||||
|
||||
[audio_codec_20]
|
||||
mime=L16
|
||||
rate=44100
|
||||
channels=1
|
||||
enabled=0
|
||||
|
||||
[video_codec_0]
|
||||
mime=VP8
|
||||
rate=90000
|
||||
enabled=1
|
||||
|
||||
[video_codec_1]
|
||||
mime=H264
|
||||
rate=90000
|
||||
enabled=1
|
||||
recv_fmtp=profile-level-id=42801F
|
||||
|
||||
[friend_0]
|
||||
url="Sylvain Berfini" <sip:sylvain@sip.linphone.org>
|
||||
|
||||
[friend_1]
|
||||
url="Margaux Clerc" <sip:margaux@sip.linphone.org>
|
||||
|
||||
[friend_2]
|
||||
url="Jehan Monnier" <sip:jehan@sip.linphone.org>
|
||||
|
||||
[friend_3]
|
||||
url="Marielle Rellier" <sip:marielle@sip.linphone.org>
|
||||
|
||||
[friend_4]
|
||||
url="Simon Morlat" <sip:simon@sip.linphone.org>
|
||||
|
||||
[friend_5]
|
||||
url="François Grisez" <sip:francois@sip.linphone.org>
|
||||
|
||||
[friend_5]
|
||||
url="L'ami invisible'" <sip:unknab2901AT331tATA@sip.linphone.org>
|
||||
|
||||
[proxy_0]
|
||||
reg_proxy=<sip:sip1.linphone.org;transport=tcp>
|
||||
reg_route=<sip:sip1.linphone.org;transport=tcp>
|
||||
reg_identity=sip:testios@sip.linphone.org
|
||||
quality_reporting_enabled=0
|
||||
quality_reporting_interval=0
|
||||
reg_expires=3600
|
||||
reg_sendregister=1
|
||||
publish=1
|
||||
avpf=-1
|
||||
avpf_rr_interval=5
|
||||
dial_escape_plus=0
|
||||
privacy=32768
|
||||
refkey=push_notification
|
||||
publish_expires=600
|
||||
|
||||
[auth_info_0]
|
||||
username=testios
|
||||
passwd=testtest
|
||||
realm=sip.linphone.org
|
||||
domain=sip.linphone.org
|
||||
|
|
|
|||
|
|
@ -23,8 +23,10 @@ import java.io.ByteArrayOutputStream;
|
|||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import org.linphone.compatibility.Compatibility;
|
||||
import org.linphone.core.LinphoneAddress;
|
||||
|
|
@ -1004,6 +1006,9 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void searchContacts(String search) {
|
||||
if (search == null || search.length() == 0) {
|
||||
resultContactsSearch.setAdapter(new SearchContactsListAdapter(null));
|
||||
|
|
@ -1025,40 +1030,24 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
searchAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
||||
|
||||
class SearchContactsListAdapter extends BaseAdapter {
|
||||
private List<LinphoneFriend> contacts;
|
||||
private LayoutInflater mInflater;
|
||||
private List<LinphoneContact> contacts;
|
||||
Map<String, Integer> map = new LinkedHashMap<String, Integer>();
|
||||
|
||||
SearchContactsListAdapter(List<LinphoneFriend> contactsList) {
|
||||
mInflater = inflater;
|
||||
/* if(contactsList == null){
|
||||
contacts = getContactsList();
|
||||
} else {
|
||||
*/ contacts = contactsList;
|
||||
// }
|
||||
}
|
||||
SearchContactsListAdapter(List<LinphoneContact> contactsList) {
|
||||
contacts = contactsList;
|
||||
|
||||
public List<ContactAddress>getContactsList(){
|
||||
List<ContactAddress> list = new ArrayList<ContactAddress>();
|
||||
/*for(Contact con: ContactsManager.getInstance().getAllContacts()){
|
||||
for(String numberOrAddress : con.getNumbersOrAddresses()){
|
||||
list.add(new ContactAddress(con, numberOrAddress));
|
||||
}
|
||||
}
|
||||
*/return list;
|
||||
}
|
||||
|
||||
public int getCount() {
|
||||
return contacts.size();
|
||||
}
|
||||
|
||||
public LinphoneFriend getItem(int position) {
|
||||
/* if (contacts == null || position >= contacts.size()) {
|
||||
contacts = getContactsList();
|
||||
return contacts.get(position);
|
||||
} else {
|
||||
*/ return contacts.get(position);
|
||||
// }
|
||||
public LinphoneContact getItem(int position) {
|
||||
return contacts.get(position);
|
||||
}
|
||||
|
||||
public long getItemId(int position) {
|
||||
|
|
@ -1067,10 +1056,10 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
View view = null;
|
||||
LinphoneFriend f;
|
||||
LinphoneContact c;
|
||||
do {
|
||||
f = getItem(position);
|
||||
} while (f == null);
|
||||
c = getItem(position);
|
||||
} while (c == null);
|
||||
|
||||
if (convertView != null) {
|
||||
view = convertView;
|
||||
|
|
@ -1079,18 +1068,18 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
|||
}
|
||||
|
||||
final String a = contact.getFullName();
|
||||
final LinphoneContact c = contact;
|
||||
//final LinphoneContact c = contact;
|
||||
|
||||
TextView name = (TextView) view.findViewById(R.id.contact_name);
|
||||
name.setText(c.getFullName());
|
||||
|
||||
final LinphoneAddress laddress = f.getAddress();
|
||||
final String laddress = c.getNumbersOrAddresses().get(0).toString();
|
||||
|
||||
view.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
//exitNewConversationMode(c, a, null);
|
||||
exitNewConversationMode(laddress.toString());
|
||||
exitNewConversationMode(laddress);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import org.linphone.core.LinphoneCoreException;
|
|||
import org.linphone.core.LinphoneCoreFactory;
|
||||
import org.linphone.core.LinphoneFriend;
|
||||
import org.linphone.mediastream.Log;
|
||||
import org.linphone.ui.AvatarWithPresenceImage;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.app.ProgressDialog;
|
||||
|
|
@ -362,6 +363,13 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
|||
String message = "";
|
||||
Long time;
|
||||
|
||||
AvatarWithPresenceImage avatarWithPresenceImage = (AvatarWithPresenceImage) view.findViewById(R.id.avatar_with_presence);
|
||||
avatarWithPresenceImage.setFormatAvatarImage(AvatarWithPresenceImage.AVATAR_SMALL);
|
||||
if(contact != null && contact.isLinphoneFriend() && contact.getFriendPresenceModel() != null) {
|
||||
avatarWithPresenceImage.setLinphoneContact(contact);
|
||||
LinphoneActivity.instance().addPresenceUpdatedListener(avatarWithPresenceImage);
|
||||
}
|
||||
|
||||
//Obiane specification
|
||||
LinphoneFriend friend = LinphoneManager.getLc().findFriendByAddress(address.asStringUriOnly());
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
*/
|
||||
import org.linphone.core.LinphoneCore;
|
||||
import org.linphone.core.LinphoneProxyConfig;
|
||||
import org.linphone.ui.AvatarWithPresenceImage;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
|
|
@ -115,7 +116,14 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener
|
|||
} else {
|
||||
contactPicture.setImageResource(R.drawable.avatar);
|
||||
}
|
||||
|
||||
|
||||
AvatarWithPresenceImage avatarWithPresenceImage = (AvatarWithPresenceImage) view.findViewById(R.id.avatar_with_presence);
|
||||
avatarWithPresenceImage.setFormatAvatarImage(AvatarWithPresenceImage.AVATAR_BIG);
|
||||
if(contact != null && contact.isLinphoneFriend() && contact.getFriendPresenceModel() != null) {
|
||||
avatarWithPresenceImage.setLinphoneContact(contact);
|
||||
LinphoneActivity.instance().addPresenceUpdatedListener(avatarWithPresenceImage);
|
||||
}
|
||||
|
||||
TextView contactName = (TextView) view.findViewById(R.id.contact_name);
|
||||
contactName.setText(contact.getFullName());
|
||||
|
||||
|
|
|
|||
|
|
@ -425,16 +425,14 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
|
|||
TextView name = (TextView) view.findViewById(R.id.name);
|
||||
name.setText(contact.getFullName());
|
||||
|
||||
LinearLayout separator = (LinearLayout) view.findViewById(R.id.separator);
|
||||
TextView separatorText = (TextView) view.findViewById(R.id.separatorText);
|
||||
TextView separatorText = (TextView) view.findViewById(R.id.separator);
|
||||
if (getPositionForSection(getSectionForPosition(position)) != position) {
|
||||
separator.setVisibility(View.GONE);
|
||||
separatorText.setVisibility(View.GONE);
|
||||
} else {
|
||||
separator.setVisibility(View.VISIBLE);
|
||||
separatorText.setText(String.valueOf(contact.getFullName().charAt(0)));
|
||||
separatorText.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
ImageView icon = (ImageView) view.findViewById(R.id.contact_picture);
|
||||
/* ImageView icon = (ImageView) view.findViewById(R.id.contact_picture);
|
||||
if (contact.hasPhoto()) {
|
||||
LinphoneUtils.setImagePictureFromUri(getActivity(), icon, contact.getPhotoUri(), contact.getThumbnailUri());
|
||||
} else if (contact.getPhotoUri() != null) {
|
||||
|
|
@ -442,10 +440,12 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
|
|||
} else {
|
||||
icon.setImageResource(R.drawable.avatar);
|
||||
}
|
||||
|
||||
*/
|
||||
AvatarWithPresenceImage avatarWithPresenceImage = (AvatarWithPresenceImage) view.findViewById(R.id.avatar_with_presence);
|
||||
avatarWithPresenceImage.setFormatAvatarImage(AvatarWithPresenceImage.AVATAR_SMALL);
|
||||
if(contact != null && contact.isLinphoneFriend() && contact.getFriendPresenceModel() != null) {
|
||||
avatarWithPresenceImage.setLinphoneContact(contact);
|
||||
LinphoneActivity.instance().addPresenceUpdatedListener(avatarWithPresenceImage);
|
||||
}
|
||||
|
||||
return view;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import org.linphone.core.LinphoneAddress;
|
|||
import org.linphone.core.LinphoneCoreException;
|
||||
import org.linphone.core.LinphoneCoreFactory;
|
||||
import org.linphone.core.LinphoneFriend;
|
||||
import org.linphone.ui.AvatarWithPresenceImage;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Fragment;
|
||||
|
|
@ -43,6 +44,7 @@ public class HistoryDetailFragment extends Fragment implements OnClickListener {
|
|||
private ImageView dialBack, chat, addToContacts, back;
|
||||
private View view;
|
||||
private ImageView contactPicture;
|
||||
private AvatarWithPresenceImage avatarWithPresenceImage;
|
||||
private TextView contactName, contactAddress, time, date, callDirection;
|
||||
private String sipUri, displayName, pictureUri;
|
||||
|
||||
|
|
@ -79,7 +81,10 @@ public class HistoryDetailFragment extends Fragment implements OnClickListener {
|
|||
contactPicture = (ImageView) view.findViewById(R.id.contact_picture);
|
||||
contactName = (TextView) view.findViewById(R.id.contact_name);
|
||||
contactAddress = (TextView) view.findViewById(R.id.contact_address);
|
||||
|
||||
|
||||
avatarWithPresenceImage = (AvatarWithPresenceImage) view.findViewById(R.id.avatar_with_presence);
|
||||
avatarWithPresenceImage.setFormatAvatarImage(AvatarWithPresenceImage.AVATAR_BIG);
|
||||
|
||||
callDirection = (TextView) view.findViewById(R.id.direction);
|
||||
|
||||
time = (TextView) view.findViewById(R.id.time);
|
||||
|
|
@ -93,12 +98,23 @@ public class HistoryDetailFragment extends Fragment implements OnClickListener {
|
|||
private void displayHistory(String status, String callTime, String callDate) {
|
||||
time.setText(callTime == null ? "" : callTime);
|
||||
Long longDate = Long.parseLong(callDate);
|
||||
date.setText(LinphoneUtils.timestampToHumanDate(getActivity(),longDate,getString(R.string.history_detail_date_format),false));
|
||||
date.setText(LinphoneUtils.timestampToHumanDate(getActivity(), longDate, getString(R.string.history_detail_date_format), false));
|
||||
|
||||
LinphoneAddress lAddress = null;
|
||||
try {
|
||||
LinphoneAddress lAddress = LinphoneCoreFactory.instance().createLinphoneAddress(sipUri);
|
||||
LinphoneContact contact = ContactsManager.getInstance().findContactFromAddress(lAddress);
|
||||
if (contact != null && contact.isLinphoneFriend() && contact.getFriendPresenceModel() != null) {
|
||||
avatarWithPresenceImage.setLinphoneContact(contact);
|
||||
LinphoneActivity.instance().addPresenceUpdatedListener(avatarWithPresenceImage);
|
||||
}
|
||||
} catch(LinphoneCoreException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
/*LinphoneAddress lAddress = null;
|
||||
try {
|
||||
lAddress = LinphoneCoreFactory.instance().createLinphoneAddress(sipUri);
|
||||
/* Contact contact = ContactsManager.getInstance().findContactWithAddress(getActivity().getContentResolver(), lAddress);
|
||||
Contact contact = ContactsManager.getInstance().findContactWithAddress(getActivity().getContentResolver(), lAddress);
|
||||
|
||||
if (contact != null) {
|
||||
LinphoneUtils.setImagePictureFromUri(view.getContext(),contactPicture,contact.getPhotoUri(),contact.getThumbnailUri());
|
||||
|
|
@ -107,10 +123,10 @@ public class HistoryDetailFragment extends Fragment implements OnClickListener {
|
|||
contactPicture.setImageResource(R.drawable.avatar);
|
||||
view.findViewById(R.id.add_contact).setVisibility(View.VISIBLE);
|
||||
}
|
||||
*/
|
||||
|
||||
} catch (LinphoneCoreException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public void changeDisplayedHistory(String sipUri, String displayName, String pictureUri, String status, String callTime, String callDate) {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import org.linphone.core.LinphoneAddress;
|
|||
import org.linphone.core.LinphoneCallLog;
|
||||
import org.linphone.core.LinphoneCallLog.CallStatus;
|
||||
import org.linphone.core.LinphoneFriend;
|
||||
import org.linphone.ui.AvatarWithPresenceImage;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
|
|
@ -391,6 +392,7 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
|||
holder.select = (CheckBox) view.findViewById(R.id.delete);
|
||||
holder.callDirection = (ImageView) view.findViewById(R.id.icon);
|
||||
holder.contactPicture = (ImageView) view.findViewById(R.id.contact_picture);
|
||||
holder.avatarWithPresenceImage = (AvatarWithPresenceImage) view.findViewById(R.id.avatar_with_presence);
|
||||
}
|
||||
|
||||
final LinphoneCallLog log = mLogs.get(position);
|
||||
|
|
@ -447,6 +449,12 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
|||
*/ holder.contact.setText(LinphoneUtils.getAddressDisplayName(address));
|
||||
// }
|
||||
|
||||
holder.avatarWithPresenceImage.setFormatAvatarImage(AvatarWithPresenceImage.AVATAR_SMALL);
|
||||
if(c != null && c.isLinphoneFriend() && c.getFriendPresenceModel() != null) {
|
||||
holder.avatarWithPresenceImage.setLinphoneContact(c);
|
||||
LinphoneActivity.instance().addPresenceUpdatedListener(holder.avatarWithPresenceImage);
|
||||
}
|
||||
|
||||
if (isEditMode) {
|
||||
holder.select.setVisibility(View.VISIBLE);
|
||||
holder.select.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
|
|
@ -499,5 +507,6 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
|||
CheckBox select;
|
||||
ImageView callDirection;
|
||||
ImageView contactPicture;
|
||||
AvatarWithPresenceImage avatarWithPresenceImage;
|
||||
}
|
||||
}
|
||||
|
|
@ -283,6 +283,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
|
|||
@Override
|
||||
public void notifyPresenceReceived(LinphoneCore lc, LinphoneFriend lf) {
|
||||
for(AvatarWithPresenceImage listener : listeners){
|
||||
Log.e("===>> LinphoneActivity : notifyPresenceReceived : "+lf.getName().toString());
|
||||
if(listener.isThisFriend(lf)){
|
||||
listener.updatePresenceIcon(lc, lf);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -438,7 +438,7 @@ public class LinphoneContact implements Serializable, Comparable<LinphoneContact
|
|||
}
|
||||
|
||||
public boolean compareFriend(LinphoneFriend mFriend){
|
||||
return this.friend == mFriend;
|
||||
return this.friend.equals(mFriend);
|
||||
}
|
||||
|
||||
public static LinphoneContact createContact() {
|
||||
|
|
|
|||
|
|
@ -63,8 +63,13 @@ import org.linphone.core.LinphoneFriendList;
|
|||
import org.linphone.core.LinphoneInfoMessage;
|
||||
import org.linphone.core.LinphoneProxyConfig;
|
||||
import org.linphone.core.PayloadType;
|
||||
import org.linphone.core.PresenceActivity;
|
||||
import org.linphone.core.PresenceActivityType;
|
||||
import org.linphone.core.PresenceBasicStatus;
|
||||
import org.linphone.core.PresenceModel;
|
||||
import org.linphone.core.PresenceNote;
|
||||
import org.linphone.core.PresencePerson;
|
||||
import org.linphone.core.PresenceService;
|
||||
import org.linphone.core.PublishState;
|
||||
import org.linphone.core.SubscriptionState;
|
||||
import org.linphone.core.TunnelConfig;
|
||||
|
|
@ -589,6 +594,10 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
|||
|
||||
mLc = LinphoneCoreFactory.instance().createLinphoneCore(this, mLinphoneConfigFile, mLinphoneFactoryConfigFile, null, c);
|
||||
|
||||
//TODO: server test Presence
|
||||
PresenceModel model = LinphoneCoreFactory.instance().createPresenceModel(PresenceActivityType.TV, null);
|
||||
mLc.setPresenceModel(model);
|
||||
|
||||
TimerTask lTask = new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
|
|
|||
|
|
@ -8,10 +8,13 @@ import android.widget.RelativeLayout;
|
|||
|
||||
import org.linphone.LinphoneActivity;
|
||||
import org.linphone.LinphoneContact;
|
||||
import org.linphone.LinphoneManager;
|
||||
import org.linphone.R;
|
||||
import org.linphone.core.LinphoneCore;
|
||||
import org.linphone.core.LinphoneFriend;
|
||||
import org.linphone.core.OnlineStatus;
|
||||
import org.linphone.core.PresenceActivity;
|
||||
import org.linphone.core.PresenceActivityType;
|
||||
import org.linphone.core.PresenceBasicStatus;
|
||||
import org.linphone.core.PresenceModel;
|
||||
import org.linphone.mediastream.Log;
|
||||
|
|
@ -24,18 +27,50 @@ import org.linphone.mediastream.Log;
|
|||
public class AvatarWithPresenceImage extends RelativeLayout implements onPresenceUpdated {
|
||||
|
||||
private LinphoneContact contact;
|
||||
private ImageView friendStatus;
|
||||
private ImageView friendStatusSmall, contactPictureSmall, friendStatusBig, contactPictureBig;
|
||||
|
||||
public AvatarWithPresenceImage(Context context, AttributeSet attrs) {
|
||||
public static final int AVATAR_SMALL = 0;
|
||||
public static final int AVATAR_BIG = 1;
|
||||
|
||||
public AvatarWithPresenceImage(Context context) {
|
||||
super(context);
|
||||
init();
|
||||
}
|
||||
|
||||
public AvatarWithPresenceImage(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
init();
|
||||
}
|
||||
|
||||
public AvatarWithPresenceImage(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
private void init() {
|
||||
inflate(getContext(), R.layout.avatar_with_presence, this);
|
||||
ImageView friendStatus = (ImageView) this.findViewById(R.id.friendStatus);
|
||||
friendStatus.setImageResource(R.drawable.presence_unregistered);
|
||||
LinphoneActivity.instance().addPresenceUpdatedListener(this);
|
||||
this.inflate(getContext(), R.layout.avatar_with_presence, this);
|
||||
friendStatusSmall = (ImageView) this.findViewById(R.id.friend_status_small);
|
||||
friendStatusSmall.setImageResource(R.drawable.presence_unregistered);
|
||||
contactPictureSmall = (ImageView) this.findViewById(R.id.contact_picture_small);
|
||||
|
||||
friendStatusBig = (ImageView) this.findViewById(R.id.friend_status_big);
|
||||
contactPictureBig = (ImageView) this.findViewById(R.id.contact_picture_big);
|
||||
}
|
||||
|
||||
public void setFormatAvatarImage(int format){
|
||||
if(format == AVATAR_BIG){
|
||||
friendStatusSmall.setVisibility(View.GONE);
|
||||
contactPictureSmall.setVisibility(View.GONE);
|
||||
friendStatusBig.setVisibility(View.VISIBLE);
|
||||
contactPictureBig.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else if(format == AVATAR_SMALL){
|
||||
friendStatusSmall.setVisibility(View.VISIBLE);
|
||||
contactPictureSmall.setVisibility(View.VISIBLE);
|
||||
friendStatusBig.setVisibility(View.GONE);
|
||||
contactPictureBig.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
public void setLinphoneContact(LinphoneContact mContact){
|
||||
|
|
@ -51,23 +86,26 @@ public class AvatarWithPresenceImage extends RelativeLayout implements onPresenc
|
|||
|
||||
if (contact != null) {
|
||||
if (contact.isLinphoneFriend() && contact.getFriendPresenceModel() != null){
|
||||
friendStatusSmall = (ImageView) this.findViewById(R.id.friend_status_small);
|
||||
friendStatusBig = (ImageView) this.findViewById(R.id.friend_status_big);
|
||||
PresenceModel presenceModel = contact.getFriendPresenceModel();
|
||||
PresenceBasicStatus basicStatus = presenceModel.getBasicStatus();
|
||||
String presenceStatus = "";
|
||||
if (basicStatus == PresenceBasicStatus.Open || basicStatus == PresenceBasicStatus.Open)
|
||||
presenceStatus = basicStatus.toString();
|
||||
Log.e("===>>> updateAvatarPresence status = " + presenceStatus + " - vs basicStatus = " + basicStatus);
|
||||
|
||||
if (basicStatus == PresenceBasicStatus.Closed) {
|
||||
friendStatus.setImageResource(R.drawable.presence_unregistered);
|
||||
} else if (presenceStatus == OnlineStatus.Online.toString()) {
|
||||
friendStatus.setImageResource(R.drawable.presence_online);
|
||||
friendStatusSmall.setImageResource(R.drawable.presence_unregistered);
|
||||
friendStatusBig.setImageResource(R.drawable.presence_unregistered);
|
||||
Log.e("===>>> updateAvatarPresence basicStatus == Closed");
|
||||
} else if (presenceModel.getActivity().getType() == PresenceActivityType.TV ) {
|
||||
friendStatusSmall.setImageResource(R.drawable.presence_online);
|
||||
friendStatusBig.setImageResource(R.drawable.presence_online);
|
||||
} else {
|
||||
friendStatus.setImageResource(R.drawable.presence_offline);
|
||||
friendStatusSmall.setImageResource(R.drawable.presence_offline);
|
||||
friendStatusBig.setImageResource(R.drawable.presence_offline);
|
||||
}
|
||||
} else{
|
||||
Log.e("===>>> updateAvatarPresence friend is null ");
|
||||
friendStatus.setImageResource(R.drawable.presence_unregistered);
|
||||
friendStatusSmall.setImageResource(R.drawable.presence_unregistered);
|
||||
friendStatusSmall.setImageResource(R.drawable.presence_unregistered);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue