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
4ecfd81c
Commit
4ecfd81c
authored
Feb 21, 2014
by
Alexandre Lision
Browse files
Options
Downloads
Patches
Plain Diff
ui: Clean up variables
Refs #40232
parent
89ff687c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/org/sflphone/fragments/CallFragment.java
+30
-57
30 additions, 57 deletions
src/org/sflphone/fragments/CallFragment.java
with
30 additions
and
57 deletions
src/org/sflphone/fragments/CallFragment.java
+
30
−
57
View file @
4ecfd81c
...
@@ -51,11 +51,8 @@ import android.view.*;
...
@@ -51,11 +51,8 @@ import android.view.*;
import
android.view.SurfaceHolder.Callback
;
import
android.view.SurfaceHolder.Callback
;
import
android.view.View.OnClickListener
;
import
android.view.View.OnClickListener
;
import
android.view.inputmethod.InputMethodManager
;
import
android.view.inputmethod.InputMethodManager
;
import
android.widget.Button
;
import
android.widget.*
;
import
android.widget.CompoundButton
;
import
android.widget.CompoundButton.OnCheckedChangeListener
;
import
android.widget.CompoundButton.OnCheckedChangeListener
;
import
android.widget.TextView
;
import
android.widget.ToggleButton
;
import
org.sflphone.R
;
import
org.sflphone.R
;
import
org.sflphone.interfaces.CallInterface
;
import
org.sflphone.interfaces.CallInterface
;
import
org.sflphone.model.*
;
import
org.sflphone.model.*
;
...
@@ -72,21 +69,18 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
...
@@ -72,21 +69,18 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
static
final
float
ATTRACTOR_SIZE
=
40
;
static
final
float
ATTRACTOR_SIZE
=
40
;
public
static
final
int
REQUEST_TRANSFER
=
10
;
public
static
final
int
REQUEST_TRANSFER
=
10
;
private
TextView
callStatusTxt
;
private
ToggleButton
speakers
;
private
PowerManager
powerManager
;
// Screen wake lock for incoming call
// Screen wake lock for incoming call
private
WakeLock
w
akeLock
;
private
WakeLock
mScreenW
akeLock
;
private
BubblesView
v
iew
;
private
BubblesView
mBubbleV
iew
;
private
BubbleModel
model
;
private
BubbleModel
model
;
ViewSwitcher
mSecuritySwitch
;
private
TextView
mCallStatusTxt
;
private
ToggleButton
mToggleSpeakers
;
public
Callbacks
mCallbacks
=
sDummyCallbacks
;
public
Callbacks
mCallbacks
=
sDummyCallbacks
;
boolean
accepted
=
false
;
boolean
accepted
=
false
;
private
Bitmap
call_icon
;
TransferDFragment
editName
;
TransferDFragment
editName
;
private
WifiManager
wifiManager
;
private
WifiManager
wifiManager
;
...
@@ -107,16 +101,14 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
...
@@ -107,16 +101,14 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
BUBBLE_SIZE
=
getResources
().
getDimension
(
R
.
dimen
.
bubble_size
);
BUBBLE_SIZE
=
getResources
().
getDimension
(
R
.
dimen
.
bubble_size
);
Log
.
e
(
TAG
,
"BUBBLE_SIZE "
+
BUBBLE_SIZE
);
Log
.
e
(
TAG
,
"BUBBLE_SIZE "
+
BUBBLE_SIZE
);
this
.
setHasOptionsMenu
(
true
);
this
.
setHasOptionsMenu
(
true
);
PowerManager
powerManager
=
(
PowerManager
)
getActivity
().
getSystemService
(
Context
.
POWER_SERVICE
);
powerManager
=
(
PowerManager
)
getActivity
().
getSystemService
(
Context
.
POWER_SERVICE
);
mScreenWakeLock
=
powerManager
.
newWakeLock
(
PowerManager
.
SCREEN_DIM_WAKE_LOCK
|
PowerManager
.
ACQUIRE_CAUSES_WAKEUP
|
PowerManager
.
ON_AFTER_RELEASE
,
wakeLock
=
powerManager
.
newWakeLock
(
PowerManager
.
SCREEN_DIM_WAKE_LOCK
|
PowerManager
.
ACQUIRE_CAUSES_WAKEUP
|
PowerManager
.
ON_AFTER_RELEASE
,
"org.sflphone.onIncomingCall"
);
"org.sflphone.onIncomingCall"
);
wakeLock
.
setReferenceCounted
(
false
);
mScreenWakeLock
.
setReferenceCounted
(
false
);
Log
.
d
(
TAG
,
"Acquire wake up lock"
);
Log
.
d
(
TAG
,
"Acquire wake up lock"
);
if
(
w
akeLock
!=
null
&&
!
w
akeLock
.
isHeld
())
{
if
(
mScreenW
akeLock
!=
null
&&
!
mScreenW
akeLock
.
isHeld
())
{
w
akeLock
.
acquire
();
mScreenW
akeLock
.
acquire
();
}
}
}
}
...
@@ -240,8 +232,8 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
...
@@ -240,8 +232,8 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
public
void
onPause
()
{
public
void
onPause
()
{
super
.
onPause
();
super
.
onPause
();
getActivity
().
unregisterReceiver
(
wifiReceiver
);
getActivity
().
unregisterReceiver
(
wifiReceiver
);
if
(
w
akeLock
!=
null
&&
w
akeLock
.
isHeld
())
{
if
(
mScreenW
akeLock
!=
null
&&
mScreenW
akeLock
.
isHeld
())
{
w
akeLock
.
release
();
mScreenW
akeLock
.
release
();
}
}
}
}
...
@@ -254,14 +246,14 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
...
@@ -254,14 +246,14 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
if
(
getConference
().
isOnGoing
())
{
if
(
getConference
().
isOnGoing
())
{
initNormalStateDisplay
();
initNormalStateDisplay
();
}
else
if
(
getConference
().
isRinging
())
{
}
else
if
(
getConference
().
isRinging
())
{
c
allStatusTxt
.
setText
(
newState
);
mC
allStatusTxt
.
setText
(
newState
);
if
(
getConference
().
isIncoming
())
{
if
(
getConference
().
isIncoming
())
{
initIncomingCallDisplay
();
initIncomingCallDisplay
();
}
else
}
else
initOutGoingCallDisplay
();
initOutGoingCallDisplay
();
}
else
{
}
else
{
c
allStatusTxt
.
setText
(
newState
);
mC
allStatusTxt
.
setText
(
newState
);
mCallbacks
.
terminateCall
();
mCallbacks
.
terminateCall
();
}
}
}
}
...
@@ -283,26 +275,7 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
...
@@ -283,26 +275,7 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
Log
.
i
(
TAG
,
"displaySAS"
);
Log
.
i
(
TAG
,
"displaySAS"
);
mCallbacks
.
updateDisplayedConference
(
updated
);
mCallbacks
.
updateDisplayedConference
(
updated
);
SecureSipCall
display
=
(
SecureSipCall
)
getConference
().
getCallById
(
securedCallID
);
SecureSipCall
display
=
(
SecureSipCall
)
getConference
().
getCallById
(
securedCallID
);
enableZRTP
(
display
);
if
(
display
!=
null
)
{
if
(!
display
.
isConfirmedSAS
())
{
final
Button
sas
=
(
Button
)
getView
().
findViewById
(
R
.
id
.
confirm_sas
);
sas
.
setText
(
"Confirm SAS: "
+
display
.
getSAS
());
sas
.
setVisibility
(
View
.
VISIBLE
);
sas
.
setOnClickListener
(
new
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
try
{
mCallbacks
.
getService
().
confirmSAS
(
securedCallID
);
sas
.
setVisibility
(
View
.
INVISIBLE
);
}
catch
(
RemoteException
e
)
{
e
.
printStackTrace
();
}
}
});
}
}
}
}
@Override
@Override
...
@@ -346,17 +319,17 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
...
@@ -346,17 +319,17 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
final
ViewGroup
rootView
=
(
ViewGroup
)
inflater
.
inflate
(
R
.
layout
.
frag_call
,
container
,
false
);
final
ViewGroup
rootView
=
(
ViewGroup
)
inflater
.
inflate
(
R
.
layout
.
frag_call
,
container
,
false
);
view
=
(
BubblesView
)
rootView
.
findViewById
(
R
.
id
.
main_view
);
mBubbleView
=
(
BubblesView
)
rootView
.
findViewById
(
R
.
id
.
main_view
);
view
.
setFragment
(
this
);
mBubbleView
.
setFragment
(
this
);
view
.
setModel
(
model
);
mBubbleView
.
setModel
(
model
);
view
.
getHolder
().
addCallback
(
this
);
mBubbleView
.
getHolder
().
addCallback
(
this
);
mCallStatusTxt
=
(
TextView
)
rootView
.
findViewById
(
R
.
id
.
call_status_txt
);
callStatusTxt
=
(
TextView
)
rootView
.
findViewById
(
R
.
id
.
call_status_txt
);
call_icon
=
BitmapFactory
.
decodeResource
(
getResources
(),
R
.
drawable
.
ic_action_call
);
s
peakers
=
(
ToggleButton
)
rootView
.
findViewById
(
R
.
id
.
speaker_toggle
);
mToggleS
peakers
=
(
ToggleButton
)
rootView
.
findViewById
(
R
.
id
.
speaker_toggle
);
s
peakers
.
setOnCheckedChangeListener
(
new
OnCheckedChangeListener
()
{
mToggleS
peakers
.
setOnCheckedChangeListener
(
new
OnCheckedChangeListener
()
{
@Override
@Override
public
void
onCheckedChanged
(
CompoundButton
buttonView
,
boolean
isChecked
)
{
public
void
onCheckedChanged
(
CompoundButton
buttonView
,
boolean
isChecked
)
{
...
@@ -437,7 +410,7 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
...
@@ -437,7 +410,7 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
int
radiusCalls
=
(
int
)
(
model
.
width
/
2
-
BUBBLE_SIZE
);
int
radiusCalls
=
(
int
)
(
model
.
width
/
2
-
BUBBLE_SIZE
);
getBubbleForUser
(
getConference
(),
model
.
width
/
2
,
model
.
height
/
2
+
radiusCalls
);
getBubbleForUser
(
getConference
(),
model
.
width
/
2
,
model
.
height
/
2
+
radiusCalls
);
getBubbleFor
(
getConference
().
getParticipants
().
get
(
0
),
model
.
width
/
2
,
model
.
height
/
2
-
radiusCalls
);
getBubbleFor
(
getConference
().
getParticipants
().
get
(
0
),
model
.
width
/
2
,
model
.
height
/
2
-
radiusCalls
);
Bitmap
call_icon
=
BitmapFactory
.
decodeResource
(
getResources
(),
R
.
drawable
.
ic_action_call
);
model
.
clearAttractors
();
model
.
clearAttractors
();
model
.
addAttractor
(
new
Attractor
(
new
PointF
(
model
.
width
/
2
,
model
.
height
/
2
),
ATTRACTOR_SIZE
,
new
Attractor
.
Callback
()
{
model
.
addAttractor
(
new
Attractor
(
new
PointF
(
model
.
width
/
2
,
model
.
height
/
2
),
ATTRACTOR_SIZE
,
new
Attractor
.
Callback
()
{
@Override
@Override
...
@@ -527,7 +500,7 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
...
@@ -527,7 +500,7 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
}
}
public
boolean
draggingBubble
()
{
public
boolean
draggingBubble
()
{
return
v
iew
==
null
?
false
:
v
iew
.
isDraggingBubble
();
return
mBubbleV
iew
==
null
?
false
:
mBubbleV
iew
.
isDraggingBubble
();
}
}
@Override
@Override
...
@@ -571,14 +544,14 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
...
@@ -571,14 +544,14 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
public
void
surfaceDestroyed
(
SurfaceHolder
holder
)
{
public
void
surfaceDestroyed
(
SurfaceHolder
holder
)
{
// check that soft input is hidden
// check that soft input is hidden
InputMethodManager
lManager
=
(
InputMethodManager
)
getActivity
().
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
);
InputMethodManager
lManager
=
(
InputMethodManager
)
getActivity
().
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
);
lManager
.
hideSoftInputFromWindow
(
v
iew
.
getWindowToken
(),
0
);
lManager
.
hideSoftInputFromWindow
(
mBubbleV
iew
.
getWindowToken
(),
0
);
if
(
editName
!=
null
&&
editName
.
isVisible
())
{
if
(
editName
!=
null
&&
editName
.
isVisible
())
{
editName
.
dismiss
();
editName
.
dismiss
();
}
}
}
}
public
BubblesView
getBubbleView
()
{
public
BubblesView
getBubbleView
()
{
return
v
iew
;
return
mBubbleV
iew
;
}
}
public
void
updateTime
()
{
public
void
updateTime
()
{
...
@@ -586,7 +559,7 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
...
@@ -586,7 +559,7 @@ public class CallFragment extends CallableWrapperFragment implements CallInterfa
long
duration
=
System
.
currentTimeMillis
()
-
getConference
().
getParticipants
().
get
(
0
).
getTimestampStart_
();
long
duration
=
System
.
currentTimeMillis
()
-
getConference
().
getParticipants
().
get
(
0
).
getTimestampStart_
();
duration
=
duration
/
1000
;
duration
=
duration
/
1000
;
if
(
getConference
().
isOnGoing
())
if
(
getConference
().
isOnGoing
())
c
allStatusTxt
.
setText
(
String
.
format
(
"%d:%02d:%02d"
,
duration
/
3600
,
duration
%
3600
/
60
,
duration
%
60
));
mC
allStatusTxt
.
setText
(
String
.
format
(
"%d:%02d:%02d"
,
duration
/
3600
,
duration
%
3600
/
60
,
duration
%
60
));
}
}
}
}
...
...
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