public void Present(ObjectData mmo) { DisplayInfo(mmo); imagePresenter.LoadImage(TemporaryCompatUtils.GetThumbnailUrl(mmo)); active = mmo; titleLabel.text = "Result " + mmo.Id; // TODO re-introduce rank }
private void AddObjectToScroll(ObjectData mmo) { Debug.Log(":AddObjectToScroll " + (mmo != null ? JsonUtility.ToJson(mmo) : "null")); GameObject panel = Instantiate(prefab); Debug.Log("panel: " + (panel == null ? "null" : "found")); panel.transform.SetParent(scrollContent, false); var ctrl = panel.GetComponent <DisplayController>(); Debug.Log("ctrl " + (ctrl == null ? "Null" : "received")); ctrl.SetTitle(string.Format("Result: {0}", mmo.Id)); Debug.Log("initalGeoLoc: " + (initialGeoLocation == null ? "null" : "present")); var lat = MetadataUtils.GetLatitude(mmo.Metadata); var lon = MetadataUtils.GetLongitude(mmo.Metadata); double dist = Utilities.HaversineDistance(lat, lon, initialGeoLocation.latitude, initialGeoLocation.longitude); string footerText = string.Format("Distance: {0}m\nDate: {1}", Round(dist), FormatDate(mmo)); ctrl.SetFooter(footerText); ctrl.LoadImageFromWeb(TemporaryCompatUtils.GetThumbnailUrl(mmo)); ctrl.Mmo = mmo; ctrl.UiManager = this; ctrl.Controller = controller; }