Пример #1
0
        private void SetEpisode(bool isPlaying)
        {
            if (isPlaying)
            {
                UILabelExtensions.SetupLabelAppearance(_durationLabel, _locationResources["PlayingLabel"], UIColor.LightGray, 12f, UIFontWeight.Regular);
                _playImage.Image = UIImage.FromBundle("podcast_pause");
            }
            else
            {
                DateTime parsedDate = DateTime.Parse(_episode?.PublicationDate ?? default(DateTime).ToString());
                var      resultDate = TimeUtils.SetMonthAndYearFormat(parsedDate);

                string duration = "";

                if (!string.IsNullOrEmpty(_episode?.Duration))
                {
                    if (_episode.Duration.Contains(":"))
                    {
                        duration = _episode.Duration;
                    }
                    else
                    {
                        duration = TimeHelper.SecondsToDuration(_episode.Duration);
                    }

                    duration += $" {_locationResources["DurationLabel"]} | ";
                }

                duration = $"{duration}{_locationResources["ReleasedLabel"]} {resultDate[0]} {resultDate[1]}";
                UILabelExtensions.SetupLabelAppearance(_durationLabel, duration, UIColor.LightGray, 12f, UIFontWeight.Regular);


                _playImage.Image = UIImage.FromBundle("podcast_play");
            }
        }
Пример #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.View.UserInteractionEnabled = true;

            CustomUIExtensions.ViewShadowForChatPupUp(_backgroundView);

            _pictureImage.Image?.Dispose();

            if (!string.IsNullOrEmpty(_picture))
            {
                _pictureCopy = string.Copy(_picture);

                ImageService.Instance.LoadStream((token) => {
                    return(ImageHelper.GetStreamFromImageByte(token, _picture));
                }).ErrorPlaceholder("profile_noimage", ImageSource.CompiledResource).Retry(3, 200).Finish(CleanString).Transform(new CircleTransformation()).Into(_pictureImage);
            }
            else
            {
                _pictureImage.Image = UIImage.FromBundle("profile_noimage");
                CustomUIExtensions.RoundView(_pictureImage);
            }

            UILabelExtensions.SetupLabelAppearance(_nameLabel, _name, Colors.Black, 13f, UIFontWeight.Semibold);
            UILabelExtensions.SetupLabelAppearance(_descriptionLabel, _message, Colors.Black, 12f, UIFontWeight.Regular);

            _openChatButton.TouchUpInside -= OnOpenChatButton_TouchUpInside;
            _openChatButton.TouchUpInside += OnOpenChatButton_TouchUpInside;

            Xamarin.Essentials.Vibration.Vibrate(TimeSpan.FromMilliseconds(500));

            gesture.AddTarget(() => HandleDrag(gesture));
            this.View.AddGestureRecognizer(gesture);
        }
Пример #3
0
        public void Configure(string title, AlertType alertType, float duration)
        {
            this.ClipsToBounds = true;

            _duration = duration;

            UILabelExtensions.SetupLabelAppearance(_titleLabel, title, Colors.White, 14f, UIFontWeight.Medium);

            switch (alertType)
            {
            case AlertType.Success:
                _backgroundView.BackgroundColor = Colors.Green;
                break;

            case AlertType.Error:
                _backgroundView.BackgroundColor = Colors.Red;
                break;

            case AlertType.Info:
                _backgroundView.BackgroundColor = Colors.Orange;
                break;

            default:
                _backgroundView.BackgroundColor = Colors.MainBlue;
                break;
            }

            _closeButton.SetImage(UIImage.FromBundle("close_white"), UIControlState.Normal);
            _closeButton.TintColor = Colors.White;
            _closeButton.Hidden    = true;

            Show();
        }
 private void SelectedPosition(object sender, PositionModel position)
 {
     _selectedPosition = position;
     ViewModel.SetPositionCommand.Execute(position.PositionID);
     UILabelExtensions.SetupLabelAppearance(_pickerLabel, position.Name, Colors.Black, 18f);
     AnimatePicker(false);
 }
