Beispiel #1
0
    private void CreateViews()
    {
        ObjectContainer objectContainer = (!SafeLayout.IsTablet) ? this.phonePool : this.tabletPool;
        int             num             = Mathf.RoundToInt(((RectTransform)base.transform).rect.height / (float)this.cellHeight) + this.topPreloadRows + this.bottomPreloadRows;

        this._views = new DailyRowItem[num];
        for (int i = 0; i < num; i++)
        {
            DailyRowItem entity = objectContainer.GetEntity <DailyRowItem>(this._content);
            entity.name = i + string.Empty;
            entity.Row  = -1;
            entity.transform.localScale    = Vector3.one;
            entity.transform.localPosition = Vector3.zero;
            RectTransform component = entity.GetComponent <RectTransform>();
            component.pivot     = new Vector2(0.5f, 1f);
            component.anchorMin = new Vector2(0f, 1f);
            component.anchorMax = new Vector2(1f, 1f);
            component.offsetMax = new Vector2(0f, 0f);
            component.offsetMin = new Vector2(0f, component.offsetMin.y);
            this._views[i]      = entity;
        }
        this._rects = new RectTransform[this._views.Length];
        for (int j = 0; j < this._views.Length; j++)
        {
            this._rects[j] = this._views[j].gameObject.GetComponent <RectTransform>();
        }
    }
 private void OnPicDeleted(PictureData delPicData, PictureData replacePicData)
 {
     if (replacePicData == null)
     {
         return;
     }
     this.tabData.UpdatePicData(replacePicData);
     if (this.tabData.dailyPic != null && this.tabData.dailyPic.picData.Id == replacePicData.Id)
     {
         this.dailyPic.PicItem.Reset();
         this.dailyPic.PicItem.Init(replacePicData, false, false, true);
     }
     if (this.scroll != null && this.scroll.Count > 0)
     {
         DailyRowItem rowWithId = this.scroll.GetRowWithId(replacePicData.Id);
         if (rowWithId != null)
         {
             rowWithId.ReinitPicItem(replacePicData);
         }
     }
 }