public void CreateFavItem(ContentData[] dataList) { if (ItemDetailPrefabs == null) { return; } ClearItemDetail(); for (int i = 0; i < dataList.Length; i++) { GameObject itemDetail = (GameObject)GameObject.Instantiate(ItemDetailPrefabs); itemDetail.SetActive(true); itemDetail.transform.parent = this.transform; itemDetail.transform.localPosition = new Vector3(0, -i * DetailLength, 0); FavItem idt = itemDetail.GetComponent <FavItem>(); idt.SetContentData(ContentPageFile.ModifiedDataForLoad(dataList[i])); idt.ReadMoreButton.box = this.GetComponent <Collider2D>(); idt.WebButton.box = this.GetComponent <Collider2D>(); idt.DeleteButton.box = this.GetComponent <Collider2D>(); itemDetailList.Add(itemDetail.GetComponent <FavItem>()); } if (dataList.Length == 0) { TextData.text = "ไม่พบข้อมูล"; } else { TextData.text = "จำนวนข้อมูลที่ถูกจัดเก็บ " + dataList.Length + "/" + PageDetailGlobal.pGlobal.file.maxContent + " เรื่อง"; } }
static public bool RemoveLike(int id) { if (pGlobal.file.likeList.Remove(id)) { SendLike(id, false); ContentPageFile.SaveContentFile(); return(true); } return(false); }
void DownloadThumbnail(string path) { if (path.Length <= 0) { return; } DownloadedTexture dTexture = ContentPageFile.CreateLoadTexture(); dTexture.name = ContentPageFile.GetFileName(path); texture.AddDownloadTexture(dTexture, "FavThumb"); dTexture.StartDownload(path); }
static public bool AddLike(int id) { foreach (int mId in pGlobal.file.likeList) { if (mId == id) { return(false); } } //add like list SendLike(id, true); pGlobal.file.likeList.Add(id); ContentPageFile.SaveContentFile(); return(true); }
public float ProgressCB(out string text) { //calculate progress here float progress = ContentPageFile.GetProgress(); int prText = (int)(progress * 100); text = "Downloading (" + prText.ToString() + "%)"; if (progress >= 1.0f) { //finish download // CreateFavourite (); state = prevState; } return(progress); }
public static void DownloadNewLink() { pGlobal.file.ResetFile(); //setup Favourite Bar ContentPageFile.ClearLoadTexture(); pGlobal.FavListDetail.CreateFavItem(pGlobal.file.contentList.ToArray()); pGlobal.FooterBar.ClearPaging(); pGlobal.CurrentPageSize = 0; if (pGlobal.HeaderText != null) { pGlobal.HeaderText.text = GetHeaderIndex((int)PageDetailGlobal.type - 1); } pGlobal.filter.CurrentMarker = 0; pGlobal.filter.Trigger(false); pGlobal.xmlData.filter = ""; pGlobal.xmlData.cat = 0; pGlobal.xmlData.SetLink(UserCommonData.GetURL() + GetLinkIndex((int)PageDetailGlobal.type - 1)); xmlDownload(0); }
static public void CreateFavourite() { pGlobal.FavListDetail.ClearItemDetail(); ContentPageFile.ClearLoadTexture(); pGlobal.FavListDetail.CreateFavItem(pGlobal.file.contentList.ToArray()); }
// Use this for initialization void Start() { gPageFile = this; }