video fix bugs

merge-requests/745/head
mosazaid 3 years ago
parent 7614b4aa5c
commit edca552f78

@ -16,6 +16,7 @@ import android.view.*
import android.widget.*
import androidx.annotation.Nullable
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import androidx.core.view.GestureDetectorCompat
import androidx.fragment.app.DialogFragment
import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel
@ -39,6 +40,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
SubscriberKit.VideoListener, VideoCallView {
private var isFullScreen: Boolean = true
private var isCircle: Boolean = false
private var x_init_cord = 0
private var y_init_cord: Int = 0
private var x_init_margin: Int = 0
@ -78,6 +80,8 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
private lateinit var parentView: View
private lateinit var videoCallContainer: ConstraintLayout
private lateinit var layoutName: RelativeLayout
private lateinit var layoutMini: RelativeLayout
private lateinit var icMini: ImageButton
private lateinit var mCallBtn: ImageView
private lateinit var btnMinimize: ImageView
private lateinit var mCameraBtn: ImageView
@ -179,7 +183,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
requestPermissions()
handleDragDialog()
mDetector = GestureDetectorCompat(context, MyGestureListener { showControlPanelTemporarily() })
mDetector = GestureDetectorCompat(context, MyGestureListener({ showControlPanelTemporarily() }, { miniCircleDoubleTap() }))
return parentView
}
@ -214,6 +218,8 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
private fun initUI(view: View) {
videoCallContainer = view.findViewById(R.id.video_call_ll)
layoutName = view.findViewById(R.id.layout_name)
layoutMini = view.findViewById(R.id.layout_mini)
icMini = view.findViewById(R.id.ic_mini)
mPublisherViewContainer = view.findViewById(R.id.local_video_view_container)
mPublisherViewIcon = view.findViewById(R.id.local_video_view_icon)
mSubscriberViewIcon = view.findViewById(R.id.remote_video_view_icon)
@ -240,6 +246,10 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
Log.d(VideoCallFragment.TAG, "onChronometerTick: $minutes : $seconds")
}
icMini.setOnClickListener {
onMiniCircleClicked()
}
controlPanel = view.findViewById(R.id.control_panel)
videoCallPresenter = VideoCallPresenterImpl(this, baseUrl)
mCallBtn = view.findViewById<ImageView>(R.id.btn_call)
@ -478,6 +488,39 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
disconnectSession()
}
private fun miniCircleDoubleTap(){
if (isCircle){
onMiniCircleClicked()
}
}
private fun onMiniCircleClicked(){
if (isCircle) {
dialog?.window?.setLayout(
400,
600
)
videoCallContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.text_color))
mSubscriberViewContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.remoteBackground))
} else {
dialog?.window?.setLayout(
200,
200
)
videoCallContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape)
mSubscriberViewContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape)
}
isCircle = !isCircle
if(isCircle){
controlPanel?.visibility = View.GONE
layoutMini.visibility = View.GONE
} else {
controlPanel?.visibility = View.VISIBLE
layoutMini.visibility = View.VISIBLE
}
}
private fun onMinimizedClicked(view: View?) {
if (isFullScreen) {
dialog?.window?.setLayout(
@ -522,6 +565,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
if (isFullScreen) {
layoutName.visibility = View.VISIBLE
layoutMini.visibility = View.GONE
mCameraBtn.visibility = View.VISIBLE
mSwitchCameraBtn.visibility = View.VISIBLE
// mspeckerBtn.visibility = View.VISIBLE
@ -541,6 +585,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
remotePreviewLayoutParam.height = remotePreviewIconSize
} else {
layoutName.visibility = View.GONE
layoutMini.visibility = View.VISIBLE
mCameraBtn.visibility = View.GONE
mSwitchCameraBtn.visibility = View.GONE
// mspeckerBtn.visibility = View.GONE
@ -565,6 +610,14 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
// remotePreviewLayoutParam = FrameLayout.LayoutParams(remotePreviewIconSizeSmall, remotePreviewIconSizeSmall)
remotePreviewLayoutParam.width = remotePreviewIconSizeSmall
remotePreviewLayoutParam.height = remotePreviewIconSizeSmall
if(isCircle){
controlPanel?.visibility = View.GONE
layoutMini.visibility = View.GONE
} else {
controlPanel?.visibility = View.VISIBLE
layoutMini.visibility = View.VISIBLE
}
}
mPublisherViewContainer.layoutParams = localPreviewLayoutParam
@ -753,13 +806,18 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
).toInt()
}
private class MyGestureListener(val onTabCall: () -> Unit) : GestureDetector.SimpleOnGestureListener() {
private class MyGestureListener(val onTabCall: () -> Unit, val miniCircleDoubleTap: () -> Unit) : GestureDetector.SimpleOnGestureListener() {
override fun onSingleTapConfirmed(event: MotionEvent): Boolean {
onTabCall()
return true
}
override fun onDoubleTap(e: MotionEvent?): Boolean {
miniCircleDoubleTap()
return super.onDoubleTap(e)
}
}
companion object {

@ -3,10 +3,10 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<!-- <solid-->
<!-- android:color="#666666"/>-->
<solid
android:color="@color/remoteBackground"/>
<stroke android:width="2dp" android:color="@color/white" />
<stroke android:width="2dp" android:color="@color/text_color" />
<size
android:width="120dp"

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M6,19h12v2H6z"/>
</vector>

@ -47,12 +47,32 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/layout_mini"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@color/transparent"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/layout_name"
>
<ImageButton
android:id="@+id/ic_mini"
style="@style/Widget.MaterialComponents.Button.Icon"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_mini"
android:background="@null" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/activity_clingo_video_call"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@id/control_panel"
app:layout_constraintTop_toBottomOf="@+id/layout_name"
app:layout_constraintTop_toBottomOf="@+id/layout_mini"
tools:context=".ui.VideoCallActivity">

@ -5,6 +5,10 @@
<color name="colorAccent">#fc3850</color>
<color name="colorProgressBarBackground">#e4e9f2</color>
<color name="transparent">#80757575</color>
<color name="transparent_full_opacity">#00ffffff</color>
<!-- Chat Activity -->
<color name="localBackground">#827b92</color>
<color name="remoteBackground">#484258</color>

@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";

@ -27,9 +27,9 @@ class VideoCallService extends BaseService{
this.patient = patientModel;
DoctorProfileModel doctorProfile = await getDoctorProfile(isGetProfile: true);
await VideoChannel.openVideoCallScreen(
kToken: startCallRes.openTokenID,
kSessionId: startCallRes.openSessionID,
kApiKey: '46209962',//'46209962',
kToken:"T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==", //startCallRes.openTokenID,
kSessionId: "1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg",//startCallRes.openSessionID,
kApiKey:'47247954',// '46209962',
vcId: patient.vcId,
patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"),
tokenID: await sharedPref.getString(TOKEN),

Loading…
Cancel
Save