finish solve keybaord issue

merge-requests/759/head
mosazaid 4 years ago
parent 994757b662
commit a7c5e1afde

@ -16,6 +16,7 @@ import com.hmg.hmgDr.Model.GetSessionStatusModel
import com.hmg.hmgDr.Model.SessionStatusModel
import com.hmg.hmgDr.Service.VideoStreamContainerService
import com.hmg.hmgDr.ui.VideoCallResponseListener
import com.hmg.hmgDr.ui.fragment.VideoCallFragment
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodCall
@ -32,6 +33,7 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
private var call: MethodCall? = null
private val LAUNCH_VIDEO: Int = 1
private var dialogFragment: VideoCallFragment? = null
private var serviceIntent: Intent? = null
private var videoStreamService: VideoStreamContainerService? = null
private var bound = false
@ -105,7 +107,7 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
putExtras(arguments)
startService(this)
}
bindService()
// bindService()
}
/* override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
@ -135,9 +137,8 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
}*/
override fun onCallFinished(resultCode: Int, intent: Intent?) {
// TODO uncomment it
/*if (resultCode == Activity.RESULT_OK) {
if (resultCode == Activity.RESULT_OK) {
val result: SessionStatusModel? = intent?.getParcelableExtra("sessionStatusNotRespond")
val callResponse: HashMap<String, String> = HashMap()
@ -162,10 +163,10 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
Log.e("onVideoCallFinished", "${e.message}.")
}
}
*/
stopService(serviceIntent)
unbindService()
videoStreamService!!.serviceRunning = false
// stopService(serviceIntent)
// unbindService()
// videoStreamService!!.serviceRunning = false
}
override fun minimizeVideoEvent(isMinimize: Boolean) {
@ -189,40 +190,40 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
// unbindService()
// }
private fun bindService() {
serviceIntent?.run {
if (videoStreamService != null && !videoStreamService!!.serviceRunning){
startService(this)
}
bindService(this, serviceConnection, Context.BIND_AUTO_CREATE)
videoStreamService?.serviceRunning = true
}
}
private fun unbindService() {
if (bound) {
videoStreamService!!.videoCallResponseListener = null // unregister
videoStreamService!!.mActivity = null
unbindService(serviceConnection)
bound = false
}
}
private val serviceConnection: ServiceConnection = object : ServiceConnection {
override fun onServiceConnected(name: ComponentName?, service: IBinder?) {
val binder: VideoStreamContainerService.VideoStreamBinder =
service as VideoStreamContainerService.VideoStreamBinder
videoStreamService = binder.service
bound = true
videoStreamService!!.videoCallResponseListener = this@MainActivity // register
videoStreamService!!.mActivity = this@MainActivity // register
}
override fun onServiceDisconnected(name: ComponentName?) {
bound = false
}
}
// private fun bindService() {
// serviceIntent?.run {
// if (videoStreamService != null && !videoStreamService!!.serviceRunning){
// startService(this)
// }
// bindService(this, serviceConnection, Context.BIND_AUTO_CREATE)
// videoStreamService?.serviceRunning = true
// }
// }
//
// private fun unbindService() {
// if (bound) {
// videoStreamService!!.videoCallResponseListener = null // unregister
// videoStreamService!!.mActivity = null
// unbindService(serviceConnection)
// bound = false
// }
// }
//
// private val serviceConnection: ServiceConnection = object : ServiceConnection {
// override fun onServiceConnected(name: ComponentName?, service: IBinder?) {
// val binder: VideoStreamContainerService.VideoStreamBinder =
// service as VideoStreamContainerService.VideoStreamBinder
// videoStreamService = binder.service
// bound = true
// videoStreamService!!.videoCallResponseListener = this@MainActivity // register
// videoStreamService!!.mActivity = this@MainActivity // register
// }
//
// override fun onServiceDisconnected(name: ComponentName?) {
// bound = false
// }
//
// }
// code to hide soft keyboard
fun hideSoftKeyBoard(editBox: EditText?) {

@ -29,13 +29,12 @@ class VideoCallService extends BaseService {
DoctorProfileModel doctorProfile =
await getDoctorProfile(isGetProfile: true);
await VideoChannel.openVideoCallScreen(
kToken:
"T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==",
// startCallRes.openTokenID,
kSessionId:
"1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg",
//startCallRes.openSessionID,
kApiKey: '47247954',//'46209962'
kToken: startCallRes.openTokenID,
// "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==",
kSessionId: startCallRes.openSessionID,
// "1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg",
kApiKey:'46209962', //'47247954',
vcId: patient.vcId,
patientName: patient.fullName ??
(patient.firstName != null

@ -255,7 +255,7 @@ class AuthenticationViewModel extends BaseViewModel {
/// add  token to shared preferences in case of send activation code is success
setDataAfterSendActivationSuccess(SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) {
print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode);
DrAppToastMsg.showSuccesToast("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode);
// DrAppToastMsg.showSuccesToast("_VerificationCode_ : " + sendActivationCodeForDoctorAppResponseModel.verificationCode);
sharedPref.setString(VIDA_AUTH_TOKEN_ID,
sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID);
sharedPref.setString(VIDA_REFRESH_TOKEN_ID,

@ -173,21 +173,21 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
child: AppLoaderWidget(
containerColor: Colors.transparent,
)),
AppButton(
fontWeight: FontWeight.w700,
color:Colors.green[600],
title: TranslationBase.of(context).initiateCall,
disabled: model.state == ViewState.BusyLocal,
onPressed: () async {
AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){
locator<VideoCallService>().openVideo(model.startCallRes, PatiantInformtion(
vcId: 454353,
fullName: "test mosa"
), callConnected, callDisconnected);
});
},
),
// AppButton(
// fontWeight: FontWeight.w700,
// color:Colors.green[600],
// title: TranslationBase.of(context).initiateCall,
// disabled: model.state == ViewState.BusyLocal,
// onPressed: () async {
// AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){
// locator<VideoCallService>().openVideo(model.startCallRes, PatiantInformtion(
// vcId: 454353,
// fullName: "test mosa"
// ), callConnected, callDisconnected);
// });
//
// },
// ),
],
),
),

@ -306,12 +306,11 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
// builder: (BuildContext context) =>
// EndCallScreen(patient:patient)));
// TODO MOSA REMOVE THIS
AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){
locator<VideoCallService>().openVideo(model.startCallRes, patient, callConnected, callDisconnected);
});
// AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){
// locator<VideoCallService>().openVideo(model.startCallRes, patient, callConnected, callDisconnected);
// });
/* if(isCallFinished) {
if(isCallFinished) {
Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) => EndCallScreen(patient:patient)));
} else {
@ -333,7 +332,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
locator<VideoCallService>().openVideo(model.startCallRes, patient, callConnected, callDisconnected);
});
}
}*/
}
},
),

Loading…
Cancel
Save