Пример #5
0
        public void Configure(Core.Models.ProfileDivisionDetails division, EventHandler <int> divisionEvent)
        {
            _division      = division;
            _divisionEvent = divisionEvent;

            _imageView.Image?.Dispose();

            if (_division.AddButtonImage)
            {
                _imageView.Image = UIImage.FromBundle("add_circle");
                _label.Hidden    = true;
            }
            else
            {
                if (!string.IsNullOrEmpty(_division.Picture))
                {
                    ImageService.Instance.LoadStream((token) => {
                        return(ImageHelper.GetStreamFromImageByte(token, _division.Picture));
                    }).ErrorPlaceholder("division_noimage", ImageSource.CompiledResource).Transform(new CircleTransformation()).Into(_imageView);
                }
                else
                {
                    CustomUIExtensions.RoundView(_imageView);
                    _imageView.Image = UIImage.FromBundle("division_noimage");
                }

                _label.Hidden = false;
                UILabelExtensions.SetupLabelAppearance(_label, _division.Name, Colors.ProfileGray, 13f);
            }

            _button.TouchUpInside -= OnButton_TouchUpInside;
            _button.TouchUpInside += OnButton_TouchUpInside;
        }
Пример #6
0
        private void UpdateView()
        {
            _profileImage.Image?.Dispose();
            ImageService.Instance.LoadStream((token) => {
                return(ImageHelper.GetStreamFromImageByte(token, ViewModel.MemberProfileModel.Picture));
            }).ErrorPlaceholder("profile_noimage", ImageSource.CompiledResource).Transform(new CircleTransformation()).Into(_profileImage);
            CustomUIExtensions.RoundShadow(_profileImage);

            UILabelExtensions.SetupLabelAppearance(_nameLabel, $"{ViewModel.MemberProfileModel.FirstName} {ViewModel.MemberProfileModel.LastName}", Colors.White, 22f);

            if (!string.IsNullOrEmpty(ViewModel.MemberProfileModel.Description))
            {
                UILabelExtensions.SetupLabelAppearance(_descriptionLabel, ViewModel.MemberProfileModel.Description, Colors.White, 13f);
            }
            else
            {
                UILabelExtensions.SetupLabelAppearance(_descriptionLabel, ViewModel.MemberNoDescriptionLabel, Colors.ProfileGrayWhiter, 13f, italic: true);
            }

            _tableView.Source = new MemberSource(_tableView, ViewModel.MemberDetails);
            _tableView.ReloadData();

            _chatButton.TouchUpInside -= OnChatButton_TouchUpInside;
            _chatButton.TouchUpInside += OnChatButton_TouchUpInside;

            _callButton.TouchUpInside -= OnCallButton_TouchUpInside;
            _callButton.TouchUpInside += OnCallButton_TouchUpInside;
        }
Пример #7
0
        public void Configure(Episode episode, Dictionary <string, string> locationResources, EventHandler <Episode> playPressed)
        {
            _episode            = episode;
            _playPressed        = playPressed;
            _locationResources  = locationResources;
            _loadingView.Hidden = true;
            _activityIndicator.StopAnimating();

            _playImage.Image?.Dispose();
            _explicit.Image?.Dispose();

            UILabelExtensions.SetupLabelAppearance(_nameLabel, episode.Title, Colors.Black, 14f, UIFontWeight.Semibold);
            UILabelExtensions.SetupLabelAppearance(_trackLabel, episode.EpisodeNumber, Colors.Black, 16f, UIFontWeight.Semibold);

            SetEpisode(episode.IsPlaying);

            if (episode.Explicit == "yes")
            {
                _explicit.Hidden = false;
                _explicit.Image  = UIImage.FromBundle("main_explicit");
            }
            else
            {
                _explicit.Hidden = true;
            }

            _playButton.TouchUpInside -= OnplayButton_TouchUpInside;
            _playButton.TouchUpInside += OnplayButton_TouchUpInside;
        }
        private void SetupView()
        {
            if (PhoneModelExtensions.IsIphoneX())
            {
                _buttonHeightConstraint.Constant += UIApplication.SharedApplication.KeyWindow.SafeAreaInsets.Bottom;
            }

            _closeButton.SetImage(UIImage.FromBundle("close_white"), UIControlState.Normal);
            _closeButton.TintColor                = Colors.White;
            _backgroundView.BackgroundColor       = Colors.SelectBlue;
            _buttonBackgroundView.BackgroundColor = Colors.White;

            UIButton keyboardButton = new UIButton();

            UIButtonExtensions.SetupButtonAppearance(keyboardButton, Colors.SelectBlue, 16f, ViewModel.AccessButton);
            keyboardButton.TouchUpInside -= OnSignInButton_TouchUpInside;
            keyboardButton.TouchUpInside += OnSignInButton_TouchUpInside;

            UILabelExtensions.SetupLabelAppearance(_label, ViewModel.TitleLabel, Colors.White, 24f, UIFontWeight.Thin);
            UIButtonExtensions.SetupButtonAppearance(_submitButton, Colors.SelectBlue, 16f, ViewModel.AccessButton);
            UITextFieldExtensions.SetupTextFieldAppearance(_textField, Colors.White, 26f, ViewModel.OrganizationHint, Colors.White70, Colors.White, Colors.SelectBlue, UIFontWeight.Medium);
            UITextFieldExtensions.AddViewToKeyboard(_textField, keyboardButton, Colors.White);
            _textField.AutocorrectionType = UITextAutocorrectionType.No;
            _textField.TextContentType    = new NSString("");

            UIButtonExtensions.SetupButtonUnderlineAppearance(_createOrgButton, Colors.White, 15f, ViewModel.CreateOrganization);

            if (!string.IsNullOrEmpty(ViewModel.EmailDomain))
            {
                _textField.Text = ViewModel.EmailDomain.ToUpper();
            }
        }
