merge-requests/745/head
mosazaid 5 years ago
parent 890a356d8c
commit bc661a6f38

@ -43,27 +43,36 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
this.result = result
this.call = call
if (call.method == "openVideoCall") {
val apiKey = call.argument<String>("kApiKey")
val sessionId = call.argument<String>("kSessionId")
val token = call.argument<String>("kToken")
val appLang = call.argument<String>("appLang")
val baseUrl = call.argument<String>("baseUrl")
when (call.method) {
"openVideoCall" -> {
val apiKey = call.argument<String>("kApiKey")
val sessionId = call.argument<String>("kSessionId")
val token = call.argument<String>("kToken")
val appLang = call.argument<String>("appLang")
val baseUrl = call.argument<String>("baseUrl")
// Session Status model
val VC_ID = call.argument<Int>("VC_ID")
val tokenID = call.argument<String>("TokenID")
val generalId = call.argument<String>("generalId")
val doctorId = call.argument<Int>("DoctorId")
val patientName = call.argument<String>("patientName")
// Session Status model
val VC_ID = call.argument<Int>("VC_ID")
val tokenID = call.argument<String>("TokenID")
val generalId = call.argument<String>("generalId")
val doctorId = call.argument<Int>("DoctorId")
val patientName = call.argument<String>("patientName")
val sessionStatusModel = GetSessionStatusModel(VC_ID, tokenID, generalId, doctorId, patientName)
val sessionStatusModel = GetSessionStatusModel(VC_ID, tokenID, generalId, doctorId, patientName)
openVideoCall(apiKey, sessionId, token, appLang, baseUrl, sessionStatusModel)
openVideoCall(apiKey, sessionId, token, appLang, baseUrl, sessionStatusModel)
} else {
result.notImplemented()
}
"closeVideoCall" -> {
dialogFragment?.onCallClicked()
}
"onCallConnected"->{
}
else -> {
result.notImplemented()
}
}
}
@ -94,6 +103,9 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
it.isCancelable = true
it.show(transaction, "dialog")
}
} else if (!dialogFragment!!.isVisible){
val transaction = supportFragmentManager.beginTransaction()
dialogFragment!!.show(transaction, "dialog")
}
}
@ -148,7 +160,8 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
}
override fun errorHandle(message: String) {
Toast.makeText(this, message, Toast.LENGTH_LONG).show()
dialogFragment = null
// Toast.makeText(this, message, Toast.LENGTH_LONG).show()
}

@ -415,7 +415,7 @@ public class VideoCallActivity extends AppCompatActivity implements EasyPermissi
if (mPublisher != null) {
isSwitchCameraClicked = !isSwitchCameraClicked;
mPublisher.cycleCamera();
int res = isSwitchCameraClicked ? R.drawable.flip_disapled : R.drawable.flip_enabled;
int res = isSwitchCameraClicked ? R.drawable.camera_front : R.drawable.camera_back;
mSwitchCameraBtn.setImageResource(res);
}
}

@ -229,7 +229,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
videoCallPresenter = VideoCallPresenterImpl(this, baseUrl)
mCallBtn = view.findViewById<ImageView>(R.id.btn_call)
mCallBtn.setOnClickListener {
onCallClicked(it)
onCallClicked()
}
btnMinimize = view.findViewById<ImageView>(R.id.btn_minimize)
btnMinimize.setOnClickListener {
@ -355,8 +355,8 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
override fun onError(session: Session, opentokError: OpentokError) {
Log.d(TAG, "onError: Error (" + opentokError.message + ") in session " + session.sessionId)
videoCallResponseListener?.errorHandle("onError: Error (" + opentokError.message + ") in session ")
dialog?.dismiss()
videoCallResponseListener?.errorHandle("Error (" + opentokError.message + ") in session ")
// dialog?.dismiss()
}
override fun onStreamReceived(session: Session, stream: Stream) {
@ -393,8 +393,8 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
override fun onError(publisherKit: PublisherKit?, opentokError: OpentokError) {
Log.d(VideoCallFragment.TAG, "onError: Error (" + opentokError.message + ") in publisher")
videoCallResponseListener?.errorHandle("onError: Error (" + opentokError.message + ") in publisher")
dialog?.dismiss()
videoCallResponseListener?.errorHandle("Error (" + opentokError.message + ") in publisher")
// dialog?.dismiss()
}
override fun onVideoDataReceived(subscriberKit: SubscriberKit?) {
@ -465,12 +465,12 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
if (mPublisher != null) {
isSwitchCameraClicked = !isSwitchCameraClicked
mPublisher!!.cycleCamera()
val res = if (isSwitchCameraClicked) R.drawable.flip_disapled else R.drawable.flip_enabled
mSwitchCameraBtn!!.setImageResource(res)
val res = if (isSwitchCameraClicked) R.drawable.camera_front else R.drawable.camera_back
mSwitchCameraBtn.setImageResource(res)
}
}
private fun onCallClicked(view: View?) {
fun onCallClicked() {
disconnectSession()
}
@ -487,6 +487,9 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
)
}
isFullScreen = !isFullScreen
val res = if (isFullScreen) R.drawable.reducing else R.drawable.expand
btnMinimize.setImageResource(res)
setViewsVisibility()
}
@ -518,7 +521,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
layoutName.visibility = View.VISIBLE
mCameraBtn.visibility = View.VISIBLE
mSwitchCameraBtn.visibility = View.VISIBLE
mspeckerBtn.visibility = View.VISIBLE
// mspeckerBtn.visibility = View.VISIBLE
mMicBtn.visibility = View.VISIBLE
mPublisherViewContainer.visibility = View.VISIBLE
@ -539,7 +542,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
layoutName.visibility = View.GONE
mCameraBtn.visibility = View.GONE
mSwitchCameraBtn.visibility = View.GONE
mspeckerBtn.visibility = View.GONE
// mspeckerBtn.visibility = View.GONE
mMicBtn.visibility = View.GONE
mPublisherViewContainer.visibility = View.GONE

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

@ -1,16 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M8,8l-2,0l0,9l11,0l0,-2l-9,0z"/>
<path
android:fillColor="@android:color/white"
android:pathData="M22,3H10v10h12V3zM20,11h-8V7h8V11z"/>
<path
android:fillColor="@android:color/white"
android:pathData="M4,12l-2,0l0,9l11,0l0,-2l-9,0z"/>
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

@ -38,7 +38,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="20sp"
android:textSize="16sp"
android:padding="4dp"
android:textStyle="bold"
tools:text="25:45" />
@ -89,18 +90,6 @@
android:src="@drawable/video_off_fill" />
</FrameLayout>
<ImageView
android:id="@+id/btn_switch_camera"
android:layout_width="@dimen/video_icon_size"
android:layout_height="@dimen/video_icon_size"
android:layout_below="@+id/local_video_view_container"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginTop="@dimen/local_preview_margin_top"
android:layout_marginEnd="@dimen/local_preview_margin_right"
android:scaleType="centerCrop"
android:src="@drawable/flip_enabled" />
</RelativeLayout>
<androidx.constraintlayout.widget.ConstraintLayout
@ -125,7 +114,7 @@
android:layout_width="@dimen/video_icon_size"
android:layout_height="@dimen/video_icon_size"
android:scaleType="centerCrop"
android:src="@drawable/ic_mini"
android:src="@drawable/reducing"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@ -152,6 +141,17 @@
app:layout_constraintStart_toEndOf="@id/btn_camera"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/btn_switch_camera"
android:layout_width="@dimen/video_icon_size"
android:layout_height="@dimen/video_icon_size"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/btn_mic"
android:layout_marginStart="@dimen/padding_space_medium"
app:layout_constraintTop_toTopOf="parent"
android:scaleType="centerCrop"
android:src="@drawable/camera_back" />
<ImageView
android:id="@+id/btn_specker"
android:layout_width="@dimen/video_icon_size"
@ -159,6 +159,7 @@
android:layout_marginStart="@dimen/padding_space_medium"
android:scaleType="centerCrop"
android:src="@drawable/audio_enabled"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/btn_mic"
app:layout_constraintTop_toTopOf="parent" />

@ -29,7 +29,7 @@
<!-- text-->
<dimen name="text_size_small">14sp</dimen>
<dimen name="text_size_medium">16sp</dimen>
<dimen name="text_size_big">24sp</dimen>
<dimen name="text_size_big">22sp</dimen>
<!-- padding/margin-->
<dimen name="padding_space_small">4dp</dimen>

Loading…
Cancel
Save