void UpdateItemColor(GenItem item, bool fromConstructor)
        {
            var defaultBackgroundColor = fromConstructor ? Color.Transparent : _oldDefaultBackgroundColor;
            var defaultTextColor       = fromConstructor ? Color.Transparent : _oldDefaultTextColor;

            var itemBackgroundColor = item.GetPartColor(Parts.Widget.Background);
            var itemTextColor       = item.GetPartColor(Parts.Widget.Text);

            if (itemBackgroundColor == defaultBackgroundColor)
            {
                item.SetPartColor(Parts.Widget.Background, MColors.Current.SurfaceColor);
                item.SetPartColor(Parts.Widget.BackgroundPressed, MColors.Current.PrimaryColor.WithAlpha(0.12));
                item.SetPartColor(Parts.Widget.BackgroundDisabled, MColors.Current.SurfaceColor.WithAlpha(0.32));
            }
            else
            {
                item.SetPartColor(Parts.Widget.BackgroundPressed, itemBackgroundColor.WithAlpha(0.12));
                item.SetPartColor(Parts.Widget.BackgroundDisabled, itemBackgroundColor.WithAlpha(0.32));
            }

            if (itemTextColor == defaultTextColor)
            {
                item.SetPartColor(Parts.Widget.Text, MColors.Current.OnSurfaceColor);
                item.SetPartColor(Parts.Widget.TextPressed, MColors.Current.PrimaryColor);
            }
            else
            {
                item.SetPartColor(Parts.Widget.TextPressed, itemTextColor);
            }
        }
示例#2
0
 void Start()
 {
     _genItem   = GameManager.GetComponent <GenItem> ();
     _genPeople = GameManager.GetComponent <GenPeople>();
     _gameParam = GameManager.GetComponent <GameParam> ();
     StartCoroutine("TimeCountDown");
 }
示例#3
0
        public void SendCellPropertyChanged(Cell cell, GenItem item, string property)
        {
            Dictionary <string, EvasObject> realizedView = null;

            _realizedNativeViews.TryGetValue(cell, out realizedView);

            // just to prevent null reference exception in OnCellPropertyChanged
            realizedView = realizedView ?? new Dictionary <string, EvasObject>();

            if (property == Cell.IsEnabledProperty.PropertyName)
            {
                item.IsEnabled = cell.IsEnabled;
            }
            // if true was returned, item was updated
            // if it's possible to update the cell property without Update(), return false
            else if (OnCellPropertyChanged(cell, property, realizedView))
            {
                item.Update();
            }
        }