Merge branch 'development' into 'master'
Development See merge request Cloud_Solution/doctor_app_flutter!142merge-requests/145/merge
@ -1,32 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.example.doctor_app_flutter">
|
||||
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
|
||||
<!--
|
||||
io.flutter.app.FlutterApplication is an android.app.Application that
|
||||
calls FlutterMain.startInitialization(this); in its onCreate method.
|
||||
In most cases you can leave this as-is, but you if you want to provide
|
||||
additional functionality it is fine to subclass or reimplement
|
||||
FlutterApplication and put your custom class here. -->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
FlutterApplication and put your custom class here.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<application
|
||||
android:name="io.flutter.app.FlutterApplication"
|
||||
android:label="doctor_app_flutter"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="doctor_app_flutter">
|
||||
<activity android:name=".VideoCallActivity"></activity>
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:hardwareAccelerated="true"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!-- Don't delete the meta-data below.
|
||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||
<!--
|
||||
Don't delete the meta-data below.
|
||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java
|
||||
-->
|
||||
<meta-data
|
||||
android:name="flutterEmbedding"
|
||||
android:value="2" />
|
||||
</application>
|
||||
</manifest>
|
||||
|
||||
</manifest>
|
||||
@ -0,0 +1,390 @@
|
||||
package com.example.doctor_app_flutter;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Color;
|
||||
import android.opengl.GLSurfaceView;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.opentok.android.Session;
|
||||
import com.opentok.android.Stream;
|
||||
import com.opentok.android.Publisher;
|
||||
import com.opentok.android.PublisherKit;
|
||||
import com.opentok.android.Subscriber;
|
||||
import com.opentok.android.BaseVideoRenderer;
|
||||
import com.opentok.android.OpentokError;
|
||||
import com.opentok.android.SubscriberKit;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import pub.devrel.easypermissions.AfterPermissionGranted;
|
||||
import pub.devrel.easypermissions.AppSettingsDialog;
|
||||
import pub.devrel.easypermissions.EasyPermissions;
|
||||
|
||||
public class VideoCallActivity extends AppCompatActivity implements EasyPermissions.PermissionCallbacks,
|
||||
Session.SessionListener,
|
||||
Publisher.PublisherListener,
|
||||
Subscriber.VideoListener {
|
||||
|
||||
|
||||
private static final String TAG = VideoCallActivity.class.getSimpleName();
|
||||
|
||||
private static final int RC_SETTINGS_SCREEN_PERM = 123;
|
||||
private static final int RC_VIDEO_APP_PERM = 124;
|
||||
|
||||
private Session mSession;
|
||||
private Publisher mPublisher;
|
||||
private Subscriber mSubscriber;
|
||||
|
||||
private Handler mVolHandler;
|
||||
private Runnable mVolRunnable;
|
||||
|
||||
private FrameLayout mPublisherViewContainer;
|
||||
private RelativeLayout mSubscriberViewContainer;
|
||||
private RelativeLayout controlPanel;
|
||||
|
||||
private String apiKey;
|
||||
private String sessionId;
|
||||
private String token;
|
||||
private String callDuration;
|
||||
private String warningDuration;
|
||||
private String appLang;
|
||||
|
||||
private boolean isSwitchCameraClicked;
|
||||
private boolean isCameraClicked;
|
||||
private boolean isSpeckerClicked;
|
||||
private boolean isMicClicked;
|
||||
|
||||
private ImageView mCallBtn;
|
||||
private ImageView mCameraBtn;
|
||||
private ImageView mSwitchCameraBtn;
|
||||
private ImageView mspeckerBtn;
|
||||
private ImageView mMicBtn;
|
||||
|
||||
private ProgressBar progressBar;
|
||||
private CountDownTimer countDownTimer;
|
||||
private TextView progressBarTextView;
|
||||
private RelativeLayout progressBarLayout;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
setTheme(R.style.AppTheme);
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_video_call);
|
||||
Objects.requireNonNull(getSupportActionBar()).hide();
|
||||
initUI();
|
||||
requestPermissions();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
|
||||
if (mSession == null) {
|
||||
return;
|
||||
}
|
||||
mSession.onPause();
|
||||
|
||||
if (isFinishing()) {
|
||||
disconnectSession();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
if (mSession == null) {
|
||||
return;
|
||||
}
|
||||
mSession.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
disconnectSession();
|
||||
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
private void initUI() {
|
||||
mPublisherViewContainer = (FrameLayout) findViewById(R.id.local_video_view_container);
|
||||
mSubscriberViewContainer = (RelativeLayout) findViewById(R.id.remote_video_view_container);
|
||||
|
||||
apiKey = getIntent().getStringExtra("apiKey");
|
||||
sessionId = getIntent().getStringExtra("sessionId");
|
||||
token = getIntent().getStringExtra("token");
|
||||
// callDuration = getIntent().getStringExtra("callDuration");
|
||||
// warningDuration = getIntent().getStringExtra("warningDuration");
|
||||
appLang=getIntent().getStringExtra("appLang");
|
||||
|
||||
controlPanel=findViewById(R.id.control_panel);
|
||||
|
||||
mCallBtn = findViewById(R.id.btn_call);
|
||||
mCameraBtn = findViewById(R.id.btn_camera);
|
||||
mSwitchCameraBtn = findViewById(R.id.btn_switch_camera);
|
||||
mspeckerBtn = findViewById(R.id.btn_specker);
|
||||
mMicBtn = findViewById(R.id.btn_mic);
|
||||
|
||||
// progressBarLayout=findViewById(R.id.progressBar);
|
||||
// progressBar=findViewById(R.id.progress_bar);
|
||||
// progressBarTextView=findViewById(R.id.progress_bar_text);
|
||||
// progressBar.setVisibility(View.GONE);
|
||||
|
||||
hiddenButtons();
|
||||
|
||||
mSubscriberViewContainer.setOnTouchListener((v, event) -> {
|
||||
controlPanel.setVisibility(View.VISIBLE);
|
||||
mVolHandler.removeCallbacks(mVolRunnable);
|
||||
mVolHandler.postDelayed(mVolRunnable, 5*1000);
|
||||
return true;
|
||||
});
|
||||
|
||||
if (appLang.equals("ar")) {
|
||||
progressBarLayout.setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void hiddenButtons(){
|
||||
mVolHandler = new Handler();
|
||||
mVolRunnable = new Runnable() {
|
||||
public void run() {
|
||||
controlPanel.setVisibility(View.GONE);
|
||||
}
|
||||
};
|
||||
mVolHandler.postDelayed(mVolRunnable,5*1000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
|
||||
EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPermissionsGranted(int requestCode, List<String> perms) {
|
||||
Log.d(TAG, "onPermissionsGranted:" + requestCode + ":" + perms.size());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPermissionsDenied(int requestCode, List<String> perms) {
|
||||
Log.d(TAG, "onPermissionsDenied:" + requestCode + ":" + perms.size());
|
||||
|
||||
if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
|
||||
new AppSettingsDialog.Builder(this)
|
||||
.setTitle(getString(R.string.title_settings_dialog))
|
||||
.setRationale(getString(R.string.rationale_ask_again))
|
||||
.setPositiveButton(getString(R.string.setting))
|
||||
.setNegativeButton(getString(R.string.cancel))
|
||||
.setRequestCode(RC_SETTINGS_SCREEN_PERM)
|
||||
.build()
|
||||
.show();
|
||||
}
|
||||
}
|
||||
|
||||
@AfterPermissionGranted(RC_VIDEO_APP_PERM)
|
||||
private void requestPermissions() {
|
||||
String[] perms = {Manifest.permission.INTERNET, Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO};
|
||||
if (EasyPermissions.hasPermissions(this, perms)) {
|
||||
mSession = new Session.Builder(VideoCallActivity.this, apiKey, sessionId).build();
|
||||
mSession.setSessionListener(this);
|
||||
mSession.connect(token);
|
||||
} else {
|
||||
EasyPermissions.requestPermissions(this, getString(R.string.remaining_ar), RC_VIDEO_APP_PERM, perms);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnected(Session session) {
|
||||
Log.i(TAG, "Session Connected");
|
||||
|
||||
mPublisher = new Publisher.Builder(this).build();
|
||||
mPublisher.setPublisherListener(this);
|
||||
|
||||
mPublisherViewContainer.addView(mPublisher.getView());
|
||||
|
||||
if (mPublisher.getView() instanceof GLSurfaceView){
|
||||
((GLSurfaceView) mPublisher.getView()).setZOrderOnTop(true);
|
||||
}
|
||||
|
||||
mSession.publish(mPublisher);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisconnected(Session session) {
|
||||
Log.d(TAG, "onDisconnected: disconnected from session " + session.getSessionId());
|
||||
|
||||
mSession = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Session session, OpentokError opentokError) {
|
||||
Log.d(TAG, "onError: Error (" + opentokError.getMessage() + ") in session " + session.getSessionId());
|
||||
|
||||
Toast.makeText(this, "Session error. See the logcat please.", Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStreamReceived(Session session, Stream stream) {
|
||||
Log.d(TAG, "onStreamReceived: New stream " + stream.getStreamId() + " in session " + session.getSessionId());
|
||||
|
||||
if (mSubscriber != null) {
|
||||
return;
|
||||
}
|
||||
subscribeToStream(stream);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStreamDropped(Session session, Stream stream) {
|
||||
Log.d(TAG, "onStreamDropped: Stream " + stream.getStreamId() + " dropped from session " + session.getSessionId());
|
||||
|
||||
if (mSubscriber == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mSubscriber.getStream().equals(stream)) {
|
||||
mSubscriberViewContainer.removeView(mSubscriber.getView());
|
||||
mSubscriber.destroy();
|
||||
mSubscriber = null;
|
||||
}
|
||||
disconnectSession();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStreamCreated(PublisherKit publisherKit, Stream stream) {
|
||||
Log.d(TAG, "onStreamCreated: Own stream " + stream.getStreamId() + " created");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStreamDestroyed(PublisherKit publisherKit, Stream stream) {
|
||||
Log.d(TAG, "onStreamDestroyed: Own stream " + stream.getStreamId() + " destroyed");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(PublisherKit publisherKit, OpentokError opentokError) {
|
||||
Log.d(TAG, "onError: Error (" + opentokError.getMessage() + ") in publisher");
|
||||
|
||||
Toast.makeText(this, "Session error. See the logcat please.", Toast.LENGTH_LONG).show();
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoDataReceived(SubscriberKit subscriberKit) {
|
||||
mSubscriber.setStyle(BaseVideoRenderer.STYLE_VIDEO_SCALE, BaseVideoRenderer.STYLE_VIDEO_FILL);
|
||||
mSubscriberViewContainer.addView(mSubscriber.getView());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoDisabled(SubscriberKit subscriberKit, String s) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoEnabled(SubscriberKit subscriberKit, String s) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoDisableWarning(SubscriberKit subscriberKit) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoDisableWarningLifted(SubscriberKit subscriberKit) {
|
||||
|
||||
}
|
||||
|
||||
private void subscribeToStream(Stream stream) {
|
||||
mSubscriber = new Subscriber.Builder(VideoCallActivity.this, stream).build();
|
||||
mSubscriber.setVideoListener(this);
|
||||
mSession.subscribe(mSubscriber);
|
||||
}
|
||||
|
||||
private void disconnectSession() {
|
||||
if (mSession == null) {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
if (mSubscriber != null) {
|
||||
mSubscriberViewContainer.removeView(mSubscriber.getView());
|
||||
mSession.unsubscribe(mSubscriber);
|
||||
mSubscriber.destroy();
|
||||
mSubscriber = null;
|
||||
}
|
||||
|
||||
if (mPublisher != null) {
|
||||
mPublisherViewContainer.removeView(mPublisher.getView());
|
||||
mSession.unpublish(mPublisher);
|
||||
mPublisher.destroy();
|
||||
mPublisher = null;
|
||||
}
|
||||
mSession.disconnect();
|
||||
if(countDownTimer!=null) {
|
||||
countDownTimer.cancel();
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
public void onSwitchCameraClicked(View view) {
|
||||
if (mPublisher != null) {
|
||||
isSwitchCameraClicked = !isSwitchCameraClicked;
|
||||
mPublisher.cycleCamera();
|
||||
int res = isSwitchCameraClicked ? R.drawable.flip_disapled : R.drawable.flip_enabled;
|
||||
mSwitchCameraBtn.setImageResource(res);
|
||||
}
|
||||
}
|
||||
|
||||
public void onCameraClicked(View view) {
|
||||
if (mPublisher != null) {
|
||||
isCameraClicked = !isCameraClicked;
|
||||
mPublisher.setPublishVideo(!isCameraClicked);
|
||||
int res = isCameraClicked ? R.drawable.video_disanabled : R.drawable.video_enabled;
|
||||
mCameraBtn.setImageResource(res);
|
||||
}
|
||||
}
|
||||
|
||||
public void onSpeckerClicked(View view) {
|
||||
if (mSubscriber != null) {
|
||||
isSpeckerClicked = !isSpeckerClicked;
|
||||
mSubscriber.setSubscribeToAudio(!isSpeckerClicked);
|
||||
int res = isSpeckerClicked ? R.drawable.audio_disabled : R.drawable.audio_enabled;
|
||||
mspeckerBtn.setImageResource(res);
|
||||
}
|
||||
}
|
||||
public void onMicClicked(View view) {
|
||||
if (mPublisher != null) {
|
||||
isMicClicked = !isMicClicked;
|
||||
mPublisher.setPublishAudio(!isMicClicked);
|
||||
int res = isMicClicked ? R.drawable.mic_disabled : R.drawable.mic_enabled;
|
||||
mMicBtn.setImageResource(res);
|
||||
}
|
||||
}
|
||||
|
||||
public void onCallClicked(View view) {
|
||||
disconnectSession();
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,45 @@
|
||||
package com.example.doctor_app_flutter
|
||||
|
||||
import android.content.Intent
|
||||
import androidx.annotation.NonNull;
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
import io.flutter.embedding.engine.FlutterEngine
|
||||
import io.flutter.plugins.GeneratedPluginRegistrant
|
||||
import io.flutter.embedding.android.FlutterFragmentActivity
|
||||
import io.flutter.plugin.common.MethodChannel
|
||||
|
||||
class MainActivity: FlutterFragmentActivity() {
|
||||
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
|
||||
GeneratedPluginRegistrant.registerWith(flutterEngine);
|
||||
|
||||
private val CHANNEL = "Dr.cloudSolution/videoCall"
|
||||
|
||||
|
||||
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
|
||||
GeneratedPluginRegistrant.registerWith(flutterEngine)
|
||||
|
||||
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler {
|
||||
call, result ->
|
||||
if (call.method == "openVideoCall") {
|
||||
val apiKey = call.argument<String>("kApiKey")
|
||||
val sessionId = call.argument<String>("kSessionId")
|
||||
val token = call.argument<String>("kToken")
|
||||
// val callDuration = call.argument<String>("callDuration")
|
||||
// val warningDuration = call.argument<String>("warningDuration")
|
||||
val appLang = call.argument<String>("appLang")
|
||||
openVideoCall(apiKey,sessionId,token/*,callDuration,warningDuration*/,appLang)
|
||||
} else {
|
||||
result.notImplemented()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun openVideoCall(apiKey: String?, sessionId: String?, token: String?/*, callDuration: String?, warningDuration: String?*/, appLang: String?) {
|
||||
val intent = Intent(this, VideoCallActivity::class.java)
|
||||
intent.putExtra("apiKey", apiKey)
|
||||
intent.putExtra("sessionId", sessionId)
|
||||
intent.putExtra("token", token)
|
||||
// intent.putExtra("callDuration", callDuration)
|
||||
//intent.putExtra("warningDuration", warningDuration)
|
||||
intent.putExtra("appLang", appLang)
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
@ -0,0 +1,169 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/activity_clingo_video_call"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".VideoCallActivity">
|
||||
<RelativeLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:keepScreenOn="true"
|
||||
android:clickable="true">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/subscriberview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:orientation="horizontal"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/publisherview"
|
||||
android:layout_height="200dp"
|
||||
android:layout_width="150dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin" />
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/remote_video_view_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/remoteBackground">
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@id/icon_padding">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/remote_back_icon_size"
|
||||
android:layout_height="@dimen/remote_back_icon_size"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@drawable/video_off_fill" />
|
||||
</RelativeLayout>
|
||||
<RelativeLayout
|
||||
android:id="@+id/icon_padding"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/remote_back_icon_margin_bottom"
|
||||
android:layout_alignParentBottom="true"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/local_video_view_container"
|
||||
android:layout_width="@dimen/local_preview_width"
|
||||
android:layout_height="@dimen/local_preview_height"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginEnd="@dimen/local_preview_margin_right"
|
||||
android:layout_marginRight="@dimen/local_preview_margin_right"
|
||||
android:layout_marginTop="@dimen/local_preview_margin_top"
|
||||
android:background="@color/localBackground">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/local_back_icon_size"
|
||||
android:layout_height="@dimen/local_back_icon_size"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/video_off_fill" />
|
||||
</FrameLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/control_panel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="60dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_call"
|
||||
android:layout_width="71dp"
|
||||
android:layout_height="71dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:onClick="onCallClicked"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/call" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_switch_camera"
|
||||
android:layout_width="39dp"
|
||||
android:layout_height="39dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="@dimen/control_bottom_horizontal_margin"
|
||||
android:layout_toEndOf="@id/btn_camera"
|
||||
android:layout_toRightOf="@id/btn_camera"
|
||||
android:onClick="onSwitchCameraClicked"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/flip_enabled" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_camera"
|
||||
android:layout_width="39dp"
|
||||
android:layout_height="39dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="@dimen/control_bottom_horizontal_margin"
|
||||
android:layout_toEndOf="@id/btn_call"
|
||||
android:layout_toRightOf="@id/btn_call"
|
||||
android:onClick="onCameraClicked"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/video_enabled" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_mic"
|
||||
android:layout_width="39dp"
|
||||
android:layout_height="39dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="@dimen/control_bottom_horizontal_margin"
|
||||
android:layout_toStartOf="@id/btn_call"
|
||||
android:layout_toLeftOf="@id/btn_call"
|
||||
android:onClick="onMicClicked"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/mic_enabled" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_specker"
|
||||
android:layout_width="39dp"
|
||||
android:layout_height="39dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="@dimen/control_bottom_horizontal_margin"
|
||||
android:layout_toStartOf="@id/btn_mic"
|
||||
android:layout_toLeftOf="@id/btn_mic"
|
||||
android:onClick="onSpeckerClicked"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/audio_enabled" />
|
||||
</RelativeLayout>
|
||||
|
||||
<!-- <RelativeLayout-->
|
||||
<!-- android:id="@+id/progressBar"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="40dp"-->
|
||||
<!-- android:layout_alignParentBottom="true">-->
|
||||
|
||||
<!-- <ProgressBar-->
|
||||
<!-- android:id="@+id/progress_bar"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="31dp"-->
|
||||
<!-- android:layout_alignParentEnd="true"-->
|
||||
<!-- android:layout_alignParentBottom="true"-->
|
||||
<!-- android:layout_marginEnd="0dp"-->
|
||||
<!-- android:layout_marginBottom="0dp"-->
|
||||
<!-- android:progressBackgroundTint="@color/colorProgressBarBackground"-->
|
||||
<!-- style="@android:style/Widget.ProgressBar.Horizontal" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/progress_bar_text"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginLeft="9dp"-->
|
||||
<!-- android:gravity="center_vertical"-->
|
||||
<!-- android:textColor="@color/colorPrimary"-->
|
||||
<!-- android:layout_centerInParent="true"/>-->
|
||||
|
||||
<!-- </RelativeLayout>-->
|
||||
|
||||
</RelativeLayout>
|
||||
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#ffffff</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#fc3850</color>
|
||||
<color name="colorProgressBarBackground">#e4e9f2</color>
|
||||
|
||||
<!-- Chat Activity -->
|
||||
<color name="localBackground">#827b92</color>
|
||||
<color name="remoteBackground">#484258</color>
|
||||
</resources>
|
||||
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||
<dimen name="local_preview_margin_top">28dp</dimen>
|
||||
<dimen name="local_preview_margin_right">24dp</dimen>
|
||||
|
||||
<!-- buttons -->
|
||||
<dimen name="call_button_size">60dp</dimen>
|
||||
<dimen name="other_button_size">54dp</dimen>
|
||||
|
||||
|
||||
<dimen name="local_preview_width">88dp</dimen>
|
||||
<dimen name="local_preview_height">117dp</dimen>
|
||||
<dimen name="local_back_icon_size">50dp</dimen>
|
||||
<dimen name="remote_back_icon_size">100dp</dimen>
|
||||
<dimen name="remote_back_icon_margin_bottom">90dp</dimen>
|
||||
|
||||
<!-- buttons -->
|
||||
<dimen name="control_bottom_margin">24dp</dimen>
|
||||
<dimen name="control_bottom_horizontal_margin">25dp</dimen>
|
||||
</resources>
|
||||
@ -0,0 +1,8 @@
|
||||
<resources>
|
||||
|
||||
<string name="remaining_en">Remaining Time In Seconds: </string>
|
||||
<string name="remaining_ar">الوقت المتبقي بالثانيه: </string>
|
||||
<string name="setting">Settings</string>
|
||||
<string name="cancel">Cancel</string>
|
||||
|
||||
</resources>
|
||||
@ -0,0 +1,98 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "20x20",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "83.5x83.5",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ios-marketing",
|
||||
"size" : "1024x1024",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "call.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "call-1.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "call-2.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "cameramute.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
@ -0,0 +1,23 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "mic_enabled.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "mic_enabled-1.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "mic_enabled-2.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1,23 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "mic_disabled.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "mic_disabled-1.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "mic_disabled-2.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1,23 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "audio_enabled.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "audio_enabled-1.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "audio_enabled-2.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1,23 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "audio_disabled.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "audio_disabled-1.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "audio_disabled-2.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
@ -0,0 +1,23 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "flip_enabled-2.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "flip_enabled.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "flip_enabled-1.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
@ -0,0 +1,23 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "flip_disapled.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "flip_disapled-1.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "flip_disapled-2.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
@ -0,0 +1,23 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "video_enabled-2.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "video_enabled-1.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "video_enabled.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
@ -0,0 +1,23 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "video_disanabled.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "video_disanabled-1.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "video_disanabled-2.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "cameraoff_mainVideo.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 15 KiB |
@ -1,8 +1,9 @@
|
||||
final TOKEN = 'token';
|
||||
final PROJECT_ID='projectID';
|
||||
final PROJECT_ID = 'projectID';
|
||||
//===========amjad============
|
||||
final DOCTOR_ID='doctorID';
|
||||
final DOCTOR_ID = 'doctorID';
|
||||
//=======================
|
||||
final SLECTED_PATIENT_TYPE='slectedPatientType';
|
||||
final SLECTED_PATIENT_TYPE = 'slectedPatientType';
|
||||
final APP_Language = 'language';
|
||||
final DOCTOR_PROFILE = 'doctorProfile';
|
||||
final DOCTOR_PROFILE = 'doctorProfile';
|
||||
final LIVE_CARE_PATIENT = 'livecare-patient-profile';
|
||||
|
||||
@ -0,0 +1,49 @@
|
||||
class LiveCarePendingListRequest {
|
||||
PatientData patientData;
|
||||
int doctorID;
|
||||
String sErServiceID;
|
||||
int projectID;
|
||||
int sourceID;
|
||||
|
||||
LiveCarePendingListRequest(
|
||||
{this.patientData,
|
||||
this.doctorID,
|
||||
this.sErServiceID,
|
||||
this.projectID,
|
||||
this.sourceID});
|
||||
|
||||
LiveCarePendingListRequest.fromJson(Map<String, dynamic> json) {
|
||||
patientData = new PatientData.fromJson(json['PatientData']);
|
||||
|
||||
doctorID = json['DoctorID'];
|
||||
sErServiceID = json['SErServiceID'];
|
||||
projectID = json['ProjectID'];
|
||||
sourceID = json['SourceID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['PatientData'] = this.patientData.toJson();
|
||||
data['DoctorID'] = this.doctorID;
|
||||
data['SErServiceID'] = this.sErServiceID;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['SourceID'] = this.sourceID;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class PatientData {
|
||||
bool isOutKSA;
|
||||
|
||||
PatientData({this.isOutKSA});
|
||||
|
||||
PatientData.fromJson(Map<String, dynamic> json) {
|
||||
isOutKSA = json['IsOutKSA'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['IsOutKSA'] = this.isOutKSA;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,168 @@
|
||||
class LiveCarePendingListResponse {
|
||||
Null acceptedBy;
|
||||
Null acceptedOn;
|
||||
int age;
|
||||
Null appointmentNo;
|
||||
String arrivalTime;
|
||||
String arrivalTimeD;
|
||||
int callStatus;
|
||||
String clientRequestID;
|
||||
String clinicName;
|
||||
Null consoltationEnd;
|
||||
Null consultationNotes;
|
||||
Null createdOn;
|
||||
String dateOfBirth;
|
||||
String deviceToken;
|
||||
String deviceType;
|
||||
Null doctorName;
|
||||
String editOn;
|
||||
String gender;
|
||||
bool isFollowUP;
|
||||
Null isFromVida;
|
||||
int isLoginB;
|
||||
bool isOutKSA;
|
||||
int isRejected;
|
||||
String language;
|
||||
double latitude;
|
||||
double longitude;
|
||||
String mobileNumber;
|
||||
Null openSession;
|
||||
Null openTokenID;
|
||||
String patientID;
|
||||
String patientName;
|
||||
int patientStatus;
|
||||
String preferredLanguage;
|
||||
int projectID;
|
||||
int scoring;
|
||||
int serviceID;
|
||||
Null tokenID;
|
||||
int vCID;
|
||||
String voipToken;
|
||||
|
||||
LiveCarePendingListResponse(
|
||||
{this.acceptedBy,
|
||||
this.acceptedOn,
|
||||
this.age,
|
||||
this.appointmentNo,
|
||||
this.arrivalTime,
|
||||
this.arrivalTimeD,
|
||||
this.callStatus,
|
||||
this.clientRequestID,
|
||||
this.clinicName,
|
||||
this.consoltationEnd,
|
||||
this.consultationNotes,
|
||||
this.createdOn,
|
||||
this.dateOfBirth,
|
||||
this.deviceToken,
|
||||
this.deviceType,
|
||||
this.doctorName,
|
||||
this.editOn,
|
||||
this.gender,
|
||||
this.isFollowUP,
|
||||
this.isFromVida,
|
||||
this.isLoginB,
|
||||
this.isOutKSA,
|
||||
this.isRejected,
|
||||
this.language,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.mobileNumber,
|
||||
this.openSession,
|
||||
this.openTokenID,
|
||||
this.patientID,
|
||||
this.patientName,
|
||||
this.patientStatus,
|
||||
this.preferredLanguage,
|
||||
this.projectID,
|
||||
this.scoring,
|
||||
this.serviceID,
|
||||
this.tokenID,
|
||||
this.vCID,
|
||||
this.voipToken});
|
||||
|
||||
LiveCarePendingListResponse.fromJson(Map<String, dynamic> json) {
|
||||
acceptedBy = json['AcceptedBy'];
|
||||
acceptedOn = json['AcceptedOn'];
|
||||
age = json['Age'];
|
||||
appointmentNo = json['AppointmentNo'];
|
||||
arrivalTime = json['ArrivalTime'];
|
||||
arrivalTimeD = json['ArrivalTimeD'];
|
||||
callStatus = json['CallStatus'];
|
||||
clientRequestID = json['ClientRequestID'];
|
||||
clinicName = json['ClinicName'];
|
||||
consoltationEnd = json['ConsoltationEnd'];
|
||||
consultationNotes = json['ConsultationNotes'];
|
||||
createdOn = json['CreatedOn'];
|
||||
dateOfBirth = json['DateOfBirth'];
|
||||
deviceToken = json['DeviceToken'];
|
||||
deviceType = json['DeviceType'];
|
||||
doctorName = json['DoctorName'];
|
||||
editOn = json['EditOn'];
|
||||
gender = json['Gender'];
|
||||
isFollowUP = json['IsFollowUP'];
|
||||
isFromVida = json['IsFromVida'];
|
||||
isLoginB = json['IsLoginB'];
|
||||
isOutKSA = json['IsOutKSA'];
|
||||
isRejected = json['IsRejected'];
|
||||
language = json['Language'];
|
||||
latitude = json['Latitude'];
|
||||
longitude = json['Longitude'];
|
||||
mobileNumber = json['MobileNumber'];
|
||||
openSession = json['OpenSession'];
|
||||
openTokenID = json['OpenTokenID'];
|
||||
patientID = json['PatientID'];
|
||||
patientName = json['PatientName'];
|
||||
patientStatus = json['PatientStatus'];
|
||||
preferredLanguage = json['PreferredLanguage'];
|
||||
projectID = json['ProjectID'];
|
||||
scoring = json['Scoring'];
|
||||
serviceID = json['ServiceID'];
|
||||
tokenID = json['TokenID'];
|
||||
vCID = json['VC_ID'];
|
||||
voipToken = json['VoipToken'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['AcceptedBy'] = this.acceptedBy;
|
||||
data['AcceptedOn'] = this.acceptedOn;
|
||||
data['Age'] = this.age;
|
||||
data['AppointmentNo'] = this.appointmentNo;
|
||||
data['ArrivalTime'] = this.arrivalTime;
|
||||
data['ArrivalTimeD'] = this.arrivalTimeD;
|
||||
data['CallStatus'] = this.callStatus;
|
||||
data['ClientRequestID'] = this.clientRequestID;
|
||||
data['ClinicName'] = this.clinicName;
|
||||
data['ConsoltationEnd'] = this.consoltationEnd;
|
||||
data['ConsultationNotes'] = this.consultationNotes;
|
||||
data['CreatedOn'] = this.createdOn;
|
||||
data['DateOfBirth'] = this.dateOfBirth;
|
||||
data['DeviceToken'] = this.deviceToken;
|
||||
data['DeviceType'] = this.deviceType;
|
||||
data['DoctorName'] = this.doctorName;
|
||||
data['EditOn'] = this.editOn;
|
||||
data['Gender'] = this.gender;
|
||||
data['IsFollowUP'] = this.isFollowUP;
|
||||
data['IsFromVida'] = this.isFromVida;
|
||||
data['IsLoginB'] = this.isLoginB;
|
||||
data['IsOutKSA'] = this.isOutKSA;
|
||||
data['IsRejected'] = this.isRejected;
|
||||
data['Language'] = this.language;
|
||||
data['Latitude'] = this.latitude;
|
||||
data['Longitude'] = this.longitude;
|
||||
data['MobileNumber'] = this.mobileNumber;
|
||||
data['OpenSession'] = this.openSession;
|
||||
data['OpenTokenID'] = this.openTokenID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['PatientName'] = this.patientName;
|
||||
data['PatientStatus'] = this.patientStatus;
|
||||
data['PreferredLanguage'] = this.preferredLanguage;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['Scoring'] = this.scoring;
|
||||
data['ServiceID'] = this.serviceID;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['VC_ID'] = this.vCID;
|
||||
data['VoipToken'] = this.voipToken;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
class StartCallReq {
|
||||
int vCID;
|
||||
bool isrecall;
|
||||
String tokenID;
|
||||
String generalid;
|
||||
int doctorId;
|
||||
bool isOutKsa;
|
||||
String projectName;
|
||||
String docotrName;
|
||||
String clincName;
|
||||
String docSpec;
|
||||
int clinicId;
|
||||
|
||||
StartCallReq(
|
||||
{this.vCID,
|
||||
this.isrecall,
|
||||
this.tokenID,
|
||||
this.generalid,
|
||||
this.doctorId,
|
||||
this.isOutKsa,
|
||||
this.projectName,
|
||||
this.docotrName,
|
||||
this.clincName,
|
||||
this.docSpec,
|
||||
this.clinicId});
|
||||
|
||||
StartCallReq.fromJson(Map<String, dynamic> json) {
|
||||
vCID = json['VC_ID'];
|
||||
isrecall = json['isrecall'];
|
||||
tokenID = json['TokenID'];
|
||||
generalid = json['generalid'];
|
||||
doctorId = json['DoctorId'];
|
||||
isOutKsa = json['IsOutKsa'];
|
||||
projectName = json['projectName'];
|
||||
docotrName = json['DocotrName'];
|
||||
clincName = json['clincName'];
|
||||
docSpec = json['Doc_Spec'];
|
||||
clinicId = json['ClinicId'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['VC_ID'] = this.vCID;
|
||||
data['isrecall'] = this.isrecall;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['generalid'] = this.generalid;
|
||||
data['DoctorId'] = this.doctorId;
|
||||
data['IsOutKsa'] = this.isOutKsa;
|
||||
data['projectName'] = this.projectName;
|
||||
data['DocotrName'] = this.docotrName;
|
||||
data['clincName'] = this.clincName;
|
||||
data['Doc_Spec'] = this.docSpec;
|
||||
data['ClinicId'] = this.clinicId;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:doctor_app_flutter/client/base_app_client.dart';
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/models/livecare/get_panding_req_list.dart';
|
||||
import 'package:doctor_app_flutter/models/livecare/start_call_req.dart';
|
||||
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
|
||||
import 'package:doctor_app_flutter/util/helpers.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
|
||||
|
||||
class LiveCareProvider with ChangeNotifier {
|
||||
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
||||
|
||||
var liveCarePendingList = [];
|
||||
var inCallResponse = {};
|
||||
bool isFinished = true;
|
||||
bool hasError = false;
|
||||
String errorMsg = '';
|
||||
|
||||
LiveCarePendingListRequest _pendingRequestModel =
|
||||
LiveCarePendingListRequest();
|
||||
|
||||
Future<List> getpendingList() async {
|
||||
var profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
||||
_pendingRequestModel.projectID = await sharedPref.getInt(PROJECT_ID);
|
||||
_pendingRequestModel.doctorID = profile['DoctorID'];
|
||||
_pendingRequestModel.sErServiceID = "1,3";
|
||||
_pendingRequestModel.sourceID = 1;
|
||||
_pendingRequestModel.patientData = PatientData(isOutKSA: false);
|
||||
resetDefaultValues();
|
||||
// dynamic localRes;
|
||||
await BaseAppClient.post(GET_LIVECARE_PENDINGLIST,
|
||||
onSuccess: (response, statusCode) async {
|
||||
isFinished = true;
|
||||
liveCarePendingList = response["List_PendingPatientList"];
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
isFinished = true;
|
||||
throw error;
|
||||
}, body: _pendingRequestModel.toJson());
|
||||
return Future.value(liveCarePendingList);
|
||||
}
|
||||
|
||||
Future<Map> startCall(request, bool isReCall) async {
|
||||
var profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
||||
resetDefaultValues();
|
||||
/* the request model is not same hence added manually */
|
||||
var newRequest = new StartCallReq();
|
||||
newRequest.clinicId = profile["ClinicID"];
|
||||
newRequest.vCID = request["VC_ID"];
|
||||
newRequest.isrecall = isReCall;
|
||||
newRequest.doctorId = profile["DoctorID"];
|
||||
newRequest.isOutKsa = request["IsOutKSA"];
|
||||
newRequest.projectName = profile["ProjectName"];
|
||||
newRequest.docotrName = profile["DoctorName"];
|
||||
newRequest.clincName = profile["ClinicDescription"];
|
||||
newRequest.clincName = profile["ClinicDescription"];
|
||||
newRequest.docSpec = profile["DoctorTitleForProfile"];
|
||||
newRequest.generalid = 'Cs2020@2016\$2958';
|
||||
isFinished = false;
|
||||
await BaseAppClient.post(START_LIVECARE_CALL,
|
||||
onSuccess: (response, statusCode) async {
|
||||
isFinished = true;
|
||||
inCallResponse = response;
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
isFinished = true;
|
||||
throw error;
|
||||
}, body: newRequest.toJson());
|
||||
return Future.value(inCallResponse);
|
||||
}
|
||||
|
||||
resetDefaultValues() {
|
||||
isFinished = false;
|
||||
hasError = false;
|
||||
errorMsg = '';
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,254 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:doctor_app_flutter/providers/livecare_provider.dart';
|
||||
import 'package:doctor_app_flutter/util/VideoChannel.dart';
|
||||
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
||||
import 'package:doctor_app_flutter/util/helpers.dart';
|
||||
|
||||
class VideoCallPage extends StatefulWidget {
|
||||
@override
|
||||
_VideoCallPageState createState() => _VideoCallPageState();
|
||||
}
|
||||
|
||||
DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
|
||||
|
||||
class _VideoCallPageState extends State<VideoCallPage> {
|
||||
Timer _timmerInstance;
|
||||
int _start = 0;
|
||||
String _timmer = '';
|
||||
LiveCareProvider _liveCareProvider;
|
||||
bool _isInit = true;
|
||||
var _tokenData;
|
||||
var patientData = {};
|
||||
String image_url = 'https://hmgwebservices.com/Images/MobileImages/DUBAI/';
|
||||
//bool _isOutOfStuck = false;
|
||||
Helpers helpers = new Helpers();
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
if (_isInit) {
|
||||
_liveCareProvider = Provider.of<LiveCareProvider>(context);
|
||||
startCall();
|
||||
}
|
||||
_isInit = false;
|
||||
}
|
||||
|
||||
void connectOpenTok(tokenData) {
|
||||
_tokenData = tokenData;
|
||||
/* opentok functionalites need to be written */
|
||||
|
||||
VideoChannel.openVideoCallScreen(kApiKey: '46209962',
|
||||
kSessionId: _tokenData["OpenSessionID"],
|
||||
kToken: _tokenData["OpenTokenID"],
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
String getTimerTime(int start) {
|
||||
int minutes = (start ~/ 60);
|
||||
String sMinute = '';
|
||||
if (minutes.toString().length == 1) {
|
||||
sMinute = '0' + minutes.toString();
|
||||
} else
|
||||
sMinute = minutes.toString();
|
||||
|
||||
int seconds = (start % 60);
|
||||
String sSeconds = '';
|
||||
if (seconds.toString().length == 1) {
|
||||
sSeconds = '0' + seconds.toString();
|
||||
} else
|
||||
sSeconds = seconds.toString();
|
||||
|
||||
return sMinute + ':' + sSeconds;
|
||||
}
|
||||
|
||||
startCall() async {
|
||||
patientData = await sharedPref.getObj(LIVE_CARE_PATIENT);
|
||||
_liveCareProvider.startCall(patientData, false).then((result) {
|
||||
connectOpenTok(result);
|
||||
}).catchError((error) =>
|
||||
{helpers.showErrorToast(error), Navigator.of(context).pop()});
|
||||
}
|
||||
|
||||
// @override
|
||||
// void initState() {
|
||||
// super.initState();
|
||||
|
||||
// }
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: SafeArea(
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height * 1.09,
|
||||
// width: MediaQuery.of(context).size.width,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
),
|
||||
padding: EdgeInsets.all(50.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
height: 10.0,
|
||||
),
|
||||
Text(
|
||||
'Calling',
|
||||
style: TextStyle(
|
||||
color: Colors.deepPurpleAccent,
|
||||
fontWeight: FontWeight.w300,
|
||||
fontSize: 15),
|
||||
),
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.02,
|
||||
),
|
||||
Text(
|
||||
patientData["PatientName"],
|
||||
style: TextStyle(
|
||||
color: Colors.deepPurpleAccent,
|
||||
fontWeight: FontWeight.w900,
|
||||
fontSize: 20),
|
||||
),
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.02,
|
||||
),
|
||||
Container(
|
||||
child: Text(
|
||||
_timmer == '' ? 'Connecting' : 'Connected',
|
||||
style: TextStyle(
|
||||
color: Colors.deepPurpleAccent,
|
||||
fontWeight: FontWeight.w300,
|
||||
fontSize: 15),
|
||||
)),
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.02,
|
||||
),
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(200.0),
|
||||
child: Image.network(
|
||||
patientData["Gender"] == "1"
|
||||
? image_url + 'unkown.png'
|
||||
: image_url + 'unkowwn_female.png',
|
||||
height: 200.0,
|
||||
width: 200.0,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.02,
|
||||
),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
FunctionalButton(
|
||||
title: 'Speaker',
|
||||
icon: Icons.phone_in_talk,
|
||||
onPressed: () {
|
||||
|
||||
|
||||
|
||||
print(_tokenData["OpenSessionID"]);
|
||||
print(_tokenData["OpenTokenID"]);
|
||||
|
||||
VideoChannel.openVideoCallScreen(kApiKey: '46209962',
|
||||
kSessionId: _tokenData["OpenSessionID"],
|
||||
kToken: _tokenData["OpenTokenID"],
|
||||
);
|
||||
|
||||
},
|
||||
),
|
||||
FunctionalButton(
|
||||
title: 'Flip',
|
||||
icon: Icons.flip_to_back,
|
||||
onPressed: () {},
|
||||
),
|
||||
FunctionalButton(
|
||||
title: 'Mute',
|
||||
icon: Icons.mic_off,
|
||||
onPressed: () {},
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.1,
|
||||
),
|
||||
FloatingActionButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
elevation: 20.0,
|
||||
shape: CircleBorder(side: BorderSide(color: Colors.red)),
|
||||
mini: false,
|
||||
child: Icon(
|
||||
Icons.call_end,
|
||||
color: Colors.red,
|
||||
),
|
||||
backgroundColor: Colors.red[100],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class FunctionalButton extends StatefulWidget {
|
||||
final title;
|
||||
final icon;
|
||||
final Function() onPressed;
|
||||
|
||||
const FunctionalButton({Key key, this.title, this.icon, this.onPressed})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_FunctionalButtonState createState() => _FunctionalButtonState();
|
||||
}
|
||||
|
||||
class _FunctionalButtonState extends State<FunctionalButton> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
RawMaterialButton(
|
||||
onPressed: widget.onPressed,
|
||||
splashColor: Colors.deepPurpleAccent,
|
||||
fillColor: Colors.white,
|
||||
elevation: 10.0,
|
||||
shape: CircleBorder(),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Icon(
|
||||
widget.icon,
|
||||
size: 30.0,
|
||||
color: Colors.deepPurpleAccent,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.symmetric(vertical: 10.0, horizontal: 2.0),
|
||||
child: Text(
|
||||
widget.title,
|
||||
style: TextStyle(fontSize: 15.0, color: Colors.deepPurpleAccent),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class VideoChannel{
|
||||
/// channel name
|
||||
static const _channel = const MethodChannel("Dr.cloudSolution/videoCall");
|
||||
static Future<dynamic> openVideoCallScreen(
|
||||
{kApiKey, kSessionId, kToken, callDuration, warningDuration}) {
|
||||
var result;
|
||||
try {
|
||||
result = _channel.invokeMethod(
|
||||
'openVideoCall',
|
||||
{
|
||||
"kApiKey": kApiKey,
|
||||
"kSessionId": kSessionId,
|
||||
"kToken": kToken,
|
||||
/* "callDuration": callDuration,
|
||||
"warningDuration": warningDuration,*/
|
||||
"appLang": "en",
|
||||
},
|
||||
);
|
||||
} on PlatformException catch (e) {
|
||||
result = e.toString();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||