示例#1
0
 private void OnPageContentLoaded(bool success, DailyTabInfo pageContent)
 {
     if (success)
     {
         this.PrepareForContnentLoad();
         this.HideConnectionError();
         this.waitingForPageResponse = false;
         this.scrolledToBottom       = true;
         this.scroll.LoadContent(pageContent, !base.IsOpened);
         this.UpdateNewDailyIndicator();
         if (base.IsOpened)
         {
             this.MarkDailyAsSeen();
         }
         int num = SharedData.Instance.CalculateDailyCompletePercent();
         if (num != -1)
         {
             AnalyticsManager.UpdateUserDailyProgressProperty(num);
         }
         if (!GeneralSettings.IsOldDesign)
         {
             this.scroll.GetComponent <ScrollConstraints>().Init();
         }
         base.StartCoroutine(base.DelayAction(3, 0f, new Action(this.ContentLoadComplete)));
     }
     else
     {
         this.ShowConnectionError();
     }
     this.pageContentTask = null;
     this.loadIndicator.SetActive(false);
 }
示例#2
0
 public void Result(bool success, DailyTabInfo result)
 {
     this.Completed = true;
     if (this.handler != null)
     {
         this.handler(success, result);
     }
 }
示例#3
0
    public void LoadContent(DailyTabInfo info, bool lazyIconLoad)
    {
        if (GeneralSettings.IsOldDesign)
        {
            this.dailyPic = this.dailyPicLegacy;
        }
        else
        {
            this.dailyPic = ((!SafeLayout.IsTablet) ? this.dailyPicPhone : this.dailyPicTablet);
        }
        this.tabData = info;
        if (GeneralSettings.IsOldDesign)
        {
            this.scroll.AddTopOffset(-1 * (int)((RectTransform)this.dailyPic.transform.parent).anchoredPosition.y);
        }
        if (this.tabData.dailyPic != null)
        {
            this.dailyPic.transform.parent.gameObject.SetActive(true);
            this.dailyPic.gameObject.SetActive(true);
            this.dailyPic.Init(this.tabData.dailyPic);
            int offset = (int)((RectTransform)this.dailyPic.transform.parent).rect.height;
            this.scroll.AddTopOffset(offset);
        }
        this.dailyContent = this.tabData.monthes;
        if (!GeneralSettings.IsOldDesign)
        {
            this.scroll.headerHeight = ((!SafeLayout.IsTablet) ? 153 : 114);
        }
        if (!GeneralSettings.IsOldDesign)
        {
            this.scroll.cellHeight = ((!SafeLayout.IsTablet) ? 542 : 500);
        }
        this.scroll.FillItem += delegate(int row, DailyRowItem item, bool lazyLoad)
        {
            item.OnDailyVisable(row, this, lazyLoad);
        };
        int num = 0;

        for (int i = 0; i < this.dailyContent.Count; i++)
        {
            int num2 = (this.dailyContent[i].pics.Count % MenuScreen.RowItems != 0) ? (this.dailyContent[i].pics.Count / MenuScreen.RowItems + 1) : (this.dailyContent[i].pics.Count / MenuScreen.RowItems);
            this.newMonthRows.Add(num);
            num++;
            num += num2;
        }
        if (this.dailyContent.Count > 0)
        {
            this.currentMonth = this.dailyContent[0];
            this.rowOffset    = this.newMonthRows[0];
        }
        int scrollTo = 0;

        if (MenuScreen.MenuState == MenuState.Daily && MenuScreen.PaintStartSource == PaintStartSource.DailyOldPic && Gameboard.pictureData != null && Gameboard.pictureData.Id != 0)
        {
            scrollTo = this.GetItemRow(Gameboard.pictureData.Id, true);
        }
        this.scroll.InitData(num, scrollTo, this.newMonthRows, lazyIconLoad);
    }