public void LoadContent(FeaturedInfo featuredInfo) { this.Init(); for (int i = 0; i < featuredInfo.orderedList.Count; i++) { OrderedItemType itemType = featuredInfo.orderedList[i].itemType; if (itemType != OrderedItemType.PromoPic) { if (itemType != OrderedItemType.Daily) { if (itemType == OrderedItemType.ExternalLink) { ExternalLinkInfo externalLinkInfo = (ExternalLinkInfo)featuredInfo.orderedList[i]; this.AddExternalLinkItem(externalLinkInfo); } } else { DailyPicInfo dailyPicInfo = (DailyPicInfo)featuredInfo.orderedList[i]; this.AddDailyItem(dailyPicInfo); } } else { PromoPicInfo promoPicInfo = (PromoPicInfo)featuredInfo.orderedList[i]; this.AddEditorItem(promoPicInfo); } } this.loopScroll.PrepareLayout(); }
public void LoadContent(FeaturedInfo featuredInfo) { this.loopScroll.Init((!SafeLayout.IsTablet) ? this.phoneConfig : this.tabletConfig); this.visabilityEventTracker.SetDelegate((int index) => this.items[index]); for (int i = 0; i < featuredInfo.orderedList.Count; i++) { OrderedItemType itemType = featuredInfo.orderedList[i].itemType; if (itemType != OrderedItemType.PromoPic) { if (itemType != OrderedItemType.Daily) { if (itemType == OrderedItemType.ExternalLink) { ExternalLinkInfo externalLinkInfo = (ExternalLinkInfo)featuredInfo.orderedList[i]; this.AddExternalLinkItem(externalLinkInfo); } } else { DailyPicInfo dailyPicInfo = (DailyPicInfo)featuredInfo.orderedList[i]; this.AddDailyItem(dailyPicInfo); } } else { PromoPicInfo promoPicInfo = (PromoPicInfo)featuredInfo.orderedList[i]; this.AddEditorItem(promoPicInfo); } } this.loopScroll.PrepareLayout(); }
public void OnFill(int row, OrderedItemInfo itemInfo, bool lazyLoad) { base.Row = row; if (itemInfo == null) { this.Clean(); return; } OrderedItemType itemType = itemInfo.itemType; if (itemType != OrderedItemType.PromoPic) { if (itemType != OrderedItemType.ExternalLink) { FMLogger.vCore("news item " + row + " is empty"); } else { ExternalLinkInfo externalLinkInfo = (ExternalLinkInfo)itemInfo; this.AddExternalLinkItem(externalLinkInfo, lazyLoad); } } else { PromoPicInfo promoPicInfo = (PromoPicInfo)itemInfo; this.AddEditorItem(promoPicInfo, lazyLoad); } }
public static NewsDb FromNewsData(OrderedItemInfo item) { NewsDb newsDb = new NewsDb(); newsDb.Id = item.id; int newsType = -1; OrderedItemType itemType = item.itemType; if (itemType != OrderedItemType.PromoPic) { if (itemType == OrderedItemType.ExternalLink) { newsDb.NewsType = 1; } } else { newsDb.NewsType = 0; } newsDb.NewsType = newsType; return(newsDb); }