Exemplo n.º 1
0
        public void UpdateIconImage(SendViewCell sendCell)
        {
            if (_currentTask != null && !_currentTask.IsCancelled && !_currentTask.IsCompleted)
            {
                _currentTask.Cancel();
            }

            var send      = sendCell.Send;
            var iconImage = sendCell.GetIconImage(send);

            Icon.Text = iconImage;
        }
Exemplo n.º 2
0
        public void UpdateCell(SendViewCell sendCell)
        {
            UpdateIconImage(sendCell);

            var send = sendCell.Send;

            Name.Text     = send.Name;
            SubTitle.Text = send.DisplayDate;
            HasPasswordIcon.Visibility           = send.HasPassword ? ViewStates.Visible : ViewStates.Gone;
            MaxAccessCountReachedIcon.Visibility = send.MaxAccessCountReached ? ViewStates.Visible : ViewStates.Gone;
            ExpiredIcon.Visibility       = send.Expired ? ViewStates.Visible : ViewStates.Gone;
            PendingDeleteIcon.Visibility = send.PendingDelete ? ViewStates.Visible : ViewStates.Gone;
        }
Exemplo n.º 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);
        }