| | |
| | | { |
| | | FrameLayout bodyView; |
| | | |
| | | FrameLayout contentView; |
| | | VerticalScrolViewLayout contentView; |
| | | |
| | | List<IntegratedBrand> brandList; |
| | | |
| | | public BrandListPage() |
| | | { |
| | | bodyView = this; |
| | | brandList = new List<IntegratedBrand>(); |
| | | } |
| | | |
| | | public void LoadPage() |
| | | { |
| | | Action<string,string> action = (s,a) => { |
| | | var page = new AddThirdPartyBrandListpage(); |
| | | var page = new AddThirdPartyBrandListpage(brandList); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | this.RemoveFromParent(); |
| | | }; |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.FunctionBrand)).LoadTopView_AddIcon("3ty",action); |
| | | |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | contentView = new FrameLayout() |
| | | contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(603), |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | |
| | | GetBindList(); |
| | | |
| | | } |
| | | /// <summary> |
| | |
| | | var pack = pm.Get3tyBrandList(); |
| | | if (pack.Code == DAL.Server.StateCode.SUCCESS) |
| | | { |
| | | var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<IntegratedBrand>>(pack.Data.ToString()); |
| | | if (revData.Count > 0) |
| | | brandList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<IntegratedBrand>>(pack.Data.ToString()); |
| | | if (brandList.Count > 0) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | LoadRow(revData); |
| | | LoadRow(); |
| | | }); |
| | | }else |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | void LoadRow(List<IntegratedBrand> brandList) |
| | | void LoadRow() |
| | | { |
| | | contentView.RemoveAll(); |
| | | bool isFrist = true; |
| | | foreach (var brand in brandList) |
| | | { |
| | | FrameLayout row = new FrameLayout() |
| | | var row = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | LineColor = 0x00000000, |
| | | }; |
| | | contentView.AddChidren(row); |
| | | |
| | |
| | | Button btnLine = new Button() |
| | | { |
| | | X = Application.GetRealWidth(56), |
| | | Y = Application.GetRealHeight(49), |
| | | Width = Application.GetRealWidth(303), |
| | | Height = 1, |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | |
| | | Height = Application.GetRealWidth(32), |
| | | Radius = (uint)Application.GetRealWidth(4), |
| | | BackgroundColor = CSS_Color.PromptingColor1 |
| | | //ImagePath = "tuya_logo.png" |
| | | }; |
| | | row.AddChidren(btnIcon); |
| | | Button btnRight = new Button() |
| | |
| | | row.AddChidren(btnName); |
| | | //下载第三方品牌icon |
| | | ImageUtlis.Current.Load3tyBrandIconImages(brand.brandName, brand.brandIcon, btnIcon); |
| | | |
| | | btnName.MouseUpEventHandler = (sender, e) => { |
| | | var page = new DeviceListPage(brand); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | void NotListTipView() |
| | | { |
| | |
| | | |
| | | |
| | | btnAdd.MouseUpEventHandler = (sender, e) => { |
| | | var page = new AddThirdPartyBrandListpage(); |
| | | var page = new AddThirdPartyBrandListpage(brandList); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |