예제 #1
0
 public void Init(LargeTips tips)
 {
     _tipsModel.Title.text           = tips.title;
     _tipsModel.DescripionLabel.text = HelperMethods.Instance.StripHtmlTags(tips.Description);
     _tipsModel.WebsiteLabel.text    = string.IsNullOrEmpty(tips.path) ? "N/A" : tips.path;
     _tipsModel.Id = tips.id;
 }
예제 #2
0
    private void AddHealthyTipsToView(LargeTips tips)
    {
        if (IsNotificationPresent())
        {
            return;
        }

        GameObject tipsPrefabToMake = (GameObject)Resources.Load(PrefabPath + TipsPrefabName);

        if (null == tipsPrefabToMake)
        {
            Debug.LogError("Prefab " + TipsPrefabName + " could not be instantiated");
            return;
        }

        if (!IsPanelActive())
        {
            ActivatePanel();
        }

        _model.TipsViewController =
            NGUITools.AddChild(_model.ParentForNatification.gameObject, tipsPrefabToMake)
            .GetComponent <NotificationTipsController>();

        _model.TipsViewController.transform.localPosition = _startTipsPos;
        _model.TipsViewController.Init(tips);
    }
	public void Init(LargeTips tips)
	{
		_tipsModel.Title.text = tips.title;
		_tipsModel.DescripionLabel.text = HelperMethods.Instance.StripHtmlTags(tips.Description);
		_tipsModel.WebsiteLabel.text = string.IsNullOrEmpty(tips.path) ? "N/A" : tips.path;
		_tipsModel.Id = tips.id;
	}
예제 #4
0
    private void Showed(LargeTips tips)
    {
        ShortTips shortTips = Tipses.FirstOrDefault(tipss => tipss.id == tips.id);

        if (null == shortTips)
        {
            throw new NullReferenceException("TipsController.Showed - error: cann't find necessary shortTips");
        }
        shortTips.State = TipsState.Showed;
    }
예제 #5
0
    private void OnGetDetailHealthyTipDataByNidSuccess(string json)
    {
        Debug.Log("TipsController.OnGetDetailHealthyTipDataByNidSuccess - OK, json: \n" + json);

        LargeTips tips = JsonReader.Deserialize <LargeTips>(json);

        Debug.Log(tips);

        AddHealthyTipsToView(tips);
    }
예제 #6
0
    private void AddHealthyTipsToView(LargeTips tips)
    {
        LastTipsShowTimeStamp = DateTime.UtcNow;
        SetTrackingVars();

        Showed(tips);
        _waitingForServer = false;
        if (OnAddHealthyTips != null)
        {
            OnAddHealthyTips(tips);
        }
    }
예제 #7
0
	private void Showed(LargeTips tips)
	{
		ShortTips shortTips = Tipses.FirstOrDefault(tipss => tipss.id == tips.id);
		if (null == shortTips)
		{
			throw new NullReferenceException("TipsController.Showed - error: cann't find necessary shortTips");
		}
		shortTips.State = TipsState.Showed;
	}
예제 #8
0
	private void AddHealthyTipsToView(LargeTips tips)
	{
		LastTipsShowTimeStamp = DateTime.UtcNow;
		SetTrackingVars();

		Showed(tips);
		_waitingForServer = false;
		if (OnAddHealthyTips != null)
		{
			OnAddHealthyTips(tips);
		}
	}
예제 #9
0
	private void AddHealthyTipsToView(LargeTips tips)
	{
		if (IsNotificationPresent())
			return;

		GameObject tipsPrefabToMake = (GameObject) Resources.Load(PrefabPath + TipsPrefabName);

		if (null == tipsPrefabToMake)
		{
			Debug.LogError("Prefab " + TipsPrefabName + " could not be instantiated");
			return;
		}

		if (!IsPanelActive())
		{
			ActivatePanel();
		}

		_model.TipsViewController =
			NGUITools.AddChild(_model.ParentForNatification.gameObject, tipsPrefabToMake)
			         .GetComponent<NotificationTipsController>();

		_model.TipsViewController.transform.localPosition = _startTipsPos;
		_model.TipsViewController.Init(tips);
	}