From 675df74cdd4103ffdcbfa0a6ccfc105fd61af15a Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 29 十月 2021 15:44:18 +0800
Subject: [PATCH] 2021-10-29 1.更新乐橙 AndroidSDK
---
HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs | 130 +++++++++++++++++++++++++++----------------
1 files changed, 81 insertions(+), 49 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs
index 3271e9e..6d0dd75 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs
@@ -4,6 +4,7 @@
using Shared;
using HDL_ON.Stan;
using ZXing.QrCode.Internal;
+using static HDL_ON.UI.UI2.FuntionControlView.Video.VideoMethod;
namespace HDL_ON.UI.UI2.FuntionControlView.Video
{
@@ -12,10 +13,9 @@
/// <summary>
/// 鍔犺浇鍙瀵硅UI
/// </summary>
- /// <param name="listVideo">闂ㄥ彛鏈哄垪琛�</param>
/// <param name="listCall">閫氳瘽璁板綍鍒楄〃</param>
- /// <param name="video">褰撳墠鐨勫彲瑙嗗璁�</param>
- public void Show(List<FlVideo> listVideo, List<CallView> listCall, VideoClouds video)
+ /// <param name="videoList">鍙瀵硅鍒楄〃</param>
+ public void Show(List<CallView> listCall, List<Video> videoList)
{
#region 甯冨眬鐣岄潰
this.BackgroundColor = MusicColor.ViewColor;
@@ -35,8 +35,8 @@
pageView.AddChidren(view1);
var view2 = new FrameLayout();
pageView.AddChidren(view2);
- View1(view1, listVideo, video);
- View2(view2, listCall, video);
+ View1(view1, videoList);
+ View2(view2, listCall, videoList);
Button btn11 = new Button
{
X = Application.GetRealWidth(170),
@@ -107,14 +107,16 @@
};
#endregion
}
+
/// <summary>
/// 绗竴涓晫闈�
/// </summary>
/// <param name="view1">鐖舵帶浠�</param>
- /// <param name="list">闂ㄥ彛鏈哄垪琛�</param>
- /// <param name="videoClouds">褰撳墠鐨勫彲瑙嗗璁�</param>
- void View1(FrameLayout view1, List<FlVideo> list, VideoClouds videoClouds)
+ /// <param name="video">鍙瀵硅瀵硅薄</param>
+ void View1(FrameLayout view1, List<Video> videoList)
{
+
+
#region 甯冨眬鐣岄潰
var bjFl = new FrameLayout
{
@@ -188,23 +190,25 @@
Width = Application.GetRealWidth(327),
};
bjFl.AddChidren(vv);
- if (list.Count > 0)
+
+ bool bol = haveFlVideo(videoList);
+ if (bol)
{
//闂ㄧ浜岀淮鐮佸浐瀹氭湁鐨�,铏氭嫙涓�涓嚭鏉�
- list.Add(new FlVideo { aliasName = Language.StringByID(StringId.menjinerweima), devType = "100" });
+ videoList.Add(new Video { deviceName = Language.StringByID(StringId.menjinerweima), interphoneType = "100" });
}
//鏁扮粍涓暟
//int value = 15;
//鍏堣绠楁暟鎹墍闇�瑕佺殑寰堥珮搴︼紱
int l = 0;
- if (list.Count % 3 == 0)
+ if (videoList.Count % 3 == 0)
{
- l = list.Count / 3;
+ l = videoList.Count / 3;
}
else
{
- l = (list.Count / 3) + 1;
+ l = (videoList.Count / 3) + 1;
}
var fL = new FrameLayout
{
@@ -214,23 +218,22 @@
vv.AddChidren(fL);
int line = 0;
#endregion
- for (int i = 1, j = 0; i <= list.Count; i++, j++)
+ for (int i = 1, j = 0; i <= videoList.Count; i++, j++)
{
- var video = list[i - 1];
+ var video = videoList[i - 1];
#region
var fLayout = new FrameLayout
{
- Width = Application.GetRealWidth(50),
+ Width = Application.GetRealWidth(96),
Height = Application.GetRealWidth(48),
- X = Application.GetRealWidth(31 + (58 + 50) * j),
+ X = Application.GetRealWidth(20 + (26 + 28 + 42) * j),
Y = Application.GetRealHeight(20 + (48 + 24) * line),
-
};
fL.AddChidren(fLayout);
var iconBtn = new Button
{
- X = Application.GetRealWidth(11),
+ Gravity=Gravity.CenterHorizontal,
Width = Application.GetRealWidth(28),
Height = Application.GetRealWidth(28),
UnSelectedImagePath = "VideoIcon/weiqiangji.png",
@@ -240,12 +243,13 @@
var deviceNameBtn = new Button
{
Y = iconBtn.Bottom + Application.GetRealHeight(6),
- Width = Application.GetRealWidth(50),
+ X = Application.GetRealWidth(6),
+ Width = Application.GetRealWidth(96-12),
Height = Application.GetRealHeight(14),
TextSize = TextSize.Text10,
TextColor = CSS.CSS_Color.TextualColor,
TextAlignment = TextAlignment.Center,
- Text = video.aliasName,
+ Text = video.deviceName,
};
fLayout.AddChidren(deviceNameBtn);
@@ -263,11 +267,11 @@
//闂ㄥ彛鏈虹殑鐐瑰嚮浜嬩欢
clickBtn.MouseUpEventHandler += (sender, e) =>
{
- var flVideo = clickBtn.Tag as FlVideo;
- if (flVideo.devType == "100")
+ var video2 = clickBtn.Tag as Video;
+ if (video2.devType == "100")
{
//闂ㄧ浜岀淮鐮佸浐瀹氭湁鐨�
- VideoSend.GetQRcode(this, videoClouds, (tag, paw) =>
+ VideoSend.GetQRcode(this, video2, (tag, paw) =>
{
if (tag)
{
@@ -279,36 +283,46 @@
}
else
{
- if (string.IsNullOrEmpty(flVideo.uuid))
+
+ if (string.IsNullOrEmpty(video.deviceId))
{
new Intelligence.Automation.LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.peizhicanshuyouyichang));
return;
}
+
+ //Unitno = Intent.GetStringExtra("unitno");
+ //HomeID = Intent.GetStringExtra("HomeID");
+
+
ESVideoInfo eSVideoInfo = new ESVideoInfo
{
- ESVideoUUID = getUuid(flVideo.uuid),
- DeviceName = flVideo.aliasName,
- roomno = videoClouds.flRoomId,
- unitno = videoClouds.flBuildingId,
+ ESVideoUUID = getUuid(video.deviceId),
+ DeviceName = video.deviceName,
+ roomno = video.flRoomBindVO.flRoomId,
+ unitno = video.flRoomBindVO.flBuildingId,
+ uuid = getUuid(video.deviceId),
+ cmtID = video.flRoomBindVO.flCmtId,
+ Lc_AccessToken = video.subAccountToken,
+ Lc_DeviceId = video.deviceId,
+ Lc_Psk = video.deviceId,//2021-10-15 PSK瀛楁涓嶈兘鍙杁eviceName
+ Lc_PlayToken = video.playToken,
+ deviceSipAccount = video.deviceSipAccount,
+ HomeId = video.homeId
};
- ESOnVideo.Current.ShowESVideoMonitor(eSVideoInfo);
+ ESOnVideo.Current.ShowESVideoMonitor(eSVideoInfo, video.interphoneType);
}
-
-
};
}
-
-
}
+
/// <summary>
/// 绗簩涓晫闈�
/// </summary>
/// <param name="view2">鐖舵帶浠�</param>
/// <param name="listCall">閫氳瘽璁板綍鍒楄〃</param>
- /// <param name="video">褰撳墠鐨勫彲瑙嗗璁�</param>
- void View2(FrameLayout view2, List<CallView> listCall, VideoClouds video)
+ /// <param name="videoList">鍙瀵硅鍒楄〃</param>
+ void View2(FrameLayout view2, List<CallView> listCall, List<Video> videoList)
{
-
var bjFl = new FrameLayout
{
Y = Application.GetRealHeight(24),
@@ -347,20 +361,20 @@
TextAlignment = TextAlignment.CenterLeft,
TextID = StringId.baolu30,
};
- //bjFl.AddChidren(regionBtn);
+ bjFl.AddChidren(regionBtn);
var vv = new VerticalRefreshLayout
{
X = Application.GetRealWidth(16),
- Y = Application.GetRealHeight(58),
- Height = Application.GetRealHeight(458),
+ Y = Application.GetRealHeight(58 + 17),
+ Height = Application.GetRealHeight(458 - 17),
Width = Application.GetRealWidth(295),
};
bjFl.AddChidren(vv);
vv.BeginHeaderRefreshingAction += () =>
{
VideoMethod videoMethod = new VideoMethod();
- var list = videoMethod.GetCall(video.id);
+ var list = videoMethod.GetCall();
RefreshView(vv, list);
//鍏抽棴鍒锋柊View锛�
vv.EndHeaderRefreshing();
@@ -368,6 +382,7 @@
RefreshView(vv, listCall);
}
+
/// <summary>
/// 閫氳瘽璁板綍鍒锋柊鐣岄潰
/// </summary>
@@ -393,6 +408,7 @@
frameLayout60.btnTime.Text = getTime(call.callTime);
///鍛煎彨鐘舵�侊紙0锛氭湭鎺ワ紱1锛氬凡鎺ワ紱2锛氭嫆鎺ワ級锛涙槸鍚﹀紑閿侊紱
frameLayout60.btnStateText.Text = getStateText(call.callStatus) + "," + getUnlockText(call.isUnlock);
+
}
}
@@ -404,11 +420,11 @@
/// </summary>
/// <param name="flVideo"></param>
/// <param name="iconBtn">鍥炬爣</param>
- private void getIconAndText(FlVideo flVideo, Button iconBtn)
+ private void getIconAndText(Video Video, Button iconBtn)
{
//(1瀹ゅ唴鏈�,2瀹ゅ鏈猴紝3鍥村鏈猴紝4绠$悊鏈�,5浜屾纭鏈�)
string iconstr = "";
- switch (flVideo.devType)
+ switch (Video.devType)
{
case "1":
{
@@ -459,11 +475,9 @@
{
var utcTime = Convert.ToDateTime(str);
var dateTime = TimeZoneInfo.ConvertTimeFromUtc(utcTime, TimeZoneInfo.Local);
- // var monday = dateTime.ToString("MM") + Language.StringByID(StringId.month) + dateTime.ToString("dd") + Language.StringByID(StringId.day);
- var monday = dateTime.ToString("MM") + "/" + dateTime.ToString("dd");
- var time = dateTime.ToString("HH") + ":" + dateTime.ToString("mm");
- return monday + " " + time;
+ return dateTime.ToString("MM-dd HH:mm");
}
+
/// <summary>
/// 鑾峰彇鍛煎彨鐘舵�佹枃鏈�
/// </summary>
@@ -499,14 +513,16 @@
/// <returns></returns>
private string getUnlockText(bool if_bool)
{
+ string s = "";
if (if_bool)
{
- return Language.StringByID(StringId.yikaisuo);
+ s = Language.StringByID(StringId.yikaisuo);
}
else
{
- return Language.StringByID(StringId.weikaisuo);
+ s = Language.StringByID(StringId.weikaisuo);
}
+ return s;
}
/// <summary>
/// 鑾峰彇uuid
@@ -526,6 +542,22 @@
}
}
+
+ //鍒ゆ柇鏄惁鏈� 涓版灄鍙瀵硅
+ private bool haveFlVideo(List<Video> videoList)
+ {
+ bool bol = false;
+
+ for (int i = 0; i < videoList.Count; i++)
+ {
+ var _video = videoList[i];
+ if (_video.interphoneType == "FLVI")
+ return true;
+ }
+
+ return bol;
+ }
+
}
}
--
Gitblit v1.8.0