Пример #9
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            using (var audioSession = AVAudioSession.SharedInstance() as AVAudioSession)
            {
                audioSession.SetCategory(AVAudioSessionCategory.PlayAndRecord);
                audioSession.SetActive(false);
            }

            this.View.BackgroundColor = Colors.Black;

            _speakerButton.TouchUpInside -= OnLeftButton_TouchUpInside;
            _speakerButton.TouchUpInside += OnLeftButton_TouchUpInside;

            _muteButton.TouchUpInside -= OnRightButton_TouchUpInside;
            _muteButton.TouchUpInside += OnRightButton_TouchUpInside;

            _endCallButton.TouchUpInside -= OnEndCallButton_TouchUpInside;
            _endCallButton.TouchUpInside += OnEndCallButton_TouchUpInside;

            UILabelExtensions.SetupLabelAppearance(_letterInfoLabel, ViewModel.LetterLabel, Colors.White, 16f);
            UILabelExtensions.SetupLabelAppearance(_callDetailLabel, ViewModel.ConnectingLabel, Colors.White.ColorWithAlpha(0.8f), 18f);

            _letterIconImage.Image = UIImage.FromBundle("letter_curved");
            _endCallImage.Image    = UIImage.FromBundle("end_call");

            _callTimer.Elapsed += (s, e) => UpdateTime();

            ViewModel.PropertyChanged -= ViewModel_PropertyChanged;
            ViewModel.PropertyChanged += ViewModel_PropertyChanged;
        }
Пример #10
0
        private void StartCall()
        {
            _speakerIcon.Hidden = false;
            _muteIcon.Hidden    = false;

            _speakerIcon.Image = ViewModel.SpeakerOn ? UIImage.FromBundle("speaker_on") : UIImage.FromBundle("speaker_off");
            _muteIcon.Image    = ViewModel.MutedOn ? UIImage.FromBundle("micro_off") : UIImage.FromBundle("micro_on");

            _speakerBackgroundImage.Image = new UIImage();
            _muteBackgroundImage.Image    = new UIImage();

            _speakerBackgroundImage.BackgroundColor = Colors.White.ColorWithAlpha(0.3f);
            _muteBackgroundImage.BackgroundColor    = Colors.White.ColorWithAlpha(0.3f);

            CustomUIExtensions.RoundView(_speakerBackgroundImage);
            CustomUIExtensions.RoundView(_muteBackgroundImage);

            UILabelExtensions.SetupLabelAppearance(_speakerLabel, ViewModel.SpeakerLabel, Colors.White, 12f);
            UILabelExtensions.SetupLabelAppearance(_muteLabel, ViewModel.MuteLabel, Colors.White, 12f);

            AgoraDelegate = new AgoraRtcDelegate(this);
            CallProvider.SetupAgoraIO(this, ViewModel.RoomName, ViewModel.SpeakerOn, ViewModel.MutedOn, ViewModel.StartedCall);

            _activeCall = ViewModel.StartedCall
                ? CallProvider.CallManager.StartCall(ViewModel.MemberFullName, ViewModel.CallerId)
                : CallProvider.CallManager.Calls.LastOrDefault();
        }
