Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-android
Commits
6c4cedba
Commit
6c4cedba
authored
Dec 11, 2015
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
ui: show call number
Tuleap: #178 Change-Id: I7b7b439333e0cf165b7bbe1a6738b692a1f1e619
parent
dac0f641
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ring-android/app/src/main/java/cx/ring/fragments/CallFragment.java
+24
-36
24 additions, 36 deletions
...oid/app/src/main/java/cx/ring/fragments/CallFragment.java
ring-android/app/src/main/res/layout/frag_call.xml
+21
-5
21 additions, 5 deletions
ring-android/app/src/main/res/layout/frag_call.xml
with
45 additions
and
41 deletions
ring-android/app/src/main/java/cx/ring/fragments/CallFragment.java
+
24
−
36
View file @
6c4cedba
...
@@ -67,6 +67,7 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
...
@@ -67,6 +67,7 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
private
WakeLock
mScreenWakeLock
;
private
WakeLock
mScreenWakeLock
;
private
ImageView
contactBubbleView
;
private
ImageView
contactBubbleView
;
private
TextView
contactBubbleTxt
;
private
TextView
contactBubbleTxt
;
private
TextView
contactBubbleNumTxt
;
private
View
acceptButton
;
private
View
acceptButton
;
private
View
refuseButton
;
private
View
refuseButton
;
private
View
hangupButton
;
private
View
hangupButton
;
...
@@ -147,6 +148,7 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
...
@@ -147,6 +148,7 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
if
(
conf
==
null
)
{
if
(
conf
==
null
)
{
contactBubbleView
.
setImageBitmap
(
null
);
contactBubbleView
.
setImageBitmap
(
null
);
contactBubbleTxt
.
setText
(
""
);
contactBubbleTxt
.
setText
(
""
);
contactBubbleNumTxt
.
setText
(
""
);
acceptButton
.
setVisibility
(
View
.
GONE
);
acceptButton
.
setVisibility
(
View
.
GONE
);
refuseButton
.
setVisibility
(
View
.
GONE
);
refuseButton
.
setVisibility
(
View
.
GONE
);
hangupButton
.
setVisibility
(
View
.
GONE
);
hangupButton
.
setVisibility
(
View
.
GONE
);
...
@@ -370,9 +372,6 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
...
@@ -370,9 +372,6 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
break
;
break
;
case
Activity
.
RESULT_CANCELED
:
case
Activity
.
RESULT_CANCELED
:
default
:
default
:
/*synchronized (mBubbleModel) {
mBubbleModel.clear();
}*/
initNormalStateDisplay
();
initNormalStateDisplay
();
break
;
break
;
}
}
...
@@ -386,28 +385,12 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
...
@@ -386,28 +385,12 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
contactBubbleView
=
(
ImageView
)
rootView
.
findViewById
(
R
.
id
.
contact_bubble
);
contactBubbleView
=
(
ImageView
)
rootView
.
findViewById
(
R
.
id
.
contact_bubble
);
contactBubbleTxt
=
(
TextView
)
rootView
.
findViewById
(
R
.
id
.
contact_bubble_txt
);
contactBubbleTxt
=
(
TextView
)
rootView
.
findViewById
(
R
.
id
.
contact_bubble_txt
);
contactBubbleNumTxt
=
(
TextView
)
rootView
.
findViewById
(
R
.
id
.
contact_bubble_num_txt
);
acceptButton
=
rootView
.
findViewById
(
R
.
id
.
call_accept_btn
);
acceptButton
=
rootView
.
findViewById
(
R
.
id
.
call_accept_btn
);
refuseButton
=
rootView
.
findViewById
(
R
.
id
.
call_refuse_btn
);
refuseButton
=
rootView
.
findViewById
(
R
.
id
.
call_refuse_btn
);
hangupButton
=
rootView
.
findViewById
(
R
.
id
.
call_hangup_btn
);
hangupButton
=
rootView
.
findViewById
(
R
.
id
.
call_hangup_btn
);
mCallStatusTxt
=
(
TextView
)
rootView
.
findViewById
(
R
.
id
.
call_status_txt
);
mCallStatusTxt
=
(
TextView
)
rootView
.
findViewById
(
R
.
id
.
call_status_txt
);
mSecuritySwitch
=
(
ViewSwitcher
)
rootView
.
findViewById
(
R
.
id
.
security_switcher
);
mSecuritySwitch
=
(
ViewSwitcher
)
rootView
.
findViewById
(
R
.
id
.
security_switcher
);
/*mToggleSpeakers = (ToggleButton) rootView.findViewById(R.id.speaker_toggle);
mToggleSpeakers.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
try {
mCallbacks.getRemoteService().toggleSpeakerPhone(isChecked);
} catch (RemoteException e) {
e.printStackTrace();
}
}
});*/
securityIndicator
=
rootView
.
findViewById
(
R
.
id
.
security_indicator
);
securityIndicator
=
rootView
.
findViewById
(
R
.
id
.
security_indicator
);
return
rootView
;
return
rootView
;
}
}
...
@@ -416,6 +399,21 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
...
@@ -416,6 +399,21 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
return
mCallbacks
.
getDisplayedConference
();
return
mCallbacks
.
getDisplayedConference
();
}
}
private
void
initContactDisplay
(
final
SipCall
call
)
{
CallContact
contact
=
call
.
getContact
();
final
String
name
=
contact
.
getDisplayName
();
contactBubbleTxt
.
setText
(
name
);
if
(
call
.
getNumber
().
contentEquals
(
name
))
{
contactBubbleNumTxt
.
setVisibility
(
View
.
GONE
);
}
else
{
contactBubbleNumTxt
.
setVisibility
(
View
.
VISIBLE
);
contactBubbleNumTxt
.
setText
(
call
.
getNumber
());
}
new
ContactPictureTask
(
getActivity
(),
contactBubbleView
,
contact
).
run
();
mCallbacks
.
getSupportActionBar
().
setTitle
(
name
);
}
private
void
initNormalStateDisplay
()
{
private
void
initNormalStateDisplay
()
{
Log
.
i
(
TAG
,
"Start normal display"
);
Log
.
i
(
TAG
,
"Start normal display"
);
mCallbacks
.
startTimer
();
mCallbacks
.
startTimer
();
...
@@ -423,16 +421,15 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
...
@@ -423,16 +421,15 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
refuseButton
.
setVisibility
(
View
.
GONE
);
refuseButton
.
setVisibility
(
View
.
GONE
);
final
SipCall
call
=
getConference
().
getParticipants
().
get
(
0
);
final
SipCall
call
=
getConference
().
getParticipants
().
get
(
0
);
CallContact
contact
=
call
.
getContact
();
final
String
call_id
=
call
.
getCallId
();
new
ContactPictureTask
(
getActivity
(),
contactBubbleView
,
contact
).
run
();
initContactDisplay
(
call
);
contactBubbleTxt
.
setText
(
contact
.
getDisplayName
());
hangupButton
.
setVisibility
(
View
.
VISIBLE
);
hangupButton
.
setVisibility
(
View
.
VISIBLE
);
hangupButton
.
setOnClickListener
(
new
OnClickListener
()
{
hangupButton
.
setOnClickListener
(
new
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
try
{
try
{
mCallbacks
.
getRemoteService
().
hangUp
(
call
.
getCallId
()
);
mCallbacks
.
getRemoteService
().
hangUp
(
call
_id
);
mCallbacks
.
terminateCall
();
mCallbacks
.
terminateCall
();
}
catch
(
RemoteException
e
)
{
}
catch
(
RemoteException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -440,17 +437,14 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
...
@@ -440,17 +437,14 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
}
}
});
});
mCallbacks
.
getSupportActionBar
().
setTitle
(
contact
.
getDisplayName
());
updateSecurityDisplay
();
updateSecurityDisplay
();
}
}
private
void
updateSecurityDisplay
()
{
private
void
updateSecurityDisplay
()
{
//First we check if all participants use a security layer.
//First we check if all participants use a security layer.
boolean
secure_call
=
!
getConference
().
getParticipants
().
isEmpty
();
boolean
secure_call
=
!
getConference
().
getParticipants
().
isEmpty
();
for
(
SipCall
c
:
getConference
().
getParticipants
())
{
for
(
SipCall
c
:
getConference
().
getParticipants
())
//Account acc = mCallbacks.getService().getAccount(c.getAccount());
secure_call
&=
c
instanceof
SecureSipCall
&&
((
SecureSipCall
)
c
).
isSecure
();
secure_call
&=
c
instanceof
SecureSipCall
&&
((
SecureSipCall
)
c
).
isSecure
();
}
securityIndicator
.
setVisibility
(
secure_call
?
View
.
VISIBLE
:
View
.
GONE
);
securityIndicator
.
setVisibility
(
secure_call
?
View
.
VISIBLE
:
View
.
GONE
);
if
(!
secure_call
)
if
(!
secure_call
)
...
@@ -521,9 +515,7 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
...
@@ -521,9 +515,7 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
}
}
}
else
{
}
else
{
final
SipCall
call
=
getConference
().
getParticipants
().
get
(
0
);
final
SipCall
call
=
getConference
().
getParticipants
().
get
(
0
);
CallContact
contact
=
call
.
getContact
();
initContactDisplay
(
call
);
new
ContactPictureTask
(
getActivity
(),
contactBubbleView
,
contact
).
run
();
contactBubbleTxt
.
setText
(
contact
.
getDisplayName
());
acceptButton
.
setVisibility
(
View
.
VISIBLE
);
acceptButton
.
setVisibility
(
View
.
VISIBLE
);
acceptButton
.
setOnClickListener
(
new
OnClickListener
()
{
acceptButton
.
setOnClickListener
(
new
OnClickListener
()
{
@Override
@Override
...
@@ -552,7 +544,6 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
...
@@ -552,7 +544,6 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
}
}
});
});
hangupButton
.
setVisibility
(
View
.
GONE
);
hangupButton
.
setVisibility
(
View
.
GONE
);
mCallbacks
.
getSupportActionBar
().
setTitle
(
contact
.
getDisplayName
());
}
}
}
}
...
@@ -560,9 +551,7 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
...
@@ -560,9 +551,7 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
Log
.
i
(
TAG
,
"Start outgoing display"
);
Log
.
i
(
TAG
,
"Start outgoing display"
);
final
SipCall
call
=
getConference
().
getParticipants
().
get
(
0
);
final
SipCall
call
=
getConference
().
getParticipants
().
get
(
0
);
CallContact
contact
=
call
.
getContact
();
initContactDisplay
(
call
);
new
ContactPictureTask
(
getActivity
(),
contactBubbleView
,
contact
).
run
();
contactBubbleTxt
.
setText
(
contact
.
getDisplayName
());
acceptButton
.
setVisibility
(
View
.
GONE
);
acceptButton
.
setVisibility
(
View
.
GONE
);
refuseButton
.
setVisibility
(
View
.
GONE
);
refuseButton
.
setVisibility
(
View
.
GONE
);
...
@@ -580,7 +569,6 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
...
@@ -580,7 +569,6 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
}
}
});
});
mCallbacks
.
getSupportActionBar
().
setTitle
(
contact
.
getDisplayName
());
}
}
/*
/*
...
...
This diff is collapsed.
Click to expand it.
ring-android/app/src/main/res/layout/frag_call.xml
+
21
−
5
View file @
6c4cedba
...
@@ -18,19 +18,35 @@
...
@@ -18,19 +18,35 @@
android:id=
"@+id/contact_bubble"
android:id=
"@+id/contact_bubble"
android:layout_width=
"200dp"
android:layout_width=
"200dp"
android:layout_height=
"fill_parent"
android:layout_height=
"fill_parent"
android:layout_above=
"@+id/contact_bubble_txt"
android:layout_centerHorizontal=
"true"
android:layout_centerHorizontal=
"true"
android:layout_margin=
"16dp"
/>
android:layout_marginLeft=
"16dp"
android:layout_marginRight=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_above=
"@+id/contact_bubble_txt"
/>
<TextView
<TextView
android:id=
"@+id/contact_bubble_txt"
android:id=
"@+id/contact_bubble_txt"
android:layout_width=
"fill_parent"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:gravity=
"center_horizontal"
android:gravity=
"center_horizontal"
android:textAppearance=
"?android:attr/textAppearanceLarge"
android:textAppearance=
"?android:attr/textAppearanceLarge"
android:textColor=
"@color/text_color_primary"
/>
android:textColor=
"@color/text_color_primary"
android:text=
"Adrien Béraud"
android:layout_above=
"@+id/contact_bubble_num_txt"
android:layout_alignParentLeft=
"true"
android:layout_alignParentStart=
"true"
/>
<TextView
android:id=
"@+id/contact_bubble_num_txt"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:textAppearance=
"?android:attr/textAppearanceMedium"
android:textColor=
"@color/text_color_secondary"
android:text=
"(514) 279-2035"
android:layout_alignParentLeft=
"false"
android:layout_alignParentStart=
"false"
android:layout_alignParentBottom=
"true"
/>
</RelativeLayout>
</RelativeLayout>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment