public virtual void LoadResources(IResourceManager resourceManager, IGlobalizationService globalizationService)
        {
            ArgumentUtility.CheckNotNull("resourceManager", resourceManager);
            ArgumentUtility.CheckNotNull("globalizationService", globalizationService);

            string key = ResourceManagerUtility.GetGlobalResourceKey(Category);

            if (!string.IsNullOrEmpty(key))
            {
                Category = resourceManager.GetString(key);
            }

            key = ResourceManagerUtility.GetGlobalResourceKey(Text);
            if (!string.IsNullOrEmpty(key))
            {
                Text = resourceManager.GetString(key);
            }

            Icon.LoadResources(resourceManager);
            DisabledIcon.LoadResources(resourceManager);

            if (Command != null)
            {
                Command.LoadResources(resourceManager, globalizationService);
            }
        }
Beispiel #2
0
 public void UpdateColors(Color textColor, Color mutedColor,
                          Color iconDisabledColor)
 {
     Name.SetTextColor(textColor);
     SubTitle.SetTextColor(mutedColor);
     Icon.SetTextColor(mutedColor);
     DisabledIcon.SetTextColor(mutedColor);
     HasPasswordIcon.SetTextColor(mutedColor);
     MaxAccessCountReachedIcon.SetTextColor(mutedColor);
     ExpiredIcon.SetTextColor(mutedColor);
     PendingDeleteIcon.SetTextColor(mutedColor);
     MoreButton.SetTextColor(iconDisabledColor);
 }
Beispiel #3
0
        public AndroidSendCell(Context context, SendViewCell sendView, Typeface faTypeface, Typeface miTypeface)
            : base(context)
        {
            SendViewCell = sendView;
            _faTypeface  = faTypeface;
            _miTypeface  = miTypeface;

            var view = (context as Activity).LayoutInflater.Inflate(Resource.Layout.SendViewCell, null);

            Icon                      = view.FindViewById <TextView>(Resource.Id.SendCellIcon);
            Name                      = view.FindViewById <TextView>(Resource.Id.SendCellName);
            SubTitle                  = view.FindViewById <TextView>(Resource.Id.SendCellSubTitle);
            DisabledIcon              = view.FindViewById <TextView>(Resource.Id.SendCellDisabledIcon);
            HasPasswordIcon           = view.FindViewById <TextView>(Resource.Id.SendCellHasPasswordIcon);
            MaxAccessCountReachedIcon = view.FindViewById <TextView>(Resource.Id.SendCellMaxAccessCountReachedIcon);
            ExpiredIcon               = view.FindViewById <TextView>(Resource.Id.SendCellExpiredIcon);
            PendingDeleteIcon         = view.FindViewById <TextView>(Resource.Id.SendCellPendingDeleteIcon);
            MoreButton                = view.FindViewById <Button>(Resource.Id.SendCellButton);
            MoreButton.Click         += MoreButton_Click;

            Icon.Typeface                      = _faTypeface;
            DisabledIcon.Typeface              = _faTypeface;
            HasPasswordIcon.Typeface           = _faTypeface;
            MaxAccessCountReachedIcon.Typeface = _faTypeface;
            ExpiredIcon.Typeface               = _faTypeface;
            PendingDeleteIcon.Typeface         = _faTypeface;
            MoreButton.Typeface                = _miTypeface;

            var small = (float)Device.GetNamedSize(NamedSize.Small, typeof(Label));

            Icon.SetTextSize(ComplexUnitType.Pt, 10);
            Name.SetTextSize(ComplexUnitType.Sp, (float)Device.GetNamedSize(NamedSize.Medium, typeof(Label)));
            SubTitle.SetTextSize(ComplexUnitType.Sp, small);
            DisabledIcon.SetTextSize(ComplexUnitType.Sp, small);
            HasPasswordIcon.SetTextSize(ComplexUnitType.Sp, small);
            MaxAccessCountReachedIcon.SetTextSize(ComplexUnitType.Sp, small);
            ExpiredIcon.SetTextSize(ComplexUnitType.Sp, small);
            PendingDeleteIcon.SetTextSize(ComplexUnitType.Sp, small);
            MoreButton.SetTextSize(ComplexUnitType.Sp, 25);

            if (!SendViewCell.ShowOptions)
            {
                MoreButton.Visibility = ViewStates.Gone;
            }

            AddView(view);
        }