public void setApp(App app) { this.app = app; GameObject icon = transform.GetChild(0).gameObject; RectTransform iconRt = icon.GetComponent <RectTransform> (); iconRt.sizeDelta = new Vector2(launcherModel.iconWidth, launcherModel.iconWidth); GameObject lable = icon.transform.GetChild(0).gameObject; if (!app.isPlaceholder) { icon.SetActive(true); // Debug.Log ("!app.isPlaceholder"); if (app.iconUrl != null && app.iconUrl.Length > 0) { // Log (TAG, "app.iconUrl:"+app.iconUrl); Sprite sprite = mLauncherController.LoadImgByIO(app); Image img = icon.GetComponent <Image> (); img.sprite = sprite; } Text textLable = lable.GetComponent <Text> (); textLable.fontSize = launcherModel.fontSize; textLable.text = app.appName; } else { // Debug.Log ("app.isPlaceholder"); icon.SetActive(false); } }
public void show(App app) { btnPanel.SetActive(true); hintText.text = hintStr; RectTransform dialogRT = GetComponent <RectTransform> (); dialogRT.DOScale(1f, LauncherController.ANIM_DURATION); GameObject icon = GameUtils.GetChildByName(gameObject, "icon"); Image img = icon.GetComponent <Image> (); Sprite sprite = mLauncherController.LoadImgByIO(app); img.sprite = sprite; }