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
5134e394
Commit
5134e394
authored
Jan 11, 2022
by
Maxime Callet
Browse files
Options
Downloads
Patches
Plain Diff
Call: set video preview container margin
Change-Id: I840eebe6e435fd39cdd795804572a8bc4f08bc3a
parent
ff8c807e
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
ring-android/app/src/main/java/cx/ring/fragments/CallFragment.kt
+12
-6
12 additions, 6 deletions
...droid/app/src/main/java/cx/ring/fragments/CallFragment.kt
with
12 additions
and
6 deletions
ring-android/app/src/main/java/cx/ring/fragments/CallFragment.kt
+
12
−
6
View file @
5134e394
...
@@ -34,6 +34,7 @@ import android.content.Context
...
@@ -34,6 +34,7 @@ import android.content.Context
import
android.content.Intent
import
android.content.Intent
import
android.content.pm.PackageManager
import
android.content.pm.PackageManager
import
android.content.res.Configuration
import
android.content.res.Configuration
import
android.content.res.Resources
import
android.graphics.*
import
android.graphics.*
import
android.graphics.drawable.Drawable
import
android.graphics.drawable.Drawable
import
android.graphics.drawable.Icon
import
android.graphics.drawable.Icon
...
@@ -63,6 +64,7 @@ import androidx.core.view.*
...
@@ -63,6 +64,7 @@ import androidx.core.view.*
import
androidx.databinding.DataBindingUtil
import
androidx.databinding.DataBindingUtil
import
androidx.percentlayout.widget.PercentFrameLayout
import
androidx.percentlayout.widget.PercentFrameLayout
import
com.google.android.material.bottomsheet.BottomSheetBehavior
import
com.google.android.material.bottomsheet.BottomSheetBehavior
import
com.google.zxing.Dimension
import
cx.ring.R
import
cx.ring.R
import
cx.ring.adapters.ConfParticipantAdapter
import
cx.ring.adapters.ConfParticipantAdapter
import
cx.ring.adapters.ConfParticipantAdapter.ConfParticipantSelected
import
cx.ring.adapters.ConfParticipantAdapter.ConfParticipantSelected
...
@@ -181,11 +183,12 @@ class CallFragment : BaseSupportFragment<CallPresenter, CallView>(), CallView,
...
@@ -181,11 +183,12 @@ class CallFragment : BaseSupportFragment<CallPresenter, CallView>(), CallView,
val
windowManager
=
view
.
context
.
getSystemService
(
Context
.
WINDOW_SERVICE
)
as
WindowManager
val
windowManager
=
view
.
context
.
getSystemService
(
Context
.
WINDOW_SERVICE
)
as
WindowManager
mCurrentOrientation
=
windowManager
.
defaultDisplay
.
rotation
mCurrentOrientation
=
windowManager
.
defaultDisplay
.
rotation
val
dpRatio
=
requireActivity
().
resources
.
displayMetrics
.
density
val
dpRatio
=
requireActivity
().
resources
.
displayMetrics
.
density
val
previewContainerMargin
=
resources
.
getDimensionPixelSize
(
R
.
dimen
.
call_preview_margin
)
animation
.
addUpdateListener
{
valueAnimator
->
animation
.
addUpdateListener
{
valueAnimator
->
binding
?.
let
{
binding
->
binding
?.
let
{
binding
->
val
upBy
=
valueAnimator
.
animatedValue
as
Int
val
upBy
=
valueAnimator
.
animatedValue
as
Int
val
layoutParams
=
binding
.
previewContainer
.
layoutParams
as
RelativeLayout
.
LayoutParams
val
layoutParams
=
binding
.
previewContainer
.
layoutParams
as
RelativeLayout
.
LayoutParams
layoutParams
.
setMargins
(
0
,
0
,
0
,
(
upBy
*
dpRatio
).
toInt
())
layoutParams
.
setMargins
(
previewContainerMargin
,
previewContainerMargin
,
previewContainerMargin
,
(
upBy
*
dpRatio
).
toInt
())
binding
.
previewContainer
.
layoutParams
=
layoutParams
binding
.
previewContainer
.
layoutParams
=
layoutParams
}
}
}
}
...
@@ -253,14 +256,10 @@ class CallFragment : BaseSupportFragment<CallPresenter, CallView>(), CallView,
...
@@ -253,14 +256,10 @@ class CallFragment : BaseSupportFragment<CallPresenter, CallView>(), CallView,
binding
.
callSpeakerBtn
.
isChecked
=
presenter
.
isSpeakerphoneOn
binding
.
callSpeakerBtn
.
isChecked
=
presenter
.
isSpeakerphoneOn
binding
.
callMicBtn
.
isChecked
=
presenter
.
isMicrophoneMuted
binding
.
callMicBtn
.
isChecked
=
presenter
.
isMicrophoneMuted
binding
.
pluginPreviewSurface
.
addOnLayoutChangeListener
{
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
->
binding
.
pluginPreviewSurface
.
addOnLayoutChangeListener
{
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
->
configureTransform
(
mPreviewSurfaceWidth
,
mPreviewSurfaceHeight
)
configureTransform
(
mPreviewSurfaceWidth
,
mPreviewSurfaceHeight
)
}
}
binding
.
previewSurface
.
surfaceTextureListener
=
listener
binding
.
previewSurface
.
addOnLayoutChangeListener
{
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
->
configureTransform
(
mPreviewSurfaceWidth
,
mPreviewSurfaceHeight
)
}
binding
.
previewContainer
.
setOnTouchListener
(
previewTouchListener
)
binding
.
pluginPreviewContainer
.
setOnTouchListener
{
v
:
View
,
event
:
MotionEvent
->
binding
.
pluginPreviewContainer
.
setOnTouchListener
{
v
:
View
,
event
:
MotionEvent
->
val
action
=
event
.
actionMasked
val
action
=
event
.
actionMasked
val
parent
=
v
.
parent
as
RelativeLayout
val
parent
=
v
.
parent
as
RelativeLayout
...
@@ -361,6 +360,13 @@ class CallFragment : BaseSupportFragment<CallPresenter, CallView>(), CallView,
...
@@ -361,6 +360,13 @@ class CallFragment : BaseSupportFragment<CallPresenter, CallView>(), CallView,
else
->
false
else
->
false
}
}
}
}
binding
.
previewSurface
.
surfaceTextureListener
=
listener
binding
.
previewSurface
.
addOnLayoutChangeListener
{
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
->
configureTransform
(
mPreviewSurfaceWidth
,
mPreviewSurfaceHeight
)
}
binding
.
previewContainer
.
setOnTouchListener
(
previewTouchListener
)
binding
.
dialpadEditText
.
addTextChangedListener
(
object
:
TextWatcher
{
binding
.
dialpadEditText
.
addTextChangedListener
(
object
:
TextWatcher
{
override
fun
beforeTextChanged
(
s
:
CharSequence
,
start
:
Int
,
count
:
Int
,
after
:
Int
)
{}
override
fun
beforeTextChanged
(
s
:
CharSequence
,
start
:
Int
,
count
:
Int
,
after
:
Int
)
{}
override
fun
onTextChanged
(
s
:
CharSequence
,
start
:
Int
,
before
:
Int
,
count
:
Int
)
{
override
fun
onTextChanged
(
s
:
CharSequence
,
start
:
Int
,
before
:
Int
,
count
:
Int
)
{
...
...
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