Пример #11
0
        public override void ViewDidLayoutSubviews()
        {
            base.ViewDidLayoutSubviews();

            _noRecentChatImage.ContentMode = UIViewContentMode.ScaleAspectFit;
            _noRecentChatImage.SizeThatFits(_noRecentChatImage.Image.Size);
            var imageViewCenter = _noRecentChatImage.Center;

            imageViewCenter.X         = _tableView.Bounds.GetMidX();
            imageViewCenter.Y         = _tableView.Bounds.GetMidY() - 40;
            _noRecentChatImage.Center = imageViewCenter;

            _noRecenChatLabel.Center = this.View.Center;
            var labelY = _noRecentChatImage.Frame.Y + _noRecentChatImage.Frame.Height + 40;

            _noRecenChatLabel.Frame = new CGRect(0, labelY, this.View.Frame.Width, 20);
            UILabelExtensions.SetupLabelAppearance(_noRecenChatLabel, ViewModel.NoRecentChat, Colors.GrayDivider, 17f, UIFontWeight.Medium);
            _noRecenChatLabel.TextAlignment = UITextAlignment.Center;

            _loadingView.Hidden = true;
            _loadingView.Frame  = new CGRect(0, 0, 80, 80);
            var imageLoadingCenter = _noRecentChatImage.Center;

            imageLoadingCenter.X = _tableView.Bounds.GetMidX();
            imageLoadingCenter.Y = _tableView.Bounds.Height - 40;
            _loadingView.Center  = imageLoadingCenter;

            this.View.AddSubview(_loadingView);
            this.View.AddSubview(_noRecentChatImage);
            this.View.AddSubview(_noRecenChatLabel);
        }
Пример #12
0
 private void SetupView()
 {
     _closeButton.SetImage(UIImage.FromBundle("close_white"), UIControlState.Normal);
     _closeButton.TintColor          = Colors.White;
     _backgroundView.BackgroundColor = Colors.SelectBlue;
     UILabelExtensions.SetupLabelAppearance(_titleLabel, ViewModel.NewUser ? ViewModel.TitleMainLabel : ViewModel.TitleLabel, Colors.White, 24f);
     CustomUIExtensions.LabelShadow(_titleLabel);
 }
Пример #13
0
        private void ConfigureView()
        {
            LoadingAnimation(true);

            _sendButton.Enabled = false;
            _textView.Delegate  = this;

            _tableView.SectionHeaderHeight = 0;
            _tableView.TableHeaderView     = new UIView(new CGRect(0, 0, 0, 0.1f));

            _keyboardViewBottomConstraint.Constant = _keyboardBottomHeight;
            _tableViewBottomConstraint.Constant    = _keyboardAreaView.Frame.Height + _keyboardBottomHeight;

            AddStatusInTableView();

            _tableViewTapGesture.AddTarget(HandleTableDragGesture);
            _tableViewSwipeGesture.AddTarget(HandleTableDragGesture);

            _tableScrollView = _tableView as UIScrollView;

            _tableView.SeparatorStyle  = UITableViewCellSeparatorStyle.None;
            _tableView.BackgroundColor = Colors.White;

            _imageView1.Image?.Dispose();
            _imageView2.Image?.Dispose();
            _imageView3.Image?.Dispose();

            _imageView1.Image = UIImage.FromBundle("keyboard");
            _imageView2.Image = UIImage.FromBundle("image_picker");
            _imageView3.Image = UIImage.FromBundle("files");

            _keyboardAreaView.BackgroundColor = Colors.KeyboardView;
            _fakeAreaView.BackgroundColor     = Colors.KeyboardView;

            _textView.EnablesReturnKeyAutomatically = true;
            _textView.TextContainerInset            = new UIEdgeInsets(10, 10, 10, 10);
            _textView.TextColor = Colors.Black;
            _textView.Font      = UIFont.SystemFontOfSize(14f);
            _textView.Text      = string.Empty;

            CustomUIExtensions.CornerView(_sendView, 2);
            UILabelExtensions.SetupLabelAppearance(_sendLabel, ViewModel.SendMessageButton, Colors.ProfileGray, 15f, UIFontWeight.Medium);
            UILabelExtensions.SetupLabelAppearance(_placeholderLabel, ViewModel.TypeSomething, Colors.ProfileGrayDarker, 14f);

            _sendView.BackgroundColor = UIColor.Clear;

            _button1.TouchUpInside -= OnButton1_TouchUpInside;
            _button1.TouchUpInside += OnButton1_TouchUpInside;

            _button2.TouchUpInside -= OnButton2_TouchUpInside;
            _button2.TouchUpInside += OnButton2_TouchUpInside;

            _button3.TouchUpInside -= OnButton3_TouchUpInside;
            _button3.TouchUpInside += OnButton3_TouchUpInside;

            _sendButton.TouchUpInside -= OnSendButton_TouchUpInside;
            _sendButton.TouchUpInside += OnSendButton_TouchUpInside;
        }
Пример #14
0
        public void Configure(EventHandler headerPressed, Dictionary <string, string> locationResources, string selectedCategory)
        {
            _headerPressed = headerPressed;
            UILabelExtensions.SetupLabelAppearance(_categoryLabel, locationResources["CategoryLabel"], UIColor.LightGray, 14);
            UILabelExtensions.SetupLabelAppearance(_categoryValueLabel, selectedCategory, Colors.Black, 17, UIFontWeight.Semibold);

            _selectButton.TouchUpInside -= OnSelectButton_TouchUpInside;
            _selectButton.TouchUpInside += OnSelectButton_TouchUpInside;
        }
Пример #15
0
        public void Configure(DescriptionAndBoolEventModel cell)
        {
            _cell = cell;
            UILabelExtensions.SetupLabelAppearance(_label, cell.Description, Colors.Black, 15f);
            _switch.On = cell.IsActive;

            _switch.ValueChanged -= OnSwitch_ValueChanged;
            _switch.ValueChanged += OnSwitch_ValueChanged;
        }
Пример #16
0
        public void ConfigureForChat(string text, bool isOn, EventHandler <bool> muteEvent)
        {
            _muteEvent = muteEvent;
            UILabelExtensions.SetupLabelAppearance(_label, text, Colors.Black, 15f);
            _switch.On          = isOn;
            _switch.OnTintColor = Colors.Red;

            _switch.ValueChanged -= OnSwitch_ChatEvent;
            _switch.ValueChanged += OnSwitch_ChatEvent;
        }
Пример #17
0
        public void Configure(SettingsAllowCallsModel settings)
        {
            _settings = settings;
            UILabelExtensions.SetupLabelAppearance(_title, settings.AllowCallsTitle, Colors.Black, 15f);
            UILabelExtensions.SetupLabelAppearance(_description, settings.AllowCallsDescription, Colors.Black, 12f);
            _switch.On = settings.IsActive;

            _switch.ValueChanged -= OnSwitch_ValueChanged;
            _switch.ValueChanged += OnSwitch_ValueChanged;
        }
Пример #18
0
        public void Configure(DivisionModel division, string leave, EventHandler <Tuple <NSIndexPath, DivisionModel> > leaveDivision, NSIndexPath indexPath)
        {
            _indexPath     = indexPath;
            _division      = division;
            _leaveDivision = leaveDivision;
            UILabelExtensions.SetupLabelAppearance(_label, division.Name, Colors.Black, 16f);
            UIButtonExtensions.SetupButtonAppearance(_button, Colors.Red, 15f, leave);

            _button.TouchUpInside -= OnButon_TouchUpInside;
            _button.TouchUpInside += OnButon_TouchUpInside;
        }
Пример #19
0
        public void Configure(string link, string name, EventHandler <string> openWebsite)
        {
            _link        = link;
            _openWebsite = openWebsite;
            _iconImage.Image?.Dispose();
            _iconImage.Image = UIImage.FromBundle("podcast_weblink");
            UILabelExtensions.SetupLabelAppearance(_nameLabel, name, Colors.MainBlue, 14f);

            _button.TouchUpInside -= Onbutton_TouchUpInside;
            _button.TouchUpInside += Onbutton_TouchUpInside;
        }
