From 80faceb86399017851f9f72feaaef868a37ff23f Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期五, 26 三月 2021 10:50:35 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/lss' into temp-wxr --- HDL-ON_Android/Resources/drawable/unlock.xml | 6 HDL-ON_Android/Resources/layout/fragment_call.xml | 133 +++ HDL-ON_Android/Resources/drawable/screenshot_sel.png | 0 HDL-ON_Android/Resources/drawable/hangup.png | 0 HDL-ON_Android/Resources/drawable/video_background.png | 0 HDL_ON/HDL_ON.projitems | 1 HDL-ON_Android/FengLinVideo/Form/MonitorFragment.cs | 208 ++++++ HDL-ON_Android/FengLinVideo/widget/TipDiaglog.cs | 143 ++++ HDL-ON_Android/HDL-ON_Android.csproj | 109 +++ HDL-ON_Android/Resources/values/strings.xml | 20 HDL-ON_Android/Resources/drawable/mic.png | 0 HDL-ON_Android/Resources/drawable/unlock_def.png | 0 HDL-ON_Android/Resources/values/styles.xml | 58 + HDL-ON_Android/Resources/drawable/sure_background_def.xml | 11 HDL-ON_Android/Resources/drawable/screenshot_def.png | 0 HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs | 14 HDL_ON/FengLinVideo/ESOnVideo.cs | 134 +++ HDL-ON_Android/FengLinVideo/Interface/VideoState.cs | 8 HDL-ON_Android/VideoActivity.cs | 449 +++++++++++++ HDL-ON_Android/FengLinVideo/Form/ReverseCallFragment.cs | 404 +++++++++++ HDL-ON_Android/Resources/drawable/answer.png | 0 HDL-ON_Android/Resources/layout/dialog_tip.xml | 48 + HDL-ON_Android/Resources/values/dimens.xml | 3 HDL-ON_Android/Resources/layout/fragment_monitor.xml | 63 + HDL-ON_Android/Resources/drawable/tip_background.xml | 12 HDL-ON_Android/Resources/values-zh/strings.xml | 21 HDL_ON/Common/FileUtlis.cs | 58 + HDL-ON_Android/Resources/drawable/screenshot.xml | 6 HDL-ON_Android/Resources/drawable/unlock_sel.png | 0 HDL-ON_Android/Resources/values/colors.xml | 11 HDL-ON_Android/Resources/layout/activity_video_phone.xml | 66 + HDL-ON_Android/Resources/drawable/back_icon.png | 0 HDL-ON_Android/Resources/drawable/dialog_background.xml | 10 HDL-ON_Android/Resources/drawable/sure_background_sel.xml | 11 34 files changed, 1,971 insertions(+), 36 deletions(-) diff --git a/HDL-ON_Android/FengLinVideo/Form/MonitorFragment.cs b/HDL-ON_Android/FengLinVideo/Form/MonitorFragment.cs new file mode 100644 index 0000000..983b35a --- /dev/null +++ b/HDL-ON_Android/FengLinVideo/Form/MonitorFragment.cs @@ -0,0 +1,208 @@ +锘� +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using Android.App; +using Android.Content; +using Android.Icu.Text; +using Android.OS; +using Android.Runtime; +using Android.Util; +using Android.Views; +using Android.Widget; +using Com.ETouchSky; +using Com.Tool; +using HDL_ON.DAL.Server; +using HDL_ON_Android.FengLinVideo.Interface; +using Java.Util; +using Org.Json; + +namespace HDL_ON_Android.FengLinVideo.Form +{ + public class MonitorFragment : Fragment, View.IOnClickListener, VideoState + { + + private View mView; + private VideoPhone mPhone; + + // 鎴浘 + private LinearLayout screenshotLayout; + private ImageView screenImage; + private TextView ScreenText; + + //寮�閿� + private LinearLayout unlockLayout; + private ImageView unlockImag; + private TextView unlockText; + + // 鏇存柊绾跨▼ + private Thread thread = null; + + public MonitorFragment(VideoPhone phone) + { + this.mPhone = phone; + } + + public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) + { + mView = inflater.Inflate(Resource.Layout.fragment_monitor, container, false); + + IniView(); + + return mView; + } + + private void IniView() + { + screenshotLayout = (LinearLayout)mView.FindViewById(Resource.Id.icon_sceenshotLayout); + screenImage = (ImageView)mView.FindViewById(Resource.Id.icon_sceenshotImg); + ScreenText = (TextView)mView.FindViewById(Resource.Id.icon_sceenshotText); + + unlockLayout = (LinearLayout)mView.FindViewById(Resource.Id.icon_unlockLayout); + unlockImag = (ImageView)mView.FindViewById(Resource.Id.icon_unlockImg); + unlockText = (TextView)mView.FindViewById(Resource.Id.icon_unlockText); + + unlockLayout.SetOnClickListener(this); + screenshotLayout.SetOnClickListener(this); + } + + /// <summary> + /// 寮�閿� + /// </summary> + private void Unlock() + { + if (mPhone != null) + { + try + { + unlockImag.Selected = true; + JSONObject ht = new JSONObject(); + ht.Put("command", "open");//鍥哄畾鍙傛暟 + ht.Put("room_id", 123); + ht.Put("devType", 7); + mPhone.SendCustomData(ht.ToString()); + } + catch { } + } + } + + /// <summary> + /// 鏇存柊寮�閿佹寜閽姸鎬� + /// </summary> + private void UpdataUnlockState() + { + try + { + //寮�閿佹垚鍔燂紝15绉掑唴涓嶇粰鍐嶇偣鍑绘寜閽� + unlockLayout.Enabled = false; + if (thread != null) + { + try + { + thread.Interrupt(); + } + catch { } + thread = null; + } + + thread = new Thread(() => + { + try + { + Thread.Sleep(15 * 1000); + + Activity.RunOnUiThread(() => + { + if (unlockLayout != null) + unlockLayout.Enabled = true; + }); + } + catch { } + }); + + thread.Start(); + } + catch { } + } + + public void OnClick(View v) + { + // + if (v.Equals(unlockLayout)) + { + if (mPhone != null) + Unlock(); + } + else if (v.Equals(screenshotLayout)) + { + + //鏈夎棰戣繃鏉ュ彲璋冪敤姝ゆ帴鍙h繘琛屾媿鐓� + if (mPhone != null) + { + // 鍐呴儴鍌ㄥ瓨/DCIM/Camera/.....jpg + screenImage.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"; + mPhone.Snap(path); + } + } + } + + /// <summary> + /// 閫氳瘽鐘舵�佸洖璋冩柟娉� + /// </summary> + /// <param name="msg"></param> + public void OnPhoneEvent(string msg) + { + try + { + // + TextProtocol tp = new TextProtocol(); + tp.Parse(msg); + string event1 = tp.GetString("event"); + + switch (event1) + { + case "EVT_HangUp"://鎸傛柇 + Activity.Finish(); + break; + case "EVT_RECV_CUSTOM_DATA": + UpdataUnlockState(); + break; + case "EVT_SnapAck": + int error = tp.GetInt("error"); + string filePath = tp.GetString("filePath"); + if (error == 0) + { + screenImage.Selected = true; + } + else + { + screenImage.Selected = false; + } + break; + } + } + catch { } + } + + public override void OnDestroy() + { + base.OnDestroy(); + + if (thread != null) + { + try + { + thread.Interrupt(); + } + catch { } + thread = null; + } + } + } +} \ No newline at end of file diff --git a/HDL-ON_Android/FengLinVideo/Form/ReverseCallFragment.cs b/HDL-ON_Android/FengLinVideo/Form/ReverseCallFragment.cs new file mode 100644 index 0000000..ba0102f --- /dev/null +++ b/HDL-ON_Android/FengLinVideo/Form/ReverseCallFragment.cs @@ -0,0 +1,404 @@ +锘� +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using Android.App; +using Android.Content; +using Android.Icu.Text; +using Android.OS; +using Android.Runtime; +using Android.Util; +using Android.Views; +using Android.Widget; +using Com.ETouchSky; +using Com.Tool; +using HDL_ON.Common; +using HDL_ON.DAL.Server; +using HDL_ON_Android.FengLinVideo.Interface; +using Java.Util; +using Org.Json; + +namespace HDL_ON_Android.FengLinVideo.Form +{ + public class ReverseCallFragment : Fragment, View.IOnClickListener, VideoState + { + private VideoPhone mPhone; + private string param = ""; + private bool isCalling = false; + + private View mView; + + private ImageView screenshotImg;// 鎴浘 + private ImageView unlockImg;// 寮�閿� + private LinearLayout answerLayout; // 鎺ュ惉 + private ImageView hangupImg; // 鎺ュ惉 + private ImageView answerImg;// 鎸傛柇 + private TextView hangupText; + + private TextView tvTip; + + private System.Threading.Timer timer = null; + private int Time = 0; + + public ReverseCallFragment(VideoPhone _phone, string _param) + { + this.mPhone = _phone; + this.param = _param; + } + + public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) + { + mView = inflater.Inflate(Resource.Layout.fragment_call, container, false); + + IniView(); + ReverseCall(param); + + 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); + + 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); + } + + /// <summary> + /// 涓�鑸槸鎺ㄩ�佽繃鐨勬潵鐢典俊鎭椂璋冪敤姝ゆ帴鍙f墦寮�瑙嗛绐楀彛銆傜劧鍚庡彲璋冪敤mPhone.acceptRing(param);鎺ユ敹鏉ョ數淇℃伅 + /// </summary> + /// <param name="param"></param> + private void ReverseCall(string param) + { + if (mPhone != null) + { + mPhone.ReverseCall(param); + } + } + + /// <summary> + /// 寮�閿� + /// </summary> + private void Unlock() + { + //寮�閿侊紝褰撴敹鍒版潵鐢典俊鎭椂鍙繘琛屽紑閿佹搷浣� + if (mPhone != null) + { + try + { + unlockImg.Selected = true; + JSONObject ht = new JSONObject(); + ht.Put("command", "open");//鍥哄畾鍙傛暟 + ht.Put("room_id", 123); //鍔ㄦ�佸弬鏁� 锛屼紶閫掑紑闂ㄧ殑鎴块棿鍙枫�傝繖涓紑闂ㄥ彛璁板綍灏辫兘璁板綍璋佸紑鐨勯棬 + ht.Put("devType", 7); //鍥哄畾鍙傛暟 + mPhone.SendCustomData(ht.ToString()); + } + catch (Exception e) + { + string erro = e.Message; + } + } + } + + /// <summary> + /// 鏇存柊寮�閿佹寜閽姸鎬�,寮�閿佹垚鍔燂紝15绉掑唴涓嶇粰鍐嶇偣鍑绘寜閽� + /// </summary> + private void UpdataUnlockState() + { + try + { + if (unlockImg == null) return; + + unlockImg.Enabled = false; + + new Thread(() => + { + Thread.Sleep(15 * 1000); + Activity.RunOnUiThread(() => + { + if (unlockImg != null) + unlockImg.Enabled = true; + }); + }).Start(); + } + catch { } + } + + private string GetTime(int time) + { + + int m = time / 60; + int s = time % 60; + + 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; + } + + /// <summary> + /// 閫氳瘽璁板綍璁℃椂鍣紝浠庢媺娴佹垚鍔熷紑濮嬭绠楁椂闂� + /// </summary> + private void TimeStarts() + { + try + { + if (timer != null) + timer.Dispose(); + + TimerCallback timerCallback = new TimerCallback(Tick); + timer = new System.Threading.Timer(timerCallback, null, 0, 1000); + + } + catch (Exception) { } + } + + private void TimeEnd() + { + Time = 0; + + 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 { } + } + + /// <summary> + /// 閫氳瘽娑堟伅鍥炶皟鏂规硶 + /// </summary> + /// <param name="msg"></param> + public void OnPhoneEvent(string msg) + { + try + { + // + TextProtocol tp = new TextProtocol(); + tp.Parse(msg); + string event1 = tp.GetString("event"); + + switch (event1) + { + case "EVT_RECV_CUSTOM_DATA": + string data = tp.GetString("data"); + UpdataUnlockState(); + break; + case "EVT_StartStream":// 鎷夋祦鎴愬姛锛屽紑濮嬭褰曢�氳瘽鏃堕棿 + isCalling = true; + TimeStarts(); + hangupText.SetText(GetString(Resource.String.video_hang_up), null); + break; + case "EVT_StopStream": + if (isCalling == false) + PostReject();// 鎷掓帴 + else + PostHangup();// 姝e父鎸傛柇 + break; + case "EVT_SnapAck": + int error = tp.GetInt("error"); + string filePath = tp.GetString("filePath"); + if (error == 0) + { + screenshotImg.Selected = true; + PostScreenshot(filePath); + } + else + { + screenshotImg.Selected = false; + } + break; + } + } + catch (Exception e) + { + string error = e.Message; + } + } + + public void OnClick(View v) + { + if (v.Equals(answerImg)) + { + //鎺ユ敹鏉ョ數 + if (mPhone != null) + { + if (mPhone.IsRinging) + { + string UserData = "user text"; + //娉ㄦ剰锛歊equestAudio 璇锋眰瀵规柟闊抽锛孯equestVideo璇锋眰瀵规柟瑙嗛 SendAudio鍙戦�佹湰鍦伴煶棰� SendVideo 鍙戦�佹湰鍦拌棰� 涓�鑸棬鍙d笉鎺ユ敹鍒拌棰戯紝鎵�浠ユ渶濂借缃�0锛屽噺灏戞祦閲忔秷鑰� + string param = string.Format("RequestAudio=1\r\n" + "RequestVideo=1\r\n" + "SendAudio=1\r\n" + "SendVideo=0r\n" + "UserData=%s\r\n", UserData); + mPhone.AcceptRing(param); + answerLayout.Visibility = ViewStates.Gone; + PostAnswer(); + } + } + } + else if (v.Equals(hangupImg)) + { + if (mPhone != null) + { + mPhone.HangUp(); + TimeEnd(); + } + Activity.Finish(); + } + else if (v.Equals(screenshotImg)) + { + //鏈夎棰戣繃鏉ュ彲璋冪敤姝ゆ帴鍙h繘琛屾媿鐓� + if (mPhone != null) + { + // 鍐呴儴鍌ㄥ瓨/DCIM/Camera/.....jpg + 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"; + mPhone.Snap(path); + } + } + else if (v.Equals(unlockImg)) + { + Unlock(); + } + } + + /// <summary> + /// post 鎴浘 + /// </summary> + /// <param name="path">鎴浘淇濈暀鐨勮矾寰�</param> + private void PostScreenshot(string path) + { + new Thread(() => + { + try + { + string[] str = path.Split("/"); + string img_name = str.GetValue(str.Length - 1).ToString().Replace(".jpg", ""); + byte[] images = FileUtlis.Files.ReadFileForPath(path); + Dictionary<string, object> d = new Dictionary<string, object>(); + d.Add("callId", VideoActivity.CallId); + d.Add("images", images); + d.Add("imagesName", img_name); + string jsonString = HttpUtil.GetSignRequestJson(d); + + string url = "/home-wisdom/app/fl/vi/screenshot"; + ResponsePackNew response = HttpUtil.RequestHttpsPost(url, jsonString); + Log.Info("FengLinVideo", "Post Screenshot Response code=" + response.Code); + } + catch { } + + }).Start(); + } + + /// <summary> + /// post 鎺ュ惉鐢佃瘽璁板綍 + /// </summary> + private void PostAnswer() + { + new Thread(() => + { + try + { + Dictionary<string, object> d = new Dictionary<string, object>(); + d.Add("uuid", VideoActivity.UUId);//涓版灄璇锋眰鐨勫敮涓�id string + d.Add("cmtID", VideoActivity.CmtID);//涓版灄绀惧尯id string + d.Add("roomno", VideoActivity.Roomno);//涓版灄鎴块棿鍙� string + d.Add("unitno", VideoActivity.Unitno);//涓版灄妤兼爧鍙� string + d.Add("HomeID", VideoActivity.HomeID);//涓版灄浣忓畢id string + d.Add("callId", VideoActivity.CallId);//鍛煎彨璁板綍id int + string jsonString = HttpUtil.GetSignRequestJson(d); + + string url = "/home-wisdom/app/fl/vi/answer"; + ResponsePackNew response = HttpUtil.RequestHttpsPost(url, jsonString); + Log.Info("FengLinVideo", "Post Answer Response code=" + response.Code); + } + catch { } + + }).Start(); + } + + /// <summary> + /// post 鎸傛柇鐢佃瘽璁板綍 + /// </summary> + private void PostHangup() + { + new Thread(() => + { + try + { + Dictionary<string, object> d = new Dictionary<string, object>(); + d.Add("callId", VideoActivity.CallId);//鍛煎彨璁板綍id int + d.Add("callDuration", Time);//閫氳瘽鏃堕暱锛堢锛� int + string jsonString = HttpUtil.GetSignRequestJson(d); + + string url = "/home-wisdom/app/fl/vi/hang-up"; + ResponsePackNew response = HttpUtil.RequestHttpsPost(url, jsonString); + Log.Info("FengLinVideo", "Post Hangup Response code=" + response.Code); + } + catch { } + + }).Start(); + } + + /// <summary> + /// post 鎷掓帴璁板綍 + /// </summary> + private void PostReject() + { + new Thread(() => + { + try + { + Dictionary<string, object> d = new Dictionary<string, object>(); + d.Add("callId", VideoActivity.CallId);//鍛煎彨璁板綍id int + string jsonString = HttpUtil.GetSignRequestJson(d); + + string url = "/home-wisdom/app/fl/vi/reject"; + ResponsePackNew response = HttpUtil.RequestHttpsPost(url, jsonString); + Log.Info("FengLinVideo", "Post Reject Response code=" + response.Code); + } + catch { } + + }).Start(); + } + } +} diff --git a/HDL-ON_Android/FengLinVideo/Interface/VideoState.cs b/HDL-ON_Android/FengLinVideo/Interface/VideoState.cs new file mode 100644 index 0000000..c0c45d5 --- /dev/null +++ b/HDL-ON_Android/FengLinVideo/Interface/VideoState.cs @@ -0,0 +1,8 @@ +锘縰sing System; +namespace HDL_ON_Android.FengLinVideo.Interface +{ + public interface VideoState + { + void OnPhoneEvent(string msg); + } +} diff --git a/HDL-ON_Android/FengLinVideo/widget/TipDiaglog.cs b/HDL-ON_Android/FengLinVideo/widget/TipDiaglog.cs new file mode 100644 index 0000000..157762f --- /dev/null +++ b/HDL-ON_Android/FengLinVideo/widget/TipDiaglog.cs @@ -0,0 +1,143 @@ +锘縰sing System; +using Android.App; +using Android.Content; +using Android.Graphics; +using Android.Views; +using Android.Widget; +using HDL_ON_Android; + +namespace GateWay.Droid.FengLinVideo.widget +{ + public class TipDiaglog : Dialog, View.IOnClickListener, View.IOnTouchListener + { + private Context mContext = null; + + private string titleText = "鎻愮ず"; + private string contentText = ""; + private string confirmText = "纭"; + private bool isClose = false; + + private TextView contentView = null; + private TextView titleView = null; + private TextView okView = null; + public object Tag = null; + private OnConfirmClickListener onConfirmClickListener; + + public TipDiaglog(Context context) : base(context, Resource.Style.DialogTheme) + { + this.mContext = context; + } + + public void SetAutoClose(bool bol) + { + this.isClose = bol; + } + + public void SetTitleText(string _titleText) + { + titleText = _titleText; + if (titleView != null) + { + titleView.SetText(titleText, null); + } + } + + public void SetContentText(string _contentText) + { + contentText = _contentText; + if (contentView != null) + { + contentView.SetText(contentText, null); + } + } + + public void SetConfirmText(string text) + { + confirmText = text; + if (okView != null) + { + okView.SetText(confirmText, null); + } + } + + public override void Create() + { + base.Create(); + + try + { + SetContentView(Resource.Layout.dialog_tip); + + contentView = (TextView)FindViewById(Resource.Id.tv_content); + titleView = (TextView)FindViewById(Resource.Id.tv_title); + okView = (TextView)FindViewById(Resource.Id.tv_ok); + + contentView.SetText(contentText, null); + titleView.SetText(titleText, null); + okView.SetText(confirmText, null); + + okView.SetOnTouchListener(this); + okView.SetOnClickListener(this); + } + catch (Exception e) + { + string error = e.Message; + } + } + + public override void OnWindowFocusChanged(bool hasFocus) + { + base.OnWindowFocusChanged(hasFocus); + + try + { + Display display = ((Activity)mContext).WindowManager.DefaultDisplay; + + WindowManagerLayoutParams p = Window.Attributes; + Point point = new Point(); + display.GetSize(point); + p.Width = (int)(point.X * 0.7); + Window.SetGravity(GravityFlags.Center); + } + catch (Exception e) + { + string ss = e.Message; + } + } + + public void SetConfirmClickListener(OnConfirmClickListener l) + { + onConfirmClickListener = l; + } + + public void OnClick(View v) + { + if (v.Equals(okView)) + { + if (onConfirmClickListener != null) + onConfirmClickListener.onSureClick(this, v, isClose); + } + } + + public bool OnTouch(View v, MotionEvent e) + { + if (e.Action == MotionEventActions.Down) + { + v.SetBackgroundResource(Resource.Drawable.sure_background_sel); + } + else if (e.Action == MotionEventActions.Up) + { + v.SetBackgroundResource(Resource.Drawable.sure_background_def); + } + + return false; + + } + + public interface OnConfirmClickListener + { + void onSureClick(TipDiaglog dialoog, View v,bool bol); + } + + } +} diff --git a/HDL-ON_Android/HDL-ON_Android.csproj b/HDL-ON_Android/HDL-ON_Android.csproj index 7d9cfd9..9c7d6cb 100644 --- a/HDL-ON_Android/HDL-ON_Android.csproj +++ b/HDL-ON_Android/HDL-ON_Android.csproj @@ -128,6 +128,24 @@ <Reference Include="AndriodBluetoothLibrary"> <HintPath>..\DLL\Android\AndriodBluetoothLibrary.dll</HintPath> </Reference> + <Reference Include="cloudp2p"> + <HintPath>..\..\..\鏈懡鍚嶆枃浠跺す\cloudp2p.dll</HintPath> + </Reference> + <Reference Include="corelooper"> + <HintPath>..\..\..\鏈懡鍚嶆枃浠跺す\corelooper.dll</HintPath> + </Reference> + <Reference Include="crypt"> + <HintPath>..\..\..\鏈懡鍚嶆枃浠跺す\crypt.dll</HintPath> + </Reference> + <Reference Include="http"> + <HintPath>..\..\..\鏈懡鍚嶆枃浠跺す\http.dll</HintPath> + </Reference> + <Reference Include="VideoLibs"> + <HintPath>..\..\..\鏈懡鍚嶆枃浠跺す\VideoLibs.dll</HintPath> + </Reference> + <Reference Include="videophone"> + <HintPath>..\..\..\鏈懡鍚嶆枃浠跺す\videophone.dll</HintPath> + </Reference> </ItemGroup> <ItemGroup> <Compile Include="MainActivity.cs" /> @@ -140,6 +158,11 @@ <Compile Include="Other\JLCountrycode.cs" /> <Compile Include="Other\JPush\JPushReceiver.cs" /> <Compile Include="Other\JPush\JPushService.cs" /> + <Compile Include="VideoActivity.cs" /> + <Compile Include="FengLinVideo\Interface\VideoState.cs" /> + <Compile Include="FengLinVideo\Form\MonitorFragment.cs" /> + <Compile Include="FengLinVideo\Form\ReverseCallFragment.cs" /> + <Compile Include="FengLinVideo\widget\TipDiaglog.cs" /> </ItemGroup> <ItemGroup> <None Include="Resources\AboutResources.txt" /> @@ -221,6 +244,86 @@ <Generator> </Generator> </AndroidResource> + <AndroidResource Include="Resources\drawable\answer.png"> + <SubType></SubType> + <Generator></Generator> + </AndroidResource> + <AndroidResource Include="Resources\drawable\back_icon.png"> + <SubType></SubType> + <Generator></Generator> + </AndroidResource> + <AndroidResource Include="Resources\drawable\dialog_background.xml"> + <SubType></SubType> + <Generator></Generator> + </AndroidResource> + <AndroidResource Include="Resources\drawable\hangup.png"> + <SubType></SubType> + <Generator></Generator> + </AndroidResource> + <AndroidResource Include="Resources\drawable\mic.png"> + <SubType></SubType> + <Generator></Generator> + </AndroidResource> + <AndroidResource Include="Resources\drawable\screenshot_def.png"> + <SubType></SubType> + <Generator></Generator> + </AndroidResource> + <AndroidResource Include="Resources\drawable\screenshot_sel.png"> + <SubType></SubType> + <Generator></Generator> + </AndroidResource> + <AndroidResource Include="Resources\drawable\screenshot.xml"> + <SubType></SubType> + <Generator></Generator> + </AndroidResource> + <AndroidResource Include="Resources\drawable\sure_background_def.xml"> + <SubType></SubType> + <Generator></Generator> + </AndroidResource> + <AndroidResource Include="Resources\drawable\sure_background_sel.xml"> + <SubType></SubType> + <Generator></Generator> + </AndroidResource> + <AndroidResource Include="Resources\drawable\tip_background.xml"> + <SubType></SubType> + <Generator></Generator> + </AndroidResource> + <AndroidResource Include="Resources\drawable\unlock_def.png"> + <SubType></SubType> + <Generator></Generator> + </AndroidResource> + <AndroidResource Include="Resources\drawable\unlock_sel.png"> + <SubType></SubType> + <Generator></Generator> + </AndroidResource> + <AndroidResource Include="Resources\drawable\unlock.xml"> + <SubType></SubType> + <Generator></Generator> + </AndroidResource> + <AndroidResource Include="Resources\drawable\video_background.png"> + <SubType></SubType> + <Generator></Generator> + </AndroidResource> + <AndroidResource Include="Resources\layout\activity_video_phone.xml"> + <SubType></SubType> + <Generator></Generator> + </AndroidResource> + <AndroidResource Include="Resources\layout\dialog_tip.xml"> + <SubType></SubType> + <Generator></Generator> + </AndroidResource> + <AndroidResource Include="Resources\layout\fragment_call.xml"> + <SubType></SubType> + <Generator></Generator> + </AndroidResource> + <AndroidResource Include="Resources\layout\fragment_monitor.xml"> + <SubType></SubType> + <Generator></Generator> + </AndroidResource> + <AndroidResource Include="Resources\values-zh\strings.xml"> + <SubType></SubType> + <Generator></Generator> + </AndroidResource> </ItemGroup> <ItemGroup> <Folder Include="Resources\drawable\" /> @@ -261,6 +364,12 @@ <PackageReference Include="Bugly"> <Version>4.3.1</Version> </PackageReference> + <PackageReference Include="Xamarin.Android.Support.Constraint.Layout"> + <Version>1.1.0</Version> + </PackageReference> + <PackageReference Include="Xamarin.Android.Support.Constraint.Layout.Solver"> + <Version>1.1.0</Version> + </PackageReference> </ItemGroup> <ItemGroup> <AndroidAsset Include="Assets\Language.ini" /> diff --git a/HDL-ON_Android/Resources/drawable/answer.png b/HDL-ON_Android/Resources/drawable/answer.png new file mode 100755 index 0000000..c497569 --- /dev/null +++ b/HDL-ON_Android/Resources/drawable/answer.png Binary files differ diff --git a/HDL-ON_Android/Resources/drawable/back_icon.png b/HDL-ON_Android/Resources/drawable/back_icon.png new file mode 100755 index 0000000..d9f5bff --- /dev/null +++ b/HDL-ON_Android/Resources/drawable/back_icon.png Binary files differ diff --git a/HDL-ON_Android/Resources/drawable/dialog_background.xml b/HDL-ON_Android/Resources/drawable/dialog_background.xml new file mode 100755 index 0000000..aae1daa --- /dev/null +++ b/HDL-ON_Android/Resources/drawable/dialog_background.xml @@ -0,0 +1,10 @@ +锘�<?xml version="1.0" encoding="UTF-8" ?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + + <item> + <shape> + <corners android:radius="20dp" /> + <solid android:color="#FFFFFF" /> + </shape> + </item> +</selector> \ No newline at end of file diff --git a/HDL-ON_Android/Resources/drawable/hangup.png b/HDL-ON_Android/Resources/drawable/hangup.png new file mode 100755 index 0000000..9867c3f --- /dev/null +++ b/HDL-ON_Android/Resources/drawable/hangup.png Binary files differ diff --git a/HDL-ON_Android/Resources/drawable/mic.png b/HDL-ON_Android/Resources/drawable/mic.png new file mode 100755 index 0000000..4879c11 --- /dev/null +++ b/HDL-ON_Android/Resources/drawable/mic.png Binary files differ diff --git a/HDL-ON_Android/Resources/drawable/screenshot.xml b/HDL-ON_Android/Resources/drawable/screenshot.xml new file mode 100644 index 0000000..e10bf34 --- /dev/null +++ b/HDL-ON_Android/Resources/drawable/screenshot.xml @@ -0,0 +1,6 @@ +锘�<?xml version="1.0" encoding="UTF-8"?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:drawable="@drawable/screenshot_sel" android:state_selected="true" /> + <item android:drawable="@drawable/screenshot_sel" android:state_pressed="true" /> + <item android:drawable="@drawable/screenshot_def" /> +</selector> \ No newline at end of file diff --git a/HDL-ON_Android/Resources/drawable/screenshot_def.png b/HDL-ON_Android/Resources/drawable/screenshot_def.png new file mode 100755 index 0000000..6ae2233 --- /dev/null +++ b/HDL-ON_Android/Resources/drawable/screenshot_def.png Binary files differ diff --git a/HDL-ON_Android/Resources/drawable/screenshot_sel.png b/HDL-ON_Android/Resources/drawable/screenshot_sel.png new file mode 100755 index 0000000..5273212 --- /dev/null +++ b/HDL-ON_Android/Resources/drawable/screenshot_sel.png Binary files differ diff --git a/HDL-ON_Android/Resources/drawable/sure_background_def.xml b/HDL-ON_Android/Resources/drawable/sure_background_def.xml new file mode 100755 index 0000000..3023c46 --- /dev/null +++ b/HDL-ON_Android/Resources/drawable/sure_background_def.xml @@ -0,0 +1,11 @@ +锘�<?xml version="1.0" encoding="UTF-8" ?> +<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > + + <item> + <shape android:shape="rectangle"> + <solid android:color="#ffffff" /> + <corners android:bottomLeftRadius="20dp" android:bottomRightRadius="20dp"/> + </shape> + </item> + +</layer-list> diff --git a/HDL-ON_Android/Resources/drawable/sure_background_sel.xml b/HDL-ON_Android/Resources/drawable/sure_background_sel.xml new file mode 100755 index 0000000..dad895e --- /dev/null +++ b/HDL-ON_Android/Resources/drawable/sure_background_sel.xml @@ -0,0 +1,11 @@ +锘�<?xml version="1.0" encoding="UTF-8" ?> +<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > + + <item> + <shape android:shape="rectangle"> + <solid android:color="#66000000" /> + <corners android:bottomLeftRadius="20dp" android:bottomRightRadius="20dp"/> + </shape> + </item> + +</layer-list> diff --git a/HDL-ON_Android/Resources/drawable/tip_background.xml b/HDL-ON_Android/Resources/drawable/tip_background.xml new file mode 100755 index 0000000..7e9c861 --- /dev/null +++ b/HDL-ON_Android/Resources/drawable/tip_background.xml @@ -0,0 +1,12 @@ +锘�<?xml version="1.0" encoding="UTF-8" ?> +<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > + + <item> + <shape android:shape="rectangle"> + <solid android:color="#66000000" /> + <corners android:radius="20dp"/> + <padding android:left="20dp" android:right="20dp" android:bottom="8dp" android:top="8dp"/> + </shape> + </item> + +</layer-list> diff --git a/HDL-ON_Android/Resources/drawable/unlock.xml b/HDL-ON_Android/Resources/drawable/unlock.xml new file mode 100644 index 0000000..d843cac --- /dev/null +++ b/HDL-ON_Android/Resources/drawable/unlock.xml @@ -0,0 +1,6 @@ +锘�<?xml version="1.0" encoding="UTF-8"?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:drawable="@drawable/unlock_sel" android:state_selected="true" /> + <item android:drawable="@drawable/unlock_sel" android:state_pressed="true" /> + <item android:drawable="@drawable/unlock_def" /> +</selector> \ No newline at end of file diff --git a/HDL-ON_Android/Resources/drawable/unlock_def.png b/HDL-ON_Android/Resources/drawable/unlock_def.png new file mode 100755 index 0000000..16cb7ba --- /dev/null +++ b/HDL-ON_Android/Resources/drawable/unlock_def.png Binary files differ diff --git a/HDL-ON_Android/Resources/drawable/unlock_sel.png b/HDL-ON_Android/Resources/drawable/unlock_sel.png new file mode 100755 index 0000000..13913de --- /dev/null +++ b/HDL-ON_Android/Resources/drawable/unlock_sel.png Binary files differ diff --git a/HDL-ON_Android/Resources/drawable/video_background.png b/HDL-ON_Android/Resources/drawable/video_background.png new file mode 100755 index 0000000..bb98fe2 --- /dev/null +++ b/HDL-ON_Android/Resources/drawable/video_background.png Binary files differ diff --git a/HDL-ON_Android/Resources/layout/activity_video_phone.xml b/HDL-ON_Android/Resources/layout/activity_video_phone.xml new file mode 100644 index 0000000..e5116dd --- /dev/null +++ b/HDL-ON_Android/Resources/layout/activity_video_phone.xml @@ -0,0 +1,66 @@ +锘�<?xml version="1.0" encoding="UTF-8" ?> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="#FFFFFF" + android:orientation="vertical"> + + <RelativeLayout + android:layout_width="match_parent" + android:layout_height="44dp"> + + <ImageView + android:id="@+id/videoBackImg" + android:layout_width="wrap_content" + android:layout_height="20dp" + android:layout_marginLeft="10dp" + android:layout_centerVertical="true" + android:contentDescription="@string/video_icon" + android:src="@drawable/back_icon"/> + + <TextView + android:id="@+id/nameText" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="@color/colorBlack" + android:layout_gravity="center_horizontal" + android:textSize="@dimen/tipTitleTextSize" + android:layout_centerInParent="true" + android:text="@string/video_device"/> + </RelativeLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="210" + android:orientation="vertical" + android:background="@drawable/video_background"> + + <FrameLayout + android:id="@+id/locaVideo" + android:layout_width="1px" + android:layout_height="1px" + android:visibility="invisible"/> + + <FrameLayout + android:id="@+id/remoteFrame" + android:layout_width="match_parent" + android:layout_height="match_parent"/> + + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="393" + android:orientation="vertical"> + + <LinearLayout + android:id="@+id/content" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="horizontal"/> + </LinearLayout> + +</LinearLayout> \ No newline at end of file diff --git a/HDL-ON_Android/Resources/layout/dialog_tip.xml b/HDL-ON_Android/Resources/layout/dialog_tip.xml new file mode 100644 index 0000000..e1bad06 --- /dev/null +++ b/HDL-ON_Android/Resources/layout/dialog_tip.xml @@ -0,0 +1,48 @@ +锘�<?xml version="1.0" encoding="UTF-8" ?> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@drawable/dialog_background"> + + <TextView + android:id="@+id/tv_title" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textColor="@color/color_default" + android:textSize="@dimen/tipTitleTextSize" + android:gravity="center" + android:layout_marginTop="24dp" + android:layout_marginBottom="12dp" + android:fontFamily="sans-serif-black" + android:text="@string/video_tip"/> + + <TextView + android:id="@+id/tv_content" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textSize="13sp" + android:gravity="center" + android:textColor="@color/color_default" + android:text="@string/video_hang_up"/> + + <View + android:layout_width="match_parent" + android:layout_height="1px" + android:layout_marginTop="24dp" + android:background="@color/color_disable"/> + + <TextView + android:id="@+id/tv_ok" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingTop="13dp" + android:paddingBottom="13dp" + android:gravity="center" + android:fontFamily="sans-serif-medium" + android:textSize="16sp" + android:textColor="#2175d8" + android:background="@drawable/sure_background_def" + android:text="@string/video_confirm"/> +</LinearLayout> \ No newline at end of file diff --git a/HDL-ON_Android/Resources/layout/fragment_call.xml b/HDL-ON_Android/Resources/layout/fragment_call.xml new file mode 100644 index 0000000..ebec3f2 --- /dev/null +++ b/HDL-ON_Android/Resources/layout/fragment_call.xml @@ -0,0 +1,133 @@ +锘�<?xml version="1.0" encoding="UTF-8" ?> +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="30dp" + android:layout_marginRight="30dp" + android:orientation="horizontal"> + + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:gravity="center" + android:layout_weight="1"> + + <ImageView + android:id="@+id/callScreenshotImg" + android:layout_width="40dp" + android:layout_height="40dp" + android:adjustViewBounds="true" + android:scaleType="centerInside" + android:layout_marginTop="16dp" + android:layout_marginBottom="16dp" + android:layout_marginLeft="13dp" + android:layout_marginRight="13dp" + android:contentDescription="@string/video_screenshot" + android:src="@drawable/screenshot"/> + + </LinearLayout> + + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:gravity="center" + android:layout_weight="1"> + + <ImageView + android:id="@+id/callUnlockImg" + android:layout_width="40dp" + android:layout_height="40dp" + android:adjustViewBounds="true" + android:scaleType="centerInside" + android:layout_marginTop="16dp" + android:layout_marginBottom="16dp" + android:layout_marginLeft="13dp" + android:layout_marginRight="13dp" + android:contentDescription="@string/video_unlock" + android:src="@drawable/unlock"/> + </LinearLayout> + + </LinearLayout> + + <TextView + android:layout_width="match_parent" + android:layout_height="1dp" + android:layout_marginTop="72dp" + android:background="#806D798D"/> + + <TextView + android:id="@+id/callTipText" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textColor="@android:color/white" + android:textSize="@dimen/tipTextSize" + android:background="@drawable/tip_background" + android:layout_centerHorizontal="true" + android:layout_marginTop="110dp"/> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginStart="30dp" + android:layout_marginEnd="30dp" + android:layout_below="@id/callTipText" + android:layout_marginTop="103dp" + android:orientation="horizontal"> + + <LinearLayout + + android:layout_width="66dp" + android:layout_weight="1" + android:layout_height="wrap_content" + android:gravity="center" + android:orientation="vertical"> + + <ImageView + android:id="@+id/callHangupImg" + android:layout_width="66dp" + android:layout_height="66dp" + android:adjustViewBounds="true" + android:contentDescription="@string/video_not_answer" + android:scaleType="centerInside" + android:src="@drawable/hangup"/> + + <TextView + android:id="@+id/callHangupText" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/video_not_answer"/> + + </LinearLayout> + + <LinearLayout + android:id="@+id/callAnswerLayout" + android:layout_width="66dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:gravity="center" + android:orientation="vertical"> + + <ImageView + android:id="@+id/callAnswerImg" + android:layout_width="66dp" + android:layout_height="66dp" + android:adjustViewBounds="true" + android:contentDescription="@string/video_answer" + android:scaleType="centerInside" + android:src="@drawable/answer"/> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/video_answer"/> + + </LinearLayout> + + </LinearLayout> + +</RelativeLayout> \ No newline at end of file diff --git a/HDL-ON_Android/Resources/layout/fragment_monitor.xml b/HDL-ON_Android/Resources/layout/fragment_monitor.xml new file mode 100644 index 0000000..d5a285b --- /dev/null +++ b/HDL-ON_Android/Resources/layout/fragment_monitor.xml @@ -0,0 +1,63 @@ +锘�<?xml version="1.0" encoding="UTF-8" ?> +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <LinearLayout + android:id="@+id/icon_sceenshotLayout" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="center" + android:layout_marginStart="60dp" + android:layout_marginTop="60dp" + android:orientation="vertical"> + + <ImageView + android:id="@+id/icon_sceenshotImg" + android:layout_width="66dp" + android:layout_height="66dp" + android:contentDescription="@string/video_screenshot" + android:adjustViewBounds="true" + android:scaleType="centerInside" + android:src="@drawable/screenshot"/> + + <TextView + android:id="@+id/icon_sceenshotText" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="19dp" + android:text="@string/video_screenshot"/> + + </LinearLayout> + + <LinearLayout + android:id="@+id/icon_unlockLayout" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="center" + android:layout_alignParentEnd="true" + android:layout_marginEnd="60dp" + android:layout_marginTop="60dp" + android:orientation="vertical"> + + <ImageView + android:id="@+id/icon_unlockImg" + android:layout_width="66dp" + android:layout_height="66dp" + android:contentDescription="@string/video_unlock" + android:adjustViewBounds="true" + android:scaleType="centerInside" + android:src="@drawable/unlock"/> + + <TextView + android:id="@+id/icon_unlockText" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="19dp" + android:text="@string/video_unlock"/> + + </LinearLayout> + +</RelativeLayout> + diff --git a/HDL-ON_Android/Resources/values-zh/strings.xml b/HDL-ON_Android/Resources/values-zh/strings.xml new file mode 100644 index 0000000..9a13152 --- /dev/null +++ b/HDL-ON_Android/Resources/values-zh/strings.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<resources> + <string name="app_name">HDL_ON_Pro</string> + <string name="action_settings">璁剧疆</string> + <string name="video_screenshot">鎴浘</string> + <string name="video_unlock">寮�閿�</string> + <string name="video_answer">鎺ュ惉</string> + <string name="video_not_answer">鎷掓帴</string> + <string name="video_tip">鎻愮ず</string> + <string name="video_hang_up">宸叉寕鏂�</string> + <string name="video_confirm">纭畾</string> + <string name="video_icon">鍥炬爣</string> + <string name="video_device">璁惧</string> + <string name="video_success">鎴愬姛</string> + <string name="video_fail">澶辫触</string> + <string name="calling">鏉ョ數涓�...</string> + <string name="end_call">閫氳瘽缁撴潫</string> + <string name="on_the_phone">閫氳瘽涓�...</string> + <string name="unlock_success">寮�閿佹垚鍔�</string> + <string name="screenshot_success">鎴浘鎴愬姛</string> +</resources> \ No newline at end of file diff --git a/HDL-ON_Android/Resources/values/colors.xml b/HDL-ON_Android/Resources/values/colors.xml index bf1bf20..df49583 100644 --- a/HDL-ON_Android/Resources/values/colors.xml +++ b/HDL-ON_Android/Resources/values/colors.xml @@ -1,6 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> <resources> - <color name="colorPrimary">#2c3e50</color> - <color name="colorPrimaryDark">#1B3147</color> - <color name="colorAccent">#3498db</color> + <color name="colorPrimary">#2c3e50</color> + <color name="colorPrimaryDark">#1B3147</color> + <color name="colorAccent">#3498db</color> + <color name="colorBlack">#FF000000</color> + <color name="color_white">#FFFFFF</color> + <color name="color_disable">#CCCCCC</color> + <color name="color_select">#FB744A</color> + <color name="color_default">#FF333333</color> </resources> \ No newline at end of file diff --git a/HDL-ON_Android/Resources/values/dimens.xml b/HDL-ON_Android/Resources/values/dimens.xml index f978eb2..edba492 100644 --- a/HDL-ON_Android/Resources/values/dimens.xml +++ b/HDL-ON_Android/Resources/values/dimens.xml @@ -1,4 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <resources> <dimen name="fab_margin">16dp</dimen> + <dimen name="titleTextSize">25sp</dimen> + <dimen name="tipTextSize">14sp</dimen> + <dimen name="tipTitleTextSize">16sp</dimen> </resources> \ No newline at end of file diff --git a/HDL-ON_Android/Resources/values/strings.xml b/HDL-ON_Android/Resources/values/strings.xml index afeb4af..00d8ad7 100644 --- a/HDL-ON_Android/Resources/values/strings.xml +++ b/HDL-ON_Android/Resources/values/strings.xml @@ -1,5 +1,21 @@ <?xml version="1.0" encoding="UTF-8"?> <resources> - <string name="app_name">HDL_ON_Pro</string> - <string name="action_settings">Settings</string> + <string name="action_settings">Setting</string> + <string name="video_screenshot">Screenshot</string> + <string name="video_unlock">Unlock</string> + <string name="video_answer">Answer</string> + <string name="video_not_answer">Reject</string> + <string name="video_tip">Prompt</string> + <string name="video_hang_up">Hang up</string> + <string name="video_confirm">Confirm</string> + <string name="video_icon">Icon</string> + <string name="video_device">Device</string> + <string name="video_success">Success</string> + <string name="video_fail">Fail</string> + <string name="calling">Calling...</string> + <string name="end_call">End of call</string> + <string name="on_the_phone">On the phone</string> + <string name="unlock_success">Unlock successfully</string> + <string name="screenshot_success">Screenshot successfully</string> + </resources> \ No newline at end of file diff --git a/HDL-ON_Android/Resources/values/styles.xml b/HDL-ON_Android/Resources/values/styles.xml index 0c9d062..febc1ce 100644 --- a/HDL-ON_Android/Resources/values/styles.xml +++ b/HDL-ON_Android/Resources/values/styles.xml @@ -1,24 +1,40 @@ <?xml version="1.0" encoding="UTF-8"?> <resources> - <!-- 鍏朵腑parent鍙互涓� android:Theme 鎴� android:Theme.NoTitleBar; android:windowBackground鍙互涓鸿儗鏅浘 --> - <style name="MyTheme" parent="@android:style/Theme.NoTitleBar.Fullscreen"> - <item name="android:windowBackground">@drawable/Loading</item> - <!-- 闅愯棌鐘舵�佹爮 --> - <item name="android:windowFullscreen">false</item> - <!-- 闅愯棌鏍囬鏍� --> - <item name="android:windowNoTitle">true</item> - <item name="android:windowTranslucentStatus">true</item> - </style> - - <style name="MyDialogStyle"> - <item name="android:windowBackground">@android:color/transparent</item> - <item name="android:windowFrame">@null</item> - <item name="android:windowNoTitle">true</item> - <item name="android:windowIsFloating">true</item> - <item name="android:windowIsTranslucent">true</item> - <item name="android:windowContentOverlay">@null</item> - <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item> - <item name="android:backgroundDimEnabled">true</item> - </style> - + <!-- 鍏朵腑parent鍙互涓� android:Theme 鎴� android:Theme.NoTitleBar; android:windowBackground鍙互涓鸿儗鏅浘 --> + <style name="MyTheme" parent="@android:style/Theme.NoTitleBar.Fullscreen"> + <item name="android:windowBackground">@drawable/Loading</item> + <!-- 闅愯棌鐘舵�佹爮 --> + <item name="android:windowFullscreen">false</item> + <!-- 闅愯棌鏍囬鏍� --> + <item name="android:windowNoTitle">true</item> + <item name="android:windowTranslucentStatus">true</item> + </style> + <style name="MyDialogStyle"> + <item name="android:windowBackground">@android:color/transparent</item> + <item name="android:windowFrame">@null</item> + <item name="android:windowNoTitle">true</item> + <item name="android:windowIsFloating">true</item> + <item name="android:windowIsTranslucent">true</item> + <item name="android:windowContentOverlay">@null</item> + <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item> + <item name="android:backgroundDimEnabled">true</item> + </style> + <style name="DialogTheme" parent="@android:style/Theme.Dialog"> + <!-- 鑳屾櫙棰滆壊鍙婂拰閫忔槑绋嬪害 --> + <item name="android:windowBackground">@android:color/transparent</item> + <!-- 鏄惁鍘婚櫎鏍囬 --> + <item name="android:windowNoTitle">true</item> + <!-- 鏄惁鍘婚櫎杈规 --> + <item name="android:windowFrame">@null</item> + <!-- 鏄惁娴幇鍦╝ctivity涔嬩笂 --> + <item name="android:windowIsFloating">true</item> + </style> + <style name="MyTheme1" parent="Theme.AppCompat.Light.NoActionBar"> + <item name="android:windowBackground">@drawable/Loading</item> + <!-- 闅愯棌鐘舵�佹爮 --> + <item name="android:windowFullscreen">false</item> + <!-- 闅愯棌鏍囬鏍� --> + <item name="android:windowNoTitle">true</item> + <item name="android:windowTranslucentStatus">false</item> + </style> </resources> \ No newline at end of file diff --git a/HDL-ON_Android/VideoActivity.cs b/HDL-ON_Android/VideoActivity.cs new file mode 100644 index 0000000..1a9cf00 --- /dev/null +++ b/HDL-ON_Android/VideoActivity.cs @@ -0,0 +1,449 @@ +锘� +using System; +using System.Collections.Generic; +using System.Threading; +using Android; +using Android.App; +using Android.Content; +using Android.Content.PM; +using Android.Graphics; +using Android.OS; +using Android.Runtime; +using Android.Support.V4.App; +using Android.Support.V4.Content; +using Android.Util; +using Android.Views; +using Android.Widget; +using Com.ETouchSky; +using Com.Tool; +using GateWay.Droid.FengLinVideo.widget; +using HDL_ON.Common; +using HDL_ON.DAL.Server; +using HDL_ON_Android.FengLinVideo.Form; + +namespace HDL_ON_Android +{ + [Activity(Label = "VideoActivity", WindowSoftInputMode = SoftInput.AdjustResize, LaunchMode = LaunchMode.SingleInstance, ConfigurationChanges = (ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.LayoutDirection | ConfigChanges.Locale | ConfigChanges.Orientation | ConfigChanges.ScreenSize), Theme = "@style/MyTheme1", ScreenOrientation = ScreenOrientation.Portrait)] + public class VideoActivity : Activity, View.IOnClickListener, ISurfaceHolderCallback, VideoPhoneJni.ICallBack, TipDiaglog.OnConfirmClickListener + { + private static Activity activity; + private VideoPhone mPhone; + private ISurfaceHolder mRemoteSurfaceHolder; + private FrameLayout mRemoteFrameContainer; + private SurfaceView mSurfaceRemote; + + private ImageView ivBack; + private TextView tvName; + private MonitorFragment monitorFragment = null; + private ReverseCallFragment reverseCallFragment = null; + + public static string ESVideoUUID = "JJY000019VPLLF";//瀹ゅ鏈篣UID锛屼緥:JJY000007FSEYX f5f6fa + public static string DeviceName;//瀹ゅ鏈虹殑鍚嶇О锛屼緥锛屽澶栨満 + public static bool IsCollect;//鏄惁鏀惰棌 + public static int Tpye = 0;//绫诲瀷锛�0 鐩戞帶锛�1鍙嶅懠 + + public static string UUId; + public static int CallId;//callId 鍛煎彨璁板綍id + public static string CmtID;//cmtID 涓版灄绀惧尯鍙� + public static string Roomno;//roomno 涓版灄鎴块棿鍙� + public static string Unitno;//unitno 涓版灄妤兼爧鍙� string + public static string HomeID;//HomeID 涓版灄浣忓畢id + + protected override void OnCreate(Bundle savedInstanceState) + { + base.OnCreate(savedInstanceState); + + try + { + activity = this; + + ESVideoUUID = Intent.GetStringExtra("ESVideoUUID");//瀹ゅ鏈篣UID锛屼緥:JJY000007FSEYX + DeviceName = Intent.GetStringExtra("DeviceName");//瀹ゅ鏈虹殑鍚嶇О锛屼緥锛屽澶栨満 + UUId = Intent.GetStringExtra("uuid");// + CallId = Intent.GetIntExtra("callId", 0); + CmtID = Intent.GetStringExtra("cmtID"); + Roomno = Intent.GetStringExtra("roomno"); + Unitno = Intent.GetStringExtra("unitno"); + HomeID = Intent.GetStringExtra("HomeID"); + + IsCollect = Intent.GetBooleanExtra("IsCollect", false);//鏄惁鏀惰棌 + Tpye = Intent.GetIntExtra("Type", 0);//绫诲瀷锛�0 鐩戞帶锛�1鍙嶅懠 + + SetContentView(Resource.Layout.activity_video_phone); + + IniView(); + IniData(); + + if (Tpye == 0) + { + Monitor(ESVideoUUID); //鐩戞帶 + + monitorFragment = new MonitorFragment(mPhone); + FragmentManager.BeginTransaction().Replace(Resource.Id.content, monitorFragment).Commit(); + } + else + { + string param = "address=" + ESVideoUUID + ",tag=mobile://123,"; + reverseCallFragment = new ReverseCallFragment(mPhone, param); + FragmentManager.BeginTransaction().Replace(Resource.Id.content, reverseCallFragment).Commit(); + } + } + catch {} + } + + /// <summary> + /// 蹇呰鐨勪竴浜涙潈闄� + /// </summary> + private void Permissions() + { + String[] mPermissionList = new String[] + { + Manifest.Permission.WriteExternalStorage, + Manifest.Permission.ReadExternalStorage, + Manifest.Permission.Camera, + Manifest.Permission.RecordAudio + }; + + foreach (String permissions in mPermissionList) + { + if (ContextCompat.CheckSelfPermission(this, permissions) != 0) + { + ActivityCompat.RequestPermissions(this, new string[] { permissions }, 1); + } + } + } + + /// <summary> + /// 闅愯棌搴曢儴瀵艰埅鏍忊�斺�旇櫄鎷熸寜閿� + /// </summary> + private void HideVirtualButtons() + { + WindowManagerLayoutParams windowManager = Window.Attributes; + var uiOptions = (int)Window.DecorView.SystemUiVisibility; + var newUiOptions = (int)uiOptions; + newUiOptions = (int)SystemUiFlags.HideNavigation | (int)SystemUiFlags.Immersive | (int)SystemUiFlags.ImmersiveSticky; + windowManager.SystemUiVisibility = (StatusBarVisibility)newUiOptions; + Window.Attributes = windowManager; + } + + /// <summary> + /// 鐩戞帶 + /// </summary> + /// <param name="address"></param> + private void Monitor(string address) + { + //鐩戣鍔熻兘 浠庡钩鍙版媺鍙栫洃瑙嗗垪琛紝璋冪敤姝ゆ帴鍙e彲浠ヤ竴鍙颁竴鍙扮洃瑙� + if (mPhone != null) + { + //姝ゅ弬鏁� 鍙互鍚戦棬鍙f満璁惧浼犻�掓暟鎹紝 + //娉ㄦ剰锛歊equestAudio 璇锋眰瀵规柟闊抽锛孯equestVideo璇锋眰瀵规柟瑙嗛 SendAudio鍙戦�佹湰鍦伴煶棰� SendVideo 鍙戦�佹湰鍦拌棰� 涓�鑸棬鍙d笉鎺ユ敹鍒拌棰戯紝鎵�浠ユ渶濂借缃�0锛屽噺灏戞祦閲忔秷鑰� + string UserData = ""; + string param = "SendAudio=0\r\n" + "SendVideo=0\r\n" + "RequestAudio=0\r\n" + "RequestVideo=0\r\n" + "UserData=" + UserData + "\r\n"; + mPhone.Monitor(address, param); + } + } + + private void IniView() + { + mRemoteFrameContainer = (FrameLayout)FindViewById(Resource.Id.remoteFrame); + + ivBack = (ImageView)FindViewById(Resource.Id.videoBackImg); + tvName = (TextView)FindViewById(Resource.Id.nameText); + + tvName.SetText(DeviceName, null); + + ivBack.SetOnClickListener(this); + } + + private void IniData() + { + try + { + if (mPhone == null) + { + string _params = "port=8554\r\n" + "packcode=1021df37c2abe546a4541ca2c4a9c910\r\n"; //鍒濆鍖栧璁茬鍙o紝榛樿灏卞ソ锛岃窡闂ㄥ彛鏈鸿缃鍖归厤,娉ㄦ剰鏂版帴鍙i渶瑕佸鍔爌ackcode鍙傛暟锛岄渶瑕佹妸浣犱滑鐨勫寘鍚嶅彂杩囨潵 + mPhone = new VideoPhone(this, this, _params); + + if (mRemoteSurfaceHolder != null) + { + mPhone.SetRemoteSurfaceHolder(mRemoteSurfaceHolder, "mRemoteSurfaceHolder!=null"); //璁剧疆鏉ョ數绐楀彛 + } + + ViewGroup v = (ViewGroup)FindViewById(Resource.Id.localVideo); + mPhone.SetLocalVideoContainer(v);//璁剧疆鏈湴瑙嗛绐楀彛锛屼竴瀹氳璋冪敤锛屼笉鐒跺悗浼氬嚭鐜版病澹伴煶 + } + else + { + mPhone.StopStream(); + mPhone.Release(); + mPhone = null; + } + } + catch { } + } + + protected override void OnResume() + { + base.OnResume(); + + HideVirtualButtons(); + + Permissions(); + + if (mPhone != null) + { + mPhone.OnActivityResume(); + } + } + + protected override void OnPause() + { + base.OnPause(); + if (mPhone != null) + { + //mPhone.OnActivityPause(); + } + } + + protected override void OnDestroy() + { + base.OnDestroy(); + if (mPhone != null) + { + mPhone.HangUp(); + mPhone.Release(); + mPhone = null; + //mPhone.OnActivityDestroy(); + } + } + + public override void OnBackPressed() + { + if (mPhone != null) + mPhone.HangUp(); + + Finish(); + } + + public void OnClick(View v) + { + if (v.Equals(ivBack)) + { + if (mPhone != null) + mPhone.HangUp(); + + Finish(); + } + } + + /// <summary> + /// show鍑鸿棰戠敾闈� + /// 涓嶈兘鐢╒iew.INVISIBLE鏉ュ畬鍏ㄩ殣钘�,鍚﹀垯MediaCodec.configure浼氭姤ava.lang.IllegalArgumentException: The surface has been released + /// </summary> + private void ShowRemoteVideo() + { + try + { + if (mSurfaceRemote != null) + { + return; + } + mSurfaceRemote = new SurfaceView(this, null); + ISurfaceHolder holder = mSurfaceRemote.Holder; + holder.AddCallback(this);//ISurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS + holder.SetType(SurfaceType.PushBuffers); + + //鍙戠幇绗竴娆how鏃朵細闂睆涓�涓嬶紝鍚庨潰hide鍐峴how鏃朵笉浼氶棯灞� + FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); + //v.setId(View.generateViewId()); + mSurfaceRemote.LayoutParameters = lp; + mRemoteFrameContainer.AddView(mSurfaceRemote); + } + catch { } + } + + /// <summary> + /// 鍏抽棴鐢婚潰 + /// </summary> + private void HideRemoteVideo() + { + try + { + if (mSurfaceRemote != null) + { + mRemoteFrameContainer.RemoveView(mSurfaceRemote); + mSurfaceRemote = null; + } + } + catch { } + } + + /// <summary> + /// 寮瑰嚭宸叉寕鏂彁绀� + /// </summary> + private void ShowTipDialog(string title, string text, string btnText, bool isClose) + { + try + { + TipDiaglog diaglog = new TipDiaglog(this); + diaglog.SetAutoClose(isClose); + diaglog.SetTitleText(title);//"鎻愮ず" + diaglog.SetContentText(text);//"宸叉寕鏂�" + diaglog.SetConfirmText(btnText);//"纭" + diaglog.SetCanceledOnTouchOutside(false); + diaglog.Show(); + diaglog.Create(); + diaglog.SetConfirmClickListener(this); + } + catch (Exception e) + { + string ss = e.Message; + } + } + + public void SurfaceChanged(ISurfaceHolder holder, [GeneratedEnum] Format format, int width, int height) + { + mRemoteSurfaceHolder = holder; + if (mPhone != null) + { + mPhone.SetRemoteSurfaceHolder(holder, "surfaceChanged"); + } + } + + public void SurfaceCreated(ISurfaceHolder holder) + { + mRemoteSurfaceHolder = holder; + if (mPhone != null) + { + mPhone.SetRemoteSurfaceHolder(holder, "surfaceCreated"); + } + } + + public void SurfaceDestroyed(ISurfaceHolder holder) + { + mRemoteSurfaceHolder = null; + if (mPhone != null) + { + mPhone.SetRemoteSurfaceHolder(null, "surfaceDestroyed"); + } + } + + /// <summary> + /// 寮�濮嬫媺娴� + /// 娉ㄦ剰锛氱敱浜巃ndroid妗嗘灦闄愬埗锛岃婊¤冻濡備笅鏉′欢鎵嶈兘寮�娴�:activity瑕佸湪鍓嶅彴锛屽苟涓攕urfaceview鍙敤 + /// </summary> + /// <param name="reason"></param> + private void StartStream(String reason) + { + if (mPhone != null) + { + try + { + //寮�娴佷箣鍓嶅彲閰嶇疆瑙嗛灏哄锛岀爜鐜囷紝甯х巼 閽堝鐨勬槸鏈湴 + //mPhone.SetVideoSize(640, 480);//1920x1080,1280x720,640x480 + //mPhone.SetBps(1.5 * 1024 * 1024); + //mPhone.SetFps(30); + mPhone.StartStream(); + } + catch { } + } + } + + /// <summary> + /// 閫氳瘽鐘舵�佸洖璋冩柟娉� + /// </summary> + /// <param name="msg"></param> + public void OnPhoneEvent(string msg) + { + try + { + if (monitorFragment != null) + { + monitorFragment.OnPhoneEvent(msg); + } + + if (reverseCallFragment != null) + { + reverseCallFragment.OnPhoneEvent(msg); + } + + TextProtocol tp = new TextProtocol(); + tp.Parse(msg); + string event1 = tp.GetString("event"); + Log.Info("FengLinVideo", "OnPhoneEvent event=" + event1); + switch (event1) + { + case "EVT_Ringing": + mPhone.RequestCallerSendVideo(); + ShowRemoteVideo(); + break; + case "EVT_Connected": + if (!mPhone.IsStreamRunning) + { + //鐢变簬android妗嗘灦闄愬埗锛岃婊¤冻濡備笅鏉′欢鎵嶈兘寮�娴�: activity瑕佸湪鍓嶅彴锛屽苟涓攕urfaceview鍙敤 + StartStream("EVT_Connected"); + } + ShowRemoteVideo(); + break; + case "EVT_StartStream": + StartStream("EVT_StreamStream"); + break; + case "EVT_StopStream": + mPhone.StopStream(); + break; + case "EVT_MonitorConnected": + if (!mPhone.IsStreamRunning) + { + StartStream("EVT_MonitorConnected"); + } + ShowRemoteVideo(); + break; + case "EVT_HangUp": + HideRemoteVideo(); + if (mPhone != null) + { + mPhone.StopStream(); + } + //Toast.MakeText(this, GetString(Resource.String.end_call), ToastLength.Short).Show(); + this.Finish(); + //ShowTipDialog(tip, hang_up, confirm, true); + break; + case "EVT_RECV_CUSTOM_DATA": + string data = tp.GetString("data"); + Toast.MakeText(this, GetString(Resource.String.video_success), ToastLength.Short).Show(); + break; + case "EVT_SnapAck": + int error = tp.GetInt("error"); + string filePath = tp.GetString("filePath"); + if (error == 0) + { + Toast.MakeText(this, GetString(Resource.String.video_success), ToastLength.Short).Show(); + } + else + { + Toast.MakeText(this, GetString(Resource.String.video_fail), ToastLength.Short).Show(); + } + break; + } + } + catch { } + } + + public void OnRecvAudioFrame(byte[] p0) + { + //throw new NotImplementedException(); + } + + public void OnRecvVideoFrame(byte[] p0) + { + //throw new NotImplementedException(); + } + + public void onSureClick(TipDiaglog dialoog, View v, bool bol) + { + dialoog.Dismiss(); + if (bol) + this.Finish(); + } + } +} \ No newline at end of file diff --git a/HDL_ON/Common/FileUtlis.cs b/HDL_ON/Common/FileUtlis.cs index 63a3e07..a77e0ae 100644 --- a/HDL_ON/Common/FileUtlis.cs +++ b/HDL_ON/Common/FileUtlis.cs @@ -6,7 +6,7 @@ namespace HDL_ON.Common { - public class FileUtlis + public class FileUtlis { static Common.FileUtlis _temp; public static Common.FileUtlis Files @@ -26,7 +26,8 @@ string RootPath = Environment.GetFolderPath(System.Environment.SpecialFolder.Personal) + "/"; string accountPath; - string AccountPath { + string AccountPath + { get { if (string.IsNullOrEmpty(accountPath) || !accountPath.Contains(UserInfo.Current.ID)) @@ -48,11 +49,11 @@ { get { - if(DB_ResidenceData.Instance.CurrentRegion == null || DB_ResidenceData.Instance.CurrentRegion.RegionID == null) + if (DB_ResidenceData.Instance.CurrentRegion == null || DB_ResidenceData.Instance.CurrentRegion.RegionID == null) { return AccountPath; } - if (string.IsNullOrEmpty(regionPath) || !regionPath.Contains(DB_ResidenceData.Instance.CurrentRegion.RegionID )) + if (string.IsNullOrEmpty(regionPath) || !regionPath.Contains(DB_ResidenceData.Instance.CurrentRegion.RegionID)) { regionPath = Path.Combine(AccountPath, DB_ResidenceData.Instance.CurrentRegion.RegionID); if (!Directory.Exists(regionPath)) @@ -232,8 +233,6 @@ } } - - public byte[] ReadFile(string fileName) { FileStream fs = null; @@ -275,18 +274,55 @@ } } + // 璇诲彇鎸囧畾璺緞鏂囦欢鍐呭 + public byte[] ReadFileForPath(string path) + { + FileStream fs = null; + try + { + if (File.Exists(path)) + { + fs = new FileStream(path, FileMode.Open, FileAccess.Read); + } + else + { + return new byte[0]; + } + byte[] bytes = new byte[fs.Length]; + fs.Read(bytes, 0, bytes.Length); + return bytes; + } + catch + { + return new byte[0]; + } + finally + { + try + { + if (fs != null) + { + fs.Close(); + } + } + catch + { + } + } + } /// <summary> /// 涓嬭浇缃戠粶鍥剧墖 /// </summary> /// <param name="fileName"></param> /// <param name="url"></param> - public void DownLoadImage(string fileName, string url,Action action) + public void DownLoadImage(string fileName, string url, Action action) { if (!File.Exists(fileName)) { - System.Threading.Tasks.Task.Run(() => { + System.Threading.Tasks.Task.Run(() => + { FileStream fs = null; try { @@ -297,7 +333,8 @@ fs.Write(recevieBytes, 0, recevieBytes.Length); fs.Flush(); } - catch (Exception ex) { + catch (Exception ex) + { MainPage.Log($"down image : {ex.Message}"); } finally @@ -309,7 +346,8 @@ } } }); - }else + } + else { action?.Invoke(); } diff --git a/HDL_ON/FengLinVideo/ESOnVideo.cs b/HDL_ON/FengLinVideo/ESOnVideo.cs new file mode 100644 index 0000000..a0c085f --- /dev/null +++ b/HDL_ON/FengLinVideo/ESOnVideo.cs @@ -0,0 +1,134 @@ +锘縰sing System; +using Android.Content; + +namespace HDL_ON.FengLinVideo +{ + public class ESOnVideo + { + /// <summary> + /// 涓版灄鍙瀵硅 + /// </summary> + private static ESOnVideo m_Current = null; + /// <summary> + /// + /// </summary> + public static ESOnVideo Current + { + get + { + if (m_Current == null) + { + m_Current = new ESOnVideo(); + } + return m_Current; + } + } + + public void InitESVideoSDK() + { + //ESVideo. + } + + /// <summary> + /// 鐩戞帶椤甸潰 + /// </summary> + /// <param name="mESVideoInfo"></param> + public void ShowESVideoMonitor(ESVideoInfo mESVideoInfo) + { + + Intent intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.VideoActivity)); + intent.PutExtra("ESVideoUUID", mESVideoInfo.ESVideoUUID); + intent.PutExtra("uuid", mESVideoInfo.uuid); + intent.PutExtra("DeviceName", mESVideoInfo.DeviceName); + intent.PutExtra("cmtID", mESVideoInfo.cmtID); + intent.PutExtra("roomno", mESVideoInfo.roomno); + intent.PutExtra("unitno", mESVideoInfo.unitno); + intent.PutExtra("HomeID", mESVideoInfo.HomeID); + intent.PutExtra("callId", mESVideoInfo.callId); + intent.PutExtra("Type", 0); + Shared.Application.Activity.StartActivity(intent); + + } + + /// <summary> + /// 琚懠鍙〉闈� + /// </summary> + /// <param name="mESVideoInfo"></param> + public void ShowESvideoVideoIntercom(ESVideoInfo mESVideoInfo) + { + + Intent intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.VideoActivity)); + intent.PutExtra("ESVideoUUID", mESVideoInfo.ESVideoUUID); + intent.PutExtra("uuid", mESVideoInfo.uuid); + intent.PutExtra("DeviceName", mESVideoInfo.DeviceName); + intent.PutExtra("cmtID", mESVideoInfo.cmtID); + intent.PutExtra("roomno", mESVideoInfo.roomno); + intent.PutExtra("unitno", mESVideoInfo.unitno); + intent.PutExtra("HomeID", mESVideoInfo.HomeID); + intent.PutExtra("callId", mESVideoInfo.callId); + intent.PutExtra("Type", 1); + Shared.Application.Activity.StartActivity(intent); + } + + /// <summary> + /// 娴嬭瘯鏂规硶 + /// </summary> + /// <param name="isMonitor"></param> + public void Test(bool isMonitor = true) + { + ESVideoInfo eSVideoInfo = new ESVideoInfo() + { + DeviceName = "瀹ゅ鏈�88", + ESVideoUUID = "JJY000019VPLLF", + }; + if (isMonitor) + { + ShowESVideoMonitor(eSVideoInfo); + } + else + { + ShowESvideoVideoIntercom(eSVideoInfo); + } + + } + } + + public class ESVideoInfo + { + /// <summary> + /// 瀹ゅ鏈虹殑UUID + /// 渚嬶細JJY000007FSEYX + /// </summary> + public string ESVideoUUID = string.Empty; + /// <summary> + /// 瀹ゅ鏈虹殑鍚嶇О + /// 渚嬶細瀹ゅ鏈� + /// </summary> + public string DeviceName = string.Empty; + /// <summary> + /// 涓版灄璇锋眰鐨勫敮涓�id + /// </summary> + public string uuid; + /// <summary> + /// 涓版灄绀惧尯id + /// </summary> + public string cmtID; + /// <summary> + /// 涓版灄鎴块棿鍙� + /// </summary> + public string roomno; + /// <summary> + /// 涓版灄妤兼爧鍙� + /// </summary> + public string unitno; + /// <summary> + /// 涓版灄浣忓畢Id + /// </summary> + public string HomeID; + /// <summary> + /// 鍛煎彨璁板綍Id + /// </summary> + public string callId; + + } +} \ No newline at end of file diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems index 67e6d7f..254974f 100644 --- a/HDL_ON/HDL_ON.projitems +++ b/HDL_ON/HDL_ON.projitems @@ -389,6 +389,7 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\SetPir.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\1ContorlPage\AcControlPage_AddIrButton.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\Send.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)FengLinVideo\ESOnVideo.cs" /> </ItemGroup> <ItemGroup> <Folder Include="$(MSBuildThisFileDirectory)DAL\" /> diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs index f0747c8..af3f042 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs @@ -5,6 +5,7 @@ using System.Text; using HDL_ON.DAL.Server; using System.Threading.Tasks; +using HDL_ON.FengLinVideo; namespace HDL_ON.UI { @@ -71,6 +72,19 @@ }; bodyView.AddChidren(btnOnTitle); +#if DEBUG + btnOnIcon.MouseUpEventHandler += (sender, e) => + { + ESOnVideo.Current.Test(); + }; + + btnOnTitle.MouseUpEventHandler += (sender, e) => + { + ESOnVideo.Current.Test(false); + }; + +#endif + Button btnOnVersion = new Button() { Y = btnOnTitle.Bottom, -- Gitblit v1.8.0