From bfb3d0d4879dca8c59ff287c92f5113162f3a33a Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期二, 27 八月 2024 15:22:48 +0800 Subject: [PATCH] 代码备份 --- OnPro/HDL-ON_Android/LeChengVideo/Form/ReverseCallFragment.cs | 544 +++++++++++++++++++++++++++--------------------------- 1 files changed, 272 insertions(+), 272 deletions(-) diff --git a/OnPro/HDL-ON_Android/LeChengVideo/Form/ReverseCallFragment.cs b/OnPro/HDL-ON_Android/LeChengVideo/Form/ReverseCallFragment.cs index 68073cc..7e647c2 100644 --- a/OnPro/HDL-ON_Android/LeChengVideo/Form/ReverseCallFragment.cs +++ b/OnPro/HDL-ON_Android/LeChengVideo/Form/ReverseCallFragment.cs @@ -1,319 +1,319 @@ 锘� -using System; -using System.Collections.Generic; -using System.Threading; -using Android.App; -using Android.Icu.Text; -using Android.OS; -using Android.Runtime; -using Android.Util; -using Android.Views; -using Android.Widget; -using HDL_ON.Common; -using HDL_ON.DAL.Server; -using Java.Util; +//using System; +//using System.Collections.Generic; +//using System.Threading; +//using Android.App; +//using Android.Icu.Text; +//using Android.OS; +//using Android.Runtime; +//using Android.Util; +//using Android.Views; +//using Android.Widget; +//using HDL_ON.Common; +//using HDL_ON.DAL.Server; +//using Java.Util; -namespace HDL_ON_Android.LeChengView.Form -{ - public class ReverseCallFragment : Fragment, View.IOnClickListener - { +//namespace HDL_ON_Android.LeChengView.Form +//{ +// public class ReverseCallFragment : Fragment, View.IOnClickListener +// { - private View mView; +// private View mView; - private ImageView screenshotImg;// 鎴浘 - private ImageView unlockImg;// 寮�閿� - private LinearLayout answerLayout; // 鎺ュ惉 - private ImageView hangupImg;// 鎸傛柇 - private ImageView answerImg;// 鎺ュ惉 - private TextView hangupText; +// private ImageView screenshotImg;// 鎴浘 +// private ImageView unlockImg;// 寮�閿� +// private LinearLayout answerLayout; // 鎺ュ惉 +// private ImageView hangupImg;// 鎸傛柇 +// private ImageView answerImg;// 鎺ュ惉 +// private TextView hangupText; - private TextView tvTip; +// private TextView tvTip; - private System.Threading.Timer timer = null; - private int Time = 0; - private bool isAnswer;//鏄惁宸茬粡鐐瑰嚮鎺ュ惉杩囦簡 +// private System.Threading.Timer timer = null; +// private int Time = 0; +// private bool isAnswer;//鏄惁宸茬粡鐐瑰嚮鎺ュ惉杩囦簡 - private static LeChengVideoActivity CurtActivity; +// private static LeChengVideoActivity CurtActivity; - public override void OnCreate(Bundle savedInstanceState) - { - base.OnCreate(savedInstanceState); +// public override void OnCreate(Bundle savedInstanceState) +// { +// base.OnCreate(savedInstanceState); - CurtActivity = (LeChengVideoActivity)this.Activity; - } +// CurtActivity = (LeChengVideoActivity)this.Activity; +// } - public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) - { - mView = inflater.Inflate(Resource.Layout.fragment_call, container, false); +// public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) +// { +// mView = inflater.Inflate(Resource.Layout.fragment_call, container, false); - IniView(); +// IniView(); - CurtActivity.Play(); +// CurtActivity.Play(); - CurtActivity.CloseAudio(); +// CurtActivity.CloseAudio(); - return mView; - } +// return mView; +// } - private void IniView() - { - screenshotImg = (ImageView)mView.FindViewById(Resource.Id.callScreenshotImg);// - unlockImg = (ImageView)mView.FindViewById(Resource.Id.callUnlockImg);// - tvTip = (TextView)mView.FindViewById(Resource.Id.callTipText); - answerLayout = (LinearLayout)mView.FindViewById(Resource.Id.callAnswerLayout); - hangupImg = (ImageView)mView.FindViewById(Resource.Id.callHangupImg); - answerImg = (ImageView)mView.FindViewById(Resource.Id.callAnswerImg); - hangupText = (TextView)mView.FindViewById(Resource.Id.callHangupText); +// private void IniView() +// { +// screenshotImg = (ImageView)mView.FindViewById(Resource.Id.callScreenshotImg);// +// unlockImg = (ImageView)mView.FindViewById(Resource.Id.callUnlockImg);// +// tvTip = (TextView)mView.FindViewById(Resource.Id.callTipText); +// answerLayout = (LinearLayout)mView.FindViewById(Resource.Id.callAnswerLayout); +// hangupImg = (ImageView)mView.FindViewById(Resource.Id.callHangupImg); +// answerImg = (ImageView)mView.FindViewById(Resource.Id.callAnswerImg); +// hangupText = (TextView)mView.FindViewById(Resource.Id.callHangupText); - screenshotImg.SetOnClickListener(this); - unlockImg.SetOnClickListener(this); - hangupImg.SetOnClickListener(this); - answerImg.SetOnClickListener(this); +// screenshotImg.SetOnClickListener(this); +// unlockImg.SetOnClickListener(this); +// hangupImg.SetOnClickListener(this); +// answerImg.SetOnClickListener(this); - hangupText.SetText(GetString(Resource.String.video_not_answer), null); - tvTip.SetText(GetString(Resource.String.calling), null); - } +// hangupText.SetText(GetString(Resource.String.video_not_answer), null); +// tvTip.SetText(GetString(Resource.String.calling), null); +// } - /// <summary> - /// 寮�閿� - /// </summary> - private void PostUnlock() - { - //寮�閿侊紝褰撴敹鍒版潵鐢典俊鎭椂鍙繘琛屽紑閿佹搷浣� - new Thread(() => - { - try - { - Dictionary<string, object> d = new Dictionary<string, object>(); - d.Add("deviceId", CurtActivity.DeviceId);//璁惧id - string jsonString = HttpUtil.GetSignRequestJson(d); +// /// <summary> +// /// 寮�閿� +// /// </summary> +// private void PostUnlock() +// { +// //寮�閿侊紝褰撴敹鍒版潵鐢典俊鎭椂鍙繘琛屽紑閿佹搷浣� +// new Thread(() => +// { +// try +// { +// Dictionary<string, object> d = new Dictionary<string, object>(); +// d.Add("deviceId", CurtActivity.DeviceId);//璁惧id +// string jsonString = HttpUtil.GetSignRequestJson(d); - string url = "/home-wisdom/platform/imou/openDoorbell"; - ResponsePackNew response = HttpUtil.RequestHttpsPost(url, jsonString); - Log.Info("LcVideo", "Post Unlock Response code=" + response.Code); - } - catch { } +// string url = "/home-wisdom/platform/imou/openDoorbell"; +// ResponsePackNew response = HttpUtil.RequestHttpsPost(url, jsonString); +// Log.Info("LcVideo", "Post Unlock Response code=" + response.Code); +// } +// catch { } - }).Start(); - } +// }).Start(); +// } - /// <summary> - /// 寮�閿� - /// </summary> - private void Unlock() - { - // - CurtActivity.Unlock(); - UpdataUnlockState(); - } +// /// <summary> +// /// 寮�閿� +// /// </summary> +// private void Unlock() +// { +// // +// CurtActivity.Unlock(); +// UpdataUnlockState(); +// } - /// <summary> - /// 鏇存柊寮�閿佹寜閽姸鎬�,寮�閿佹垚鍔燂紝15绉掑唴涓嶇粰鍐嶇偣鍑绘寜閽� - /// </summary> - private void UpdataUnlockState() - { - try - { - if (unlockImg == null) return; +// /// <summary> +// /// 鏇存柊寮�閿佹寜閽姸鎬�,寮�閿佹垚鍔燂紝15绉掑唴涓嶇粰鍐嶇偣鍑绘寜閽� +// /// </summary> +// private void UpdataUnlockState() +// { +// try +// { +// if (unlockImg == null) return; - unlockImg.Enabled = false; +// unlockImg.Enabled = false; - new Thread(() => - { - Thread.Sleep(15 * 1000); - Activity.RunOnUiThread(() => - { - if (unlockImg != null) - unlockImg.Enabled = true; - }); - }).Start(); - } - catch { } - } +// new Thread(() => +// { +// Thread.Sleep(15 * 1000); +// Activity.RunOnUiThread(() => +// { +// if (unlockImg != null) +// unlockImg.Enabled = true; +// }); +// }).Start(); +// } +// catch { } +// } - private string GetTime(int time) - { +// private string GetTime(int time) +// { - int m = time / 60; - int s = time % 60; +// int m = time / 60; +// int s = time % 60; - return UnitFormat(m) + ":" + UnitFormat(s); +// return UnitFormat(m) + ":" + UnitFormat(s); - } +// } - private static string UnitFormat(int i) - { - string retStr = null; - if (i >= 0 && i < 10) - retStr = "0" + i; - else - retStr = "" + i; - return retStr; - } +// private static string UnitFormat(int i) +// { +// string retStr = null; +// if (i >= 0 && i < 10) +// retStr = "0" + i; +// else +// retStr = "" + i; +// return retStr; +// } - /// <summary> - /// 閫氳瘽璁板綍璁℃椂鍣紝浠庢媺娴佹垚鍔熷紑濮嬭绠楁椂闂� - /// </summary> - public void TimeStarts() - { - try - { - if (timer != null) - timer.Dispose(); +// /// <summary> +// /// 閫氳瘽璁板綍璁℃椂鍣紝浠庢媺娴佹垚鍔熷紑濮嬭绠楁椂闂� +// /// </summary> +// public void TimeStarts() +// { +// try +// { +// if (timer != null) +// timer.Dispose(); - TimerCallback timerCallback = new TimerCallback(Tick); - timer = new System.Threading.Timer(timerCallback, null, 0, 1000); +// TimerCallback timerCallback = new TimerCallback(Tick); +// timer = new System.Threading.Timer(timerCallback, null, 0, 1000); - } - catch (Exception) { } - } +// } +// catch (Exception) { } +// } - public void TimeEnd() - { - Time = 0; +// public void TimeEnd() +// { +// Time = 0; - if (timer != null) - { - timer.Dispose(); - timer = null; - } - } +// if (timer != null) +// { +// timer.Dispose(); +// timer = null; +// } +// } - public void Tick(object state) - { - try - { - Activity.RunOnUiThread(() => - { - try - { - Time++; - if (tvTip != null) - tvTip.SetText(GetTime(Time), null); - } - catch { } - }); - } - catch { } - } +// public void Tick(object state) +// { +// try +// { +// Activity.RunOnUiThread(() => +// { +// try +// { +// Time++; +// if (tvTip != null) +// tvTip.SetText(GetTime(Time), null); +// } +// catch { } +// }); +// } +// catch { } +// } - public void OnClick(View v) - { - if (v.Equals(answerImg)) - { - //鎺ユ敹鏉ョ數 - isAnswer = true; - CurtActivity.StartTalk(); - answerLayout.Visibility = ViewStates.Gone; - PostAnswer(); - } - else if (v.Equals(hangupImg)) - { - CurtActivity.StopTalk(); - //2021-11-30 澧炲姞鎷掔粷鍜屾寕鏂搷浣滃鐞� - if (isAnswer) - { - //濡傛灉鎺ュ惉杩囦簡锛屾墽琛屾寕鏂帴鍙� - PostHangup(); - } - else - { - //娌℃帴鍚洿鎺ユ寕鏂紝鎵ц鎷掓帴鎺ュ彛 - PostReject(); - } +// public void OnClick(View v) +// { +// if (v.Equals(answerImg)) +// { +// //鎺ユ敹鏉ョ數 +// isAnswer = true; +// CurtActivity.StartTalk(); +// answerLayout.Visibility = ViewStates.Gone; +// PostAnswer(); +// } +// else if (v.Equals(hangupImg)) +// { +// CurtActivity.StopTalk(); +// //2021-11-30 澧炲姞鎷掔粷鍜屾寕鏂搷浣滃鐞� +// if (isAnswer) +// { +// //濡傛灉鎺ュ惉杩囦簡锛屾墽琛屾寕鏂帴鍙� +// PostHangup(); +// } +// else +// { +// //娌℃帴鍚洿鎺ユ寕鏂紝鎵ц鎷掓帴鎺ュ彛 +// PostReject(); +// } - TimeEnd(); - Activity.Finish(); - } - else if (v.Equals(screenshotImg)) - { - //鏈夎棰戣繃鏉ュ彲璋冪敤姝ゆ帴鍙h繘琛屾媿鐓� - screenshotImg.Selected = true; - SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); - string time = format.Format(new Date(SystemClock.CurrentThreadTimeMillis())); - string ss = Android.OS.Environment.ExternalStorageDirectory.Path + "/DCIM/Camera"; - string path = ss + "/" + time + ".jpg"; - CurtActivity.SnapShot(path); - } - else if (v.Equals(unlockImg)) - { - CurtActivity.Unlock(); - } - } +// TimeEnd(); +// Activity.Finish(); +// } +// else if (v.Equals(screenshotImg)) +// { +// //鏈夎棰戣繃鏉ュ彲璋冪敤姝ゆ帴鍙h繘琛屾媿鐓� +// screenshotImg.Selected = true; +// SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); +// string time = format.Format(new Date(SystemClock.CurrentThreadTimeMillis())); +// string ss = Android.OS.Environment.ExternalStorageDirectory.Path + "/DCIM/Camera"; +// string path = ss + "/" + time + ".jpg"; +// CurtActivity.SnapShot(path); +// } +// else if (v.Equals(unlockImg)) +// { +// CurtActivity.Unlock(); +// } +// } - /// <summary> - /// post 鎺ュ惉鐢佃瘽璁板綍 - /// </summary> - public void PostAnswer() - { - new Thread(() => - { - try - { - Dictionary<string, object> d = new Dictionary<string, object>(); - d.Add("callId", CurtActivity.CallId);//鍛煎彨id - d.Add("callStatus", "RECEIVED");//鍙敤鍊�:MISSED,RECEIVED,REJECT - // d.Add("callDuration", Time);//閫氳瘽鏃堕暱锛堢锛� - d.Add("interphoneTypeEnum", "IMOUVISIAL");//鍙敤鍊�:FLVI,IMOUVISIAL - string jsonString = HttpUtil.GetSignRequestJson(d); +// /// <summary> +// /// post 鎺ュ惉鐢佃瘽璁板綍 +// /// </summary> +// public void PostAnswer() +// { +// new Thread(() => +// { +// try +// { +// Dictionary<string, object> d = new Dictionary<string, object>(); +// d.Add("callId", CurtActivity.CallId);//鍛煎彨id +// d.Add("callStatus", "RECEIVED");//鍙敤鍊�:MISSED,RECEIVED,REJECT +// // d.Add("callDuration", Time);//閫氳瘽鏃堕暱锛堢锛� +// d.Add("interphoneTypeEnum", "IMOUVISIAL");//鍙敤鍊�:FLVI,IMOUVISIAL +// string jsonString = HttpUtil.GetSignRequestJson(d); - string url = "/home-wisdom/platform/imou/updateCallStatus"; - ResponsePackNew response = HttpUtil.RequestHttpsPost(url, jsonString); - Log.Info("LcVideo", "Post Answer Response code=" + response.Code); - } - catch { } +// string url = "/home-wisdom/platform/imou/updateCallStatus"; +// ResponsePackNew response = HttpUtil.RequestHttpsPost(url, jsonString); +// Log.Info("LcVideo", "Post Answer Response code=" + response.Code); +// } +// catch { } - }).Start(); - } +// }).Start(); +// } - /// <summary> - /// post 鎸傛柇鐢佃瘽璁板綍 - /// </summary> - public void PostHangup() - { - new Thread(() => - { - try - { - Dictionary<string, object> d = new Dictionary<string, object>(); - d.Add("callId", CurtActivity.CallId);//鍛煎彨id - d.Add("callStatus", "RECEIVED");//鍙敤鍊�:MISSED,RECEIVED,REJECT - d.Add("callDuration", Time);//閫氳瘽鏃堕暱锛堢锛� - d.Add("interphoneTypeEnum", "IMOUVISIAL");//鍙敤鍊�:FLVI,IMOUVISIAL - string jsonString = HttpUtil.GetSignRequestJson(d); +// /// <summary> +// /// post 鎸傛柇鐢佃瘽璁板綍 +// /// </summary> +// public void PostHangup() +// { +// new Thread(() => +// { +// try +// { +// Dictionary<string, object> d = new Dictionary<string, object>(); +// d.Add("callId", CurtActivity.CallId);//鍛煎彨id +// d.Add("callStatus", "RECEIVED");//鍙敤鍊�:MISSED,RECEIVED,REJECT +// d.Add("callDuration", Time);//閫氳瘽鏃堕暱锛堢锛� +// d.Add("interphoneTypeEnum", "IMOUVISIAL");//鍙敤鍊�:FLVI,IMOUVISIAL +// string jsonString = HttpUtil.GetSignRequestJson(d); - string url = "/home-wisdom/platform/imou/updateCallStatus"; - ResponsePackNew response = HttpUtil.RequestHttpsPost(url, jsonString); - Log.Info("LcVideo", "Post Hangup Response code=" + response.Code); - } - catch { } +// string url = "/home-wisdom/platform/imou/updateCallStatus"; +// ResponsePackNew response = HttpUtil.RequestHttpsPost(url, jsonString); +// Log.Info("LcVideo", "Post Hangup Response code=" + response.Code); +// } +// catch { } - }).Start(); - } +// }).Start(); +// } - /// <summary> - /// post 鎷掓帴璁板綍,浠呭彧鏈夊湪姝e父鎸傛柇鐘舵�佷笅鎵嶆彁浜ら�氳瘽鏃堕棿 - /// </summary> - public void PostReject() - { - new Thread(() => - { - try - { - Dictionary<string, object> d = new Dictionary<string, object>(); - d.Add("callId", CurtActivity.CallId);//鍛煎彨id - d.Add("callStatus", "REJECT");//鍙敤鍊�:MISSED,RECEIVED,REJECT - d.Add("interphoneTypeEnum", "IMOUVISIAL");//鍙敤鍊�:FLVI,IMOUVISIAL - string jsonString = HttpUtil.GetSignRequestJson(d); +// /// <summary> +// /// post 鎷掓帴璁板綍,浠呭彧鏈夊湪姝e父鎸傛柇鐘舵�佷笅鎵嶆彁浜ら�氳瘽鏃堕棿 +// /// </summary> +// public void PostReject() +// { +// new Thread(() => +// { +// try +// { +// Dictionary<string, object> d = new Dictionary<string, object>(); +// d.Add("callId", CurtActivity.CallId);//鍛煎彨id +// d.Add("callStatus", "REJECT");//鍙敤鍊�:MISSED,RECEIVED,REJECT +// d.Add("interphoneTypeEnum", "IMOUVISIAL");//鍙敤鍊�:FLVI,IMOUVISIAL +// string jsonString = HttpUtil.GetSignRequestJson(d); - string url = "/home-wisdom/platform/imou/updateCallStatus"; - ResponsePackNew response = HttpUtil.RequestHttpsPost(url, jsonString); - Log.Info("LcVideo", "Post Reject Response code=" + response.Code); - } - catch { } +// string url = "/home-wisdom/platform/imou/updateCallStatus"; +// ResponsePackNew response = HttpUtil.RequestHttpsPost(url, jsonString); +// Log.Info("LcVideo", "Post Reject Response code=" + response.Code); +// } +// catch { } - }).Start(); - } - } -} +// }).Start(); +// } +// } +//} -- Gitblit v1.8.0