Пример #20
0
        public void Configure(ProfileOrganizationDetails division)
        {
            _imageView.Image?.Dispose();

            ImageService.Instance.LoadStream((token) => {
                return(ImageHelper.GetStreamFromImageByte(token, division.Picture));
            }).ErrorPlaceholder("division_noimage", ImageSource.CompiledResource).Transform(new CircleTransformation()).Into(_imageView);

            UILabelExtensions.SetupLabelAppearance(_nameLabel, division.Name, Colors.ProfileGrayDarker, 14f);
            UILabelExtensions.SetupLabelAppearance(_membersLabel, division.MembersCount, Colors.GrayLabel, 13f);
        }
 private void SetupView()
 {
     UILabelExtensions.SetupLabelAppearance(_titleLabel, ViewModel.Title, Colors.White, 18f, UIFontWeight.Bold);
     UILabelExtensions.SetupLabelAppearance(_createdByLabel, ViewModel.CreatedBy, Colors.Black, 20f);
     UILabelExtensions.SetupLabelAppearance(_creatorNameLabel, ViewModel.JoaoPalma, Colors.Black, 34f);
     UILabelExtensions.SetupLabelAppearance(_copyrightLabel, ViewModel.CopyrightLabel, Colors.Black, 16f);
     _navBar.BackgroundColor = Colors.MainBlue;
     _closeButton.SetImage(UIImage.FromBundle("information_close")?.ImageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal), UIControlState.Normal);
     _closeButton.SetTitle("", UIControlState.Normal);
     _closeButton.TouchUpInside -= OnCloseButton_TouchUpInside;
     _closeButton.TouchUpInside += OnCloseButton_TouchUpInside;
 }
Пример #22
0
        private void ConfigureView()
        {
            this.NavigationController.NavigationBar.PrefersLargeTitles = true;
            NavigationItem.RightBarButtonItem = UIButtonExtensions.SetupImageBarButton(24, "main_info", OpenInformationView);

            var search = new UISearchController(searchResultsController: null)
            {
                DimsBackgroundDuringPresentation = false,
            };

            search.SearchBar.TintColor   = UIColor.White;
            search.SearchBar.Placeholder = ViewModel.Search;

            NSString _searchField             = new NSString("searchField");
            var      textFieldInsideSearchBar = (UITextField)search.SearchBar.ValueForKey(_searchField);
            var      backgroundField          = textFieldInsideSearchBar.Subviews[0];

            backgroundField.BackgroundColor    = Colors.White.ColorWithAlpha(1);
            backgroundField.Alpha              = 1;
            backgroundField.Layer.CornerRadius = 10f;
            backgroundField.ClipsToBounds      = true;

            _pickerHeaderView.BackgroundColor     = Colors.MainBlue;
            _pickerHeaderView.Layer.ShadowColor   = Colors.Black.CGColor;
            _pickerHeaderView.Layer.ShadowOffset  = new CGSize(5, 5);
            _pickerHeaderView.Layer.ShadowRadius  = 7;
            _pickerHeaderView.Layer.ShadowOpacity = 12;
            _pickerHeaderView.Layer.MasksToBounds = false;

            search.SearchBar.OnEditingStarted -= OnSearchBar_OnEditingStarted;
            search.SearchBar.OnEditingStarted += OnSearchBar_OnEditingStarted;

            search.SearchBar.OnEditingStopped -= OnSearchBar_OnEditingStopped;
            search.SearchBar.OnEditingStopped += OnSearchBar_OnEditingStopped;

            search.SearchBar.CancelButtonClicked -= OnSearchBar_CancelButtonClicked;
            search.SearchBar.CancelButtonClicked += OnSearchBar_CancelButtonClicked;

            search.SearchResultsUpdater     = this;
            DefinesPresentationContext      = true;
            NavigationItem.SearchController = search;

            UILabelExtensions.SetupLabelAppearance(_noResultsLabel, ViewModel.NoResultsLabel, Colors.Black, 15f, UIFontWeight.Medium);

            _noResultsView.Hidden = true;
            _tableView.Hidden     = true;
            PickerSwitch(true);

            UITapGestureRecognizer tapGesture = new UITapGestureRecognizer(() => PickerSwitch(true));

            _closeTabView.AddGestureRecognizer(tapGesture);
            _closeTabView.Alpha = 0.4f;
        }
        private void SetupView()
        {
            if (PhoneModelExtensions.IsIphoneX())
            {
                _navBarTopConstraint.Constant     = LocalConstants.IphoneXNotchHeight;
                _buttonHeightConstraint.Constant += UIApplication.SharedApplication.KeyWindow.SafeAreaInsets.Bottom;
            }

            UIButtonExtensions.SetupButtonAppearance(_submitButton, Colors.White, 16f, ViewModel.SubmitButton);
            UILabelExtensions.SetupLabelAppearance(_titleLabel, ViewModel.NewPassTitle, Colors.Black, 17f, UIFontWeight.Semibold);
            _closeButton.SetImage(UIImage.FromBundle("close_black"), UIControlState.Normal);
            _closeButton.TintColor      = Colors.Black;
            _buttonView.BackgroundColor = Colors.MainBlue;
        }
