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

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

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

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

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

Loading…
Cancel
Save