| | |
| | | { |
| | | this.remoteControl = remoteControlEntity; |
| | | } |
| | | |
| | | List<ImageFramlayout> imageFramlayoutList =new List<ImageFramlayout>(); |
| | | /// <summary> |
| | | /// 当前的遥控器对象 |
| | | /// </summary> |
| | |
| | | { |
| | | this.RemoveFromParent(); |
| | | }; |
| | | //收藏点击事件 |
| | | //收藏图标点击事件 |
| | | this.topView.clickSetBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | CommonMethod.Current.MainThread(() => |
| | |
| | | //二级过滤事件 |
| | | horizontalFl.selectKeyAction += (filters) => |
| | | { |
| | | pageNo = 1;//还原页数 |
| | | AddMemoryFilters(filters); |
| | | UpdateData(); |
| | | UpdateData(true); |
| | | }; |
| | | |
| | | } |
| | |
| | | { |
| | | return; |
| | | } |
| | | vv.RemoveAll(); |
| | | vv.RemoveAll(); |
| | | int count = this.mMovieLibraryList == null ? 0 : this.mMovieLibraryList.Count; |
| | | imageFLayout = new CornerFramLayout(343, count * 168, 0); |
| | | vv.AddChidren(imageFLayout); |
| | | imageFLayout.X = Application.GetRealWidth(16); |
| | | imageFLayout.LoadImagePage(this.mMovieLibraryList); |
| | | //imageFLayout.LoadImagePage(this.mMovieLibraryList); |
| | | imageFLayout.LoadImagePage(imageFramlayoutList); |
| | | imageFLayout.AdjustRealHeight(16); |
| | | |
| | | |
| | | //更多的 |
| | | var btnMore = new Button |
| | | { |
| | | Width = Application.GetRealWidth(375), |
| | | Height = Application.GetRealHeight(30), |
| | | TextSize = TextSize.Text14, |
| | | TextColor = MusicColor.TextColor, |
| | | Text = "更多的...", |
| | | TextAlignment = TextAlignment.TopCenter, |
| | | Padding = new Padding(0, 20, 0, 20), |
| | | }; |
| | | vv.AddChidren(btnMore); |
| | | |
| | | btnMore.MouseDownEventHandler += (sender,e) => { |
| | | //主动更新数据 |
| | | UpdateData(false); |
| | | }; |
| | | |
| | | //影片事件 |
| | | imageFLayout.selectImageAction += (movieLibrary) => |
| | | { |
| | | |
| | | CommonMethod.Current.MainThread(() => |
| | | { |
| | | DetailPage detailPage = new DetailPage(remoteControl, movieLibrary); |
| | |
| | | { |
| | | //关闭刷新View; |
| | | vv.EndHeaderRefreshing(); |
| | | UpdateData(); |
| | | //主动更新数据 |
| | | //UpdateData(); |
| | | }; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载图片容器 |
| | | /// </summary> |
| | | /// <param name="movieLibrary">movieLibrary</param> |
| | | private void AddImageFramlayout(MovieLibrary movieLibrary) |
| | | { |
| | | CommonMethod.Current.MainThread(() => |
| | | { |
| | | if (movieLibrary == null) |
| | | { |
| | | return; |
| | | } |
| | | ImageFramlayout imageFram = new ImageFramlayout(); |
| | | //imageFram.AddView(this); |
| | | imageFram.Tag = movieLibrary; |
| | | imageFram.btnName.Text = movieLibrary.name; |
| | | imageFram.btnImage.ImageBytes = movieLibrary.imageBytes; |
| | | imageFram.btnScore.Text = movieLibrary.rating; |
| | | //添加缓存 |
| | | imageFramlayoutList.Add(imageFram); |
| | | }); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 初始化数据 |
| | |
| | | /// <summary> |
| | | /// 主动更新数据 |
| | | /// </summary> |
| | | private void UpdateData() |
| | | /// <param name="isUpdateData">是否是二级过滤,true表示是二级过滤过来的</param> |
| | | private void UpdateData(bool isUpdateData) |
| | | { |
| | | |
| | | CommonMethod.Current.Loading.Start(); |
| | |
| | | CommonMethod.Current.MainThread(() => |
| | | { |
| | | CommonMethod.Current.Loading.Hide(); |
| | | this.LoadImageFLayout(); |
| | | if (isUpdateData) |
| | | { |
| | | //清空所有旧影片数据,重新加载新影片数据 |
| | | this.LoadImageFLayout(); |
| | | } |
| | | else |
| | | { |
| | | //追加新数据在旧数据后面 |
| | | imageFLayout.LoadImagePage(imageFramlayoutList); |
| | | imageFLayout.AdjustRealHeight(16); |
| | | } |
| | | |
| | | }); |
| | | } |
| | | }); |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 页面数据处理逻辑 |
| | | /// 数据处理逻辑 |
| | | /// </summary> |
| | | /// <param name="newList">新列表数据</param> |
| | | private void DataTreating(List<MovieLibrary> newList) |
| | | { |
| | | if (newList == null) |
| | | if (newList == null || newList.Count == 0) |
| | | { |
| | | return; |
| | | } |
| | | //有新数据,清空旧数据 |
| | | imageFramlayoutList.Clear(); |
| | | |
| | | for (int i = 0; i < newList.Count; i++) |
| | | { |
| | | var mMovieLibrary = newList[i]; |
| | |
| | | mMovieLibrary.imageBytes = bytes; |
| | | |
| | | } |
| | | |
| | | for (int i = 0; i < newList.Count; i++) |
| | | { |
| | | //去重 |
| | | var mMovieLibrary = this.mMovieLibraryList.Find((o) => o.movieId == newList[i].movieId); |
| | | if (mMovieLibrary == null) |
| | | { |
| | | //新列表默认加在前面 |
| | | //新列表默认加在最前面 |
| | | this.mMovieLibraryList.Insert(0, newList[i]); |
| | | |
| | | } |
| | | //添加图片容器 |
| | | AddImageFramlayout(newList[i]); |
| | | |
| | | } |
| | | |
| | | if (newList.Count == SendMethod.pageSize) |
| | | { |
| | | //数据回复更新页数 |
| | | //更新页数 |
| | | pageNo++; |
| | | } |
| | | |
| | |
| | | /// <param name="filters">过滤条件</param> |
| | | private void AddMemoryFilters(Filters filters) |
| | | { |
| | | |
| | | if (FiltersList.ContainsKey(filters.category)) |
| | | { |
| | | FiltersList.Remove(filters.category); |