Пример #24
0
 private void AddStatusInTableView()
 {
     _tableView.SectionFooterHeight = 0;
     _tableView.TableFooterView     = new UIView(new CGRect(0, 0, 0, 15f))
     {
         BackgroundColor = UIColor.Clear
     };
     _statusLabel = new UILabel(new CGRect(0, 2, ScreenWidth, 12))
     {
         TextAlignment = UITextAlignment.Center
     };
     UILabelExtensions.SetupLabelAppearance(_statusLabel, string.Empty, Colors.GrayLabel, 10f);
     _tableView?.TableFooterView?.AddSubview(_statusLabel);
 }
Пример #25
0
        public void Configure(DivisionModel division)
        {
            _imageView.Image?.Dispose();

            ImageService.Instance.LoadStream((token) => {
                return(ImageHelper.GetStreamFromImageByte(token, division.Picture));
            }).ErrorPlaceholder("division_noimage", ImageSource.CompiledResource).Transform(new CircleTransformation()).Into(_imageView);

            CustomUIExtensions.RoundShadow(_imageView);
            CustomUIExtensions.LabelShadow(_titleLabel);

            UILabelExtensions.SetupLabelAppearance(_titleLabel, division.Name, Colors.White, 16f, UIFontWeight.Bold);
            UILabelExtensions.SetupLabelAppearance(_subtitleLabel, division.Description, Colors.White, 12f);
        }
Пример #26
0
        public void Configure(CallHistoryModel call, EventHandler <int> openProfile)
        {
            _callerId    = call.CallerId;
            _openProfile = openProfile;

            var nameAttr = new UIStringAttributes
            {
                ForegroundColor = Colors.ProfileGray,
                Font            = UIFont.SystemFontOfSize(14, call.ShouldAlert ? UIFontWeight.Bold : UIFontWeight.Medium)
            };

            var RoleAttr = new UIStringAttributes
            {
                ForegroundColor = Colors.Black,
                Font            = UIFont.SystemFontOfSize(14, call.ShouldAlert ? UIFontWeight.Semibold : UIFontWeight.Regular)
            };

            var letterCount = call.CallerInfo.IndexOf("-") + 1;

            var customString = new NSMutableAttributedString(call.CallerInfo);

            customString.SetAttributes(nameAttr.Dictionary, new NSRange(0, letterCount));
            customString.SetAttributes(RoleAttr.Dictionary, new NSRange(letterCount + 1, call.CallerInfo.Length - (letterCount + 1)));

            // assign the styled text
            _callerInfoLabel.AttributedText = customString;

            UILabelExtensions.SetupLabelAppearance(_dateLabel, call.CallDateText, Colors.ProfileGray, 13f, call.ShouldAlert ? UIFontWeight.Semibold : UIFontWeight.Regular);
            UILabelExtensions.SetupLabelAppearance(_callingTypeLabel, call.CallCountAndType, call.HasSuccess ? Colors.Green : Colors.Red, 13f, call.ShouldAlert ? UIFontWeight.Semibold : UIFontWeight.Regular);

            _imageView.Image?.Dispose();

            if (!string.IsNullOrEmpty(call.CallerPicture))
            {
                _picture = string.Copy(call.CallerPicture);

                ImageService.Instance.LoadStream((token) => {
                    return(ImageHelper.GetStreamFromImageByte(token, _picture));
                }).ErrorPlaceholder("profile_noimage", ImageSource.CompiledResource).Retry(3, 200).Finish(CleanString).Transform(new CircleTransformation()).Into(_imageView);
            }
            else
            {
                _imageView.Image = UIImage.FromBundle("profile_noimage");
                CustomUIExtensions.RoundView(_imageView);
            }

            _openProfileButton.TouchUpInside -= OnOpenProfileButton_TouchUpInside;
            _openProfileButton.TouchUpInside += OnOpenProfileButton_TouchUpInside;
        }
Пример #27
0
        public void Configure(OrganizationInfoModel organizationInfoModel)
        {
            _organizationEvent = organizationInfoModel.OpenOrganizationCommand;

            _imageView.Image?.Dispose();
            ImageService.Instance.LoadStream((token) => {
                return(ImageHelper.GetStreamFromImageByte(token, organizationInfoModel.Picture));
            }).ErrorPlaceholder("organization_noimage", ImageSource.CompiledResource).Transform(new CircleTransformation()).Into(_imageView);

            UILabelExtensions.SetupLabelAppearance(_sectionLabel, organizationInfoModel.Section, Colors.ProfileGray, 12f);
            UILabelExtensions.SetupLabelAppearance(_label, organizationInfoModel.Name, Colors.ProfileGrayDarker, 14f, UIFontWeight.Medium);

            _button.TouchUpInside -= OnButton_TouchUpInside;
            _button.TouchUpInside += OnButton_TouchUpInside;
        }
        private void SetupView()
        {
            _backgroundView.BackgroundColor = Colors.SelectBlue;
            UILabelExtensions.SetupLabelAppearance(_titleLabel, ViewModel.TitleLabel, Colors.White, 24f);
            CustomUIExtensions.LabelShadow(_titleLabel);

            UILabelExtensions.SetupLabelAppearance(_pickerLabel, ViewModel.SelectPositionLabel, Colors.GrayIndicator, 16f, italic: true);
            UIButtonExtensions.SetupButtonAppearance(_submitButton, Colors.White, 18f, ViewModel.SelectButton);
            _pickerImage.Image = UIImage.FromBundle("dropdown_black");

            CustomUIExtensions.RoundShadow(_buttonPickerView);
            CustomUIExtensions.RoundShadow(_picker);
            CustomUIExtensions.RoundShadow(_pickerImage);
            CustomUIExtensions.SelectButton(_buttonView, Colors.White);
        }
Пример #29
0
        public void Configure(DivisionHeaderModel division)
        {
            this.BackgroundColor = Colors.MainBlue;
            UILabelExtensions.SetupLabelAppearance(_nameLabel, division.Name, Colors.White, 17f);
            UILabelExtensions.SetupLabelAppearance(_membersLabel, division.MembersCount, Colors.White, 15f);
            UILabelExtensions.SetupLabelAppearance(_descriptionLabel, division.Description, Colors.White, 15f);

            _backImage.Image    = UIImage.FromBundle("back_white");
            _membersImage.Image = UIImage.FromBundle("members");

            _profileImage.Image?.Dispose();
            ImageService.Instance.LoadStream((token) => {
                return(ImageHelper.GetStreamFromImageByte(token, division.Picture));
            }).ErrorPlaceholder("division_noimage", ImageSource.CompiledResource).Transform(new CircleTransformation()).Into(_profileImage);
            CustomUIExtensions.RoundShadow(_profileImage);
        }
Пример #30
0
        public override UIView GetViewForHeader(UITableView tableView, nint section)
        {
            var view = new UIView();

            view.BackgroundColor = Colors.White;

            if (section == (int)Sections.Divisions)
            {
                var label = new UILabel();
                label.Frame = new CGRect(20, 15, UIScreen.MainScreen.Bounds.Width, 15);
                UILabelExtensions.SetupLabelAppearance(label, _division.DivisionDescriptionLabel, Colors.ProfileGray, 12f);
                view.AddSubview(label);
            }

            return(view);
        }