| | |
| | | FrameLayout controlView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(88), |
| | | Y = Application.GetRealHeight(88 + 10), |
| | | Width = Application.GetRealWidth(327), |
| | | Height = Application.GetRealHeight(526), |
| | | BackgroundImagePath = "Public/Fragmentbg.png", |
| | |
| | | return; |
| | | if (updateTemp.spk == bodyView.function.spk && updateTemp.sid == bodyView.function.sid) |
| | | { |
| | | try |
| | | try |
| | | { |
| | | if (!bodyView.onCurtainAnimation) |
| | | var percent = Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.Percent)); |
| | | bodyView.curtainSeekBar.Progress = percent; |
| | | bodyView.btnProgress.Text = percent + "%"; |
| | | |
| | | var e = Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.Angle)); |
| | | bodyView.angleBar.Progress = e; |
| | | float angle = e - 90; |
| | | bodyView.btnAngle.Text = (e - 0) + "°"; |
| | | foreach (var btn in bodyView.buttons) |
| | | { |
| | | var percent = Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.Percent)); |
| | | bodyView.CurtainAnimation(percent); |
| | | bodyView.btnProgress.Text = percent + "%"; |
| | | |
| | | var e = Convert.ToInt32( updateTemp.GetAttrState(FunctionAttributeKey.Angle)); |
| | | bodyView.angleBar.Progress = e; |
| | | float angle = e - 90; |
| | | bodyView.btnAngle.Text = (e - 0) + "°"; |
| | | foreach (var btn in bodyView.buttons) |
| | | { |
| | | btn.SetRotation(angle); |
| | | } |
| | | |
| | | |
| | | btn.SetRotation(angle); |
| | | } |
| | | } |
| | | catch { } |
| | |
| | | { |
| | | btnCurtainClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | //if (!function.online) |
| | | //{ |
| | | // new Tip() |
| | | // { |
| | | // CloseTime = 1, |
| | | // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | // Direction = AMPopTipDirection.None, |
| | | // }.Show(MainPage.BaseView); |
| | | // return; |
| | | //} |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => |
| | | if (!function.isOnline()) |
| | | { |
| | | btnCurtainClose.IsSelected = false; |
| | | }); |
| | | }) |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnCurtainClose.IsSelected = false; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | function.trait_on_off.curValue = "off"; |
| | | function.SetAttrState(FunctionAttributeKey.Percent, 0); |
| | |
| | | |
| | | btnCurtainStop.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | //if (!function.online) |
| | | //{ |
| | | // new Tip() |
| | | // { |
| | | // CloseTime = 1, |
| | | // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | // Direction = AMPopTipDirection.None, |
| | | // }.Show(MainPage.BaseView); |
| | | // return; |
| | | //} |
| | | onCurtainAnimation = false; |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | onCurtainAnimation = false; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | |
| | | |
| | | btnCurtainOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | //if (!function.online) |
| | | //{ |
| | | // new Tip() |
| | | // { |
| | | // CloseTime = 1, |
| | | // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | // Direction = AMPopTipDirection.None, |
| | | // }.Show(MainPage.BaseView); |
| | | // return; |
| | | //} |
| | | new System.Threading.Thread(() => |
| | | if (!function.isOnline()) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => |
| | |
| | | CurtainAnimation(100); |
| | | }; |
| | | |
| | | //if (function.online) |
| | | if (function.isOnline()) |
| | | { |
| | | btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | | { |