Commit 53f8b753 authored by Christophe Deschamps's avatar Christophe Deschamps
Browse files

tablet call views


Former-commit-id: d510edb05656d24e903ea6b604bd518a840bf29e
parent e6bed0db
......@@ -74,16 +74,16 @@
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/renderscript_source_output_dir/debug/out" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/kaptKotlin/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/ap_generated_sources/debug/out" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/navigation-args/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/ap_generated_sources/debug/out" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/aidl_source_output_dir/debug/out" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/google-services/debug" type="java-resource" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/kapt/debugAndroidTest" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/kaptKotlin/debugAndroidTest" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/renderscript_source_output_dir/debugAndroidTest/out" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/kapt/debugAndroidTest" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/aidl_source_output_dir/debugAndroidTest/out" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/kaptKotlin/debugAndroidTest" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/ap_generated_sources/debugAndroidTest/out" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/ap_generated_sources/debugUnitTest/out" isTestSource="true" generated="true" />
......@@ -139,9 +139,9 @@
<library name="Gradle: kaptGeneratedClasses">
<CLASSES>
<root url="file://$MODULE_DIR$/build/tmp/kapt3/classes/debugUnitTest" />
<root url="file://$MODULE_DIR$/build/tmp/kapt3/classes/releaseUnitTest" />
<root url="file://$MODULE_DIR$/build/tmp/kapt3/classes/debug" />
<root url="file://$MODULE_DIR$/build/tmp/kapt3/classes/release" />
<root url="file://$MODULE_DIR$/build/tmp/kapt3/classes/debug" />
<root url="file://$MODULE_DIR$/build/tmp/kapt3/classes/releaseUnitTest" />
<root url="file://$MODULE_DIR$/build/tmp/kapt3/classes/debugAndroidTest" />
</CLASSES>
<JAVADOC />
......
package org.lindoor
import android.app.Activity
import android.graphics.Rect
import android.view.MotionEvent
import android.view.View
import android.view.inputmethod.InputMethodManager
import androidx.fragment.app.Fragment
import org.lindoor.ui.toolbar.ToobarButtonClickedListener
import org.lindoor.utils.cdlog
abstract class GenericFragment: Fragment(),
ToobarButtonClickedListener {
......
......@@ -2,10 +2,8 @@ package org.lindoor
import android.Manifest
import android.annotation.SuppressLint
import android.graphics.Rect
import android.os.Bundle
import android.view.*
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.databinding.DataBindingUtil
import androidx.lifecycle.ViewModelProvider
import androidx.navigation.NavController
......@@ -22,7 +20,6 @@ import org.lindoor.ui.tabbar.TabbarViewModel
import org.lindoor.ui.toolbar.ToobarButtonClickedListener
import org.lindoor.ui.toolbar.ToolbarViewModel
import org.lindoor.utils.DialogUtil
import org.lindoor.utils.cdlog
import permissions.dispatcher.NeedsPermission
import permissions.dispatcher.OnNeverAskAgain
import permissions.dispatcher.OnPermissionDenied
......
package org.lindoor.entities
import android.R
import android.graphics.Bitmap
import android.os.Parcelable
import com.bumptech.glide.Glide
import kotlinx.android.parcel.Parcelize
import org.lindoor.LindoorApplication
import org.lindoor.customisation.DeviceTypes
import org.lindoor.customisation.Theme
import org.lindoor.store.StorageManager
import org.lindoor.utils.DialogUtil
import org.lindoor.utils.extensions.existsAndIsNotEmpty
......
package org.lindoor.linphonecore.extensions
import org.lindoor.LindoorApplication.Companion.coreContext
import org.lindoor.entities.HistoryEvent
import org.lindoor.store.HistoryEventStore
import org.linphone.core.*
import org.linphone.core.tools.Log
import org.linphone.core.Call
import org.linphone.core.CallParams
import org.linphone.core.MediaDirection
fun Call.extendedAcceptEarlyMedia() {
......
......@@ -24,7 +24,6 @@ import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.net.Uri
import android.view.TextureView
import android.widget.RemoteViews
......@@ -34,8 +33,6 @@ import androidx.core.content.ContextCompat
import androidx.navigation.NavDeepLinkBuilder
import com.bumptech.glide.Glide
import com.bumptech.glide.request.target.AppWidgetTarget
import com.bumptech.glide.request.target.SimpleTarget
import com.bumptech.glide.request.transition.Transition
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.delay
......@@ -56,7 +53,6 @@ import org.lindoor.ui.call.CallIncomingActivity
import org.lindoor.ui.call.CallOutgoingActivity
import org.lindoor.utils.cdlog
import org.lindoor.utils.extensions.existsAndIsNotEmpty
import org.lindoor.utils.pxFromDp
import org.linphone.compatibility.Compatibility
import org.linphone.core.Call
import org.linphone.core.CallListenerStub
......
......@@ -5,7 +5,6 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import org.lindoor.GenericFragment
import org.lindoor.R
class EmptyFragment : Fragment() {
......
......@@ -3,9 +3,8 @@ package org.lindoor.ui.call
import android.os.Bundle
import android.view.View
import org.lindoor.GenericActivity
import org.lindoor.utils.DialogUtil
import org.linphone.core.Call
import org.lindoor.LindoorApplication.Companion.coreContext
import org.linphone.core.Call
abstract class CallGenericActivity : GenericActivity() {
......
......@@ -15,10 +15,11 @@ import org.lindoor.entities.Device
import org.lindoor.entities.HistoryEvent
import org.lindoor.linphonecore.extensions.*
import org.lindoor.store.DeviceStore
import org.lindoor.store.HistoryEventStore
import org.lindoor.utils.cdlog
import org.lindoor.utils.extensions.existsAndIsNotEmpty
import org.linphone.core.*
import org.linphone.core.AudioDevice
import org.linphone.core.Call
import org.linphone.core.CallListenerStub
import org.linphone.core.Reason
class CallViewModelFactory(private val call: Call) :
......
......@@ -10,7 +10,6 @@ import androidx.databinding.ViewDataBinding
import androidx.lifecycle.ViewModelProvider
import androidx.navigation.fragment.navArgs
import kotlinx.android.synthetic.main.app_bar_main.*
import kotlinx.android.synthetic.main.fragment_assistant_create_lindoor.view.*
import kotlinx.android.synthetic.main.fragment_device_edit.view.*
import kotlinx.android.synthetic.main.item_action_edit.view.*
import kotlinx.android.synthetic.main.widget_round_rect_button.view.*
......@@ -86,8 +85,15 @@ class DeviceEditorFragment : GenericFragment() {
it.binding.root.code.validate()
}
DeviceStore.findDeviceByAddress(model.address.first.value)?.also {
binding.root.address.setError(Texts.get("device_address_already_exists","${it.name}"))
return
if (args.device?.id != it.id) {
binding.root.address.setError(
Texts.get(
"device_address_already_exists",
"${it.name}"
)
)
return
}
}
if (model.saveDevice()) {
mainactivity.navController.navigateUp()
......
......@@ -5,16 +5,11 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.navigation.fragment.navArgs
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.app_bar_main.*
import kotlinx.android.synthetic.main.content_main.*
import kotlinx.android.synthetic.main.fragment_device_info.view.*
import org.lindoor.GenericFragment
import org.lindoor.customisation.Texts
import org.lindoor.customisation.Theme
import org.lindoor.databinding.FragmentDeviceInfoBinding
import org.lindoor.ui.devices.info.DeviceInfoActionsAdapter
class DeviceInfoFragment : GenericFragment() {
......
......@@ -8,7 +8,6 @@ import org.lindoor.linphonecore.extensions.isNew
import org.lindoor.store.DeviceStore
import org.lindoor.store.HistoryEventStore
import org.lindoor.utils.DateUtil
import org.lindoor.utils.cdlog
import org.lindoor.utils.databindings.ViewModelWithTools
import org.linphone.core.Call
import org.linphone.core.CallLog
......
......@@ -14,12 +14,12 @@ import kotlinx.android.synthetic.main.app_bar_main.*
import kotlinx.android.synthetic.main.fragment_history.view.*
import kotlinx.android.synthetic.main.widget_round_rect_button.view.*
import org.lindoor.GenericFragment
import org.lindoor.LindoorApplication.Companion.coreContext
import org.lindoor.customisation.Texts
import org.lindoor.customisation.Theme
import org.lindoor.databinding.FragmentHistoryBinding
import org.lindoor.store.HistoryEventStore
import org.lindoor.utils.DialogUtil
import org.lindoor.LindoorApplication.Companion.coreContext
class HistoryFragment : GenericFragment() {
......
package org.lindoor.ui.widgets
import android.content.Context
import android.graphics.Color
import android.os.FileObserver
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import androidx.databinding.BindingAdapter
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import com.bumptech.glide.signature.ObjectKey
import kotlinx.android.synthetic.main.widget_round_rect_button.view.*
import org.lindoor.R
import org.lindoor.customisation.Theme
import org.lindoor.databinding.WidgetRoundRectButtonWithIconBinding
import org.lindoor.entities.Device
import org.lindoor.utils.extensions.existsAndIsNotEmpty
import org.lindoor.utils.fileObserverWithMainThreadRunnable
......@@ -39,7 +29,7 @@ class LDeviceImageView : androidx.appcompat.widget.AppCompatImageView {
} else {
visibility = View.INVISIBLE
}
addObserver(thumb)
addObserver(value?.thumbNail)
}
}
......@@ -57,7 +47,7 @@ class LDeviceImageView : androidx.appcompat.widget.AppCompatImageView {
.into(this)
post {
scaleType = ImageView.ScaleType.FIT_XY
scaleType = ScaleType.FIT_XY
parent.requestLayout()
}
addObserver(thumb)
......
package org.lindoor.utils
import android.os.FileObserver
import android.widget.Toast
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
......
package org.lindoor.utils.databindings
import android.os.FileObserver
import android.text.TextUtils
import android.view.View
import android.view.ViewGroup
......@@ -15,9 +14,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.load.resource.bitmap.CenterCrop
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.bumptech.glide.signature.ObjectKey
import com.google.android.material.floatingactionbutton.FloatingActionButton
import kotlinx.android.synthetic.main.fragment_device_info.view.*
import kotlinx.android.synthetic.main.widget_round_rect_button.view.root
import kotlinx.android.synthetic.main.widget_round_rect_button_with_icon.view.*
import kotlinx.android.synthetic.main.widget_text_input.view.*
......@@ -29,8 +26,6 @@ import org.lindoor.ui.devices.info.DeviceInfoActionsAdapter
import org.lindoor.ui.settings.SettingListener
import org.lindoor.ui.validators.NonEmptyStringMatcherValidator
import org.lindoor.ui.widgets.*
import org.lindoor.utils.extensions.existsAndIsNotEmpty
import org.lindoor.utils.fileObserverWithMainThreadRunnable
import org.lindoor.utils.pxFromDp
import java.io.File
......
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View" />
<import type="android.widget.RelativeLayout.LayoutParams" />
<variable
name="callmodel"
type="org.lindoor.ui.call.CallViewModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/chunk_call_video_or_icon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:visibility='@{callmodel.videoFullScreen ? View.INVISIBLE : View.VISIBLE, default = "visible"}'>
<ImageView
deviceTypeIconCircle="@{callmodel.device != null &amp;&amp; callmodel.device.type != null ? callmodel.device.type : callmodel.defaultDeviceType}"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintDimensionRatio="H,1:1"
app:layout_constraintWidth_percent="0.4"
android:scaleType="fitXY"
android:visibility='@{callmodel.videoContent ? View.GONE : View.VISIBLE, default = "visible"}'></ImageView>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintDimensionRatio="H,4:3"
app:layout_constraintWidth_percent="0.5"
android:visibility='@{!callmodel.videoContent ? View.GONE : View.VISIBLE, default = "gone"}'>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/videotogglecollapsed"
backgroundeffect='@{"primary_color"}'
icon='@{"icons/fullscreen_start"}'
tint='@{"color_c"}'
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_gravity="end"
android:layout_marginTop="13dp"
android:layout_marginEnd="13dp"
app:fabCustomSize="50dp" />
<TextureView
android:id="@+id/videocollapsed"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="android.view.View" />
<import type="org.linphone.core.Call.State" />
<variable
name="callmodel"
type="org.lindoor.ui.call.CallViewModel" />
</data>
<RelativeLayout
gradientBackground='@{"dark_light_vertical_gradient"}'
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="horizontal">
<TextureView
android:id="@+id/videofullscreen"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility='@{callmodel.videoFullScreen ? View.VISIBLE : View.GONE, default = "gone"}' />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/videotogglefullscreen"
backgroundeffect='@{"primary_color"}'
icon='@{"icons/fullscreen_stop"}'
tint='@{"color_c"}'
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_gravity="end"
android:layout_marginTop="13dp"
android:layout_marginEnd="13dp"
android:visibility='@{callmodel.videoFullScreen ? View.VISIBLE : View.GONE, default = "gone"}'
app:fabCustomSize="50dp" />
<LinearLayout
android:id="@+id/chunk_call_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="54dp"
android:visibility='@{callmodel.videoFullScreen ? View.INVISIBLE : View.VISIBLE, default = "visible"}'>
<include
layout="@layout/chunk_call_top"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<RelativeLayout
android:id="@+id/centerbundle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/chunk_call_top"
android:layout_above="@+id/actions"
android:layout_marginTop="12dp">
<LinearLayout
android:id="@+id/chunk_call_name_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:visibility='@{callmodel.videoFullScreen ? View.INVISIBLE : View.VISIBLE, default = "visible"}'>
<include
layout="@layout/chunk_call_name_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
bind:callmodel="@{callmodel}" />
</LinearLayout>
<LinearLayout
android:id="@+id/chunk_call_video_or_icon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/chunk_call_name_address"
android:layout_marginTop="17dp"
android:gravity="center">
<include
layout="@layout/chunk_call_device_icon_or_video"
android:layout_width="match_parent"
android:layout_height="wrap_content"
bind:callmodel="@{callmodel}" />
</LinearLayout>
<LinearLayout
android:id="@+id/timer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/chunk_call_video_or_icon"
android:layout_marginTop="15dp"
android:gravity="center">
<Chronometer
android:id="@+id/call_timer"
style='@{"view_call_device_address"}'
android:layout_width="320dp"
android:layout_height="wrap_content" />
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:id="@+id/actions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="15dp"
android:orientation="horizontal"
android:gravity="center">
<include
layout="@layout/chunk_call_in_progress_controls"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_weight="1"
bind:callmodel="@{callmodel}" />
<include
layout="@layout/chunk_call_in_progress_actions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_weight="1"
bind:callmodel="@{callmodel}" />
</LinearLayout>
</RelativeLayout>
</layout>
\ No newline at end of file
......@@ -12,23 +12,33 @@
type="org.lindoor.ui.call.CallViewModel" />
</data>
<LinearLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/chunk_call_video_or_icon"
android:layout_width="match_parent"
android:layout_height="222dp"
android:layout_height="wrap_content"
android:gravity="center"
android:visibility='@{callmodel.videoFullScreen ? View.INVISIBLE : View.VISIBLE, default = "visible"}'>
<ImageView
deviceTypeIconCircle="@{callmodel.device != null &amp;&amp; callmodel.device.type != null ? callmodel.device.type : callmodel.defaultDeviceType}"
android:layout_width="187dp"
android:layout_height="187dp"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintDimensionRatio="H,1:1"
app:layout_constraintWidth_percent="0.4"
android:scaleType="fitXY"
android:visibility='@{callmodel.videoContent ? View.GONE : View.VISIBLE, default = "visible"}'></ImageView>
<RelativeLayout
android:layout_width='296dp'
android:layout_height='222dp'
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintDimensionRatio="H,4:3"
app:layout_constraintWidth_percent="0.95"
android:visibility='@{!callmodel.videoContent ? View.GONE : View.VISIBLE, default = "gone"}'>
<com.google.android.material.floatingactionbutton.FloatingActionButton
......@@ -53,7 +63,7 @@
</RelativeLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
......
......@@ -18,11 +18,9 @@
<include
layout="@layout/widget_call_button"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:layout_marginEnd="20dp"
android:layout_weight="1"
android:layout_marginEnd="50dp"
bind:backgroundeffect='@{"decline_call_button"}'
bind:icon='@{"icons/decline"}'
bind:onClick="@{()->callmodel.decline()}"
......@@ -32,11 +30,9 @@
<include
layout="@layout/widget_call_button"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginEnd="30dp"