コード例 #1
0
        private void SetupUI()
        {
            var backButton = new UIButton(new RectangleF(0, 0, 25, 25));

            backButton.SetBackgroundImage(UIImage.FromFile("Images/General/BackButton.png"), UIControlState.Normal);
            backButton.SetBackgroundImage(UIImage.FromFile("Images/General/BackButtonHighlighted.png"), UIControlState.Highlighted);
            backButton.AddTarget((object sender, EventArgs args) => NavigationController.PopViewControllerAnimated(true),
                                 UIControlEvent.TouchUpInside);

            var cancelButton = new UIButton(new RectangleF(0, 0, 25, 25));

            cancelButton.SetBackgroundImage(UIImage.FromFile(Images.CancelButton), UIControlState.Normal);
            cancelButton.SetBackgroundImage(UIImage.FromFile(Images.CancelButtonHighlighted), UIControlState.Highlighted);
            cancelButton.AddTarget(HandleCancelButtonTapped, UIControlEvent.TouchUpInside);

            BackButton   = new UIBarButtonItem(backButton);
            CancelButton = new UIBarButtonItem(cancelButton);

            NavigationController.NavigationItem.BackBarButtonItem = BackButton;
            NavigationItem.LeftBarButtonItem = CancelButton;

            NavigationController.NavigationBar.BarStyle = UIBarStyle.Black;

            NavigationBarLabel        = InterfaceHelper.LabelForTitle("SETTINGS");
            TableView.BackgroundView  = null;
            TableView.BackgroundColor = UIColor.FromPatternImage(UIImage.FromFile("Images/General/TableBackground.png"));
        }
コード例 #2
0
ファイル: VerseDetailDialog.cs プロジェクト: witheej/Verses
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            var nonEmptyCommentsSection = verse.Comments.Length != 0;

            if (nonEmptyCommentsSection)
            {
                blackLine.Hidden    = false;
                commentsArea.Hidden = false;

                commentsArea.Text  = verse.Comments;
                commentsArea.Frame = new RectangleF(commentsArea.Frame.X, commentsArea.Frame.Y, commentsArea.Frame.Width,
                                                    InterfaceHelper.ContentSize(commentsArea.Text, contentArea.Frame.Width, contentArea.Font));

                shareButton.Frame = new RectangleF(shareButton.Frame.X, commentsArea.Frame.Bottom + 22f, shareButton.Frame.Width, shareButton.Frame.Height);
            }
            else
            {
                blackLine.Hidden    = true;
                commentsArea.Hidden = true;

                shareButton.Frame = new RectangleF(shareButton.Frame.X, contentArea.Frame.Bottom + 22f, shareButton.Frame.Width, shareButton.Frame.Height);
            }

            backingBackButton.TouchUpInside += HandleBackButtonTapped;
            backingEditButton.TouchUpInside += HandleEditButtonTapped;

            shareButton.TouchUpInside     += HandleShareTapped;
            copyrightButton.TouchUpInside += HandleCopyrightButtonTapped;
        }
コード例 #3
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            NavigationController.NavigationBar.SetBackgroundImage(Images.BlankBar, UIBarMetrics.Default);
            NavigationBarLabel       = InterfaceHelper.LabelForTitle("EDIT");
            NavigationItem.TitleView = NavigationBarLabel;
        }
コード例 #4
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            NavigationController.NavigationBar.SetBackgroundImage(Images.BlankBar, UIBarMetrics.Default);
            NavigationBarLabel       = InterfaceHelper.LabelForTitle("PRAYERS");
            NavigationItem.TitleView = NavigationBarLabel;

            PrayersTable.Source = new PrayersTableSource(this);
        }
コード例 #5
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            NavigationController.NavigationBar.SetBackgroundImage(UIImage.FromFile(Images.BlankBar), UIBarMetrics.Default);
            SetupNavigationBar();

            navigationBarLabel       = InterfaceHelper.LabelForTitle(controllerHeader);
            NavigationItem.TitleView = navigationBarLabel;
        }
コード例 #6
0
ファイル: PrayerDetailDialog.cs プロジェクト: arsalan/Verses
        private void SetupUI()
        {
            ScrollView = new UIScrollView()
            {
                BackgroundColor = UIColor.FromPatternImage(Images.TableViewBackground),
                Frame           = new RectangleF(0, 0, View.Bounds.Width, View.Bounds.Height),
                PagingEnabled   = false,
                ScrollEnabled   = true
            };
            View.Add(ScrollView);

            TopBarArea = new UITextField()
            {
                BackgroundColor   = UIColor.White,
                Enabled           = false,
                Font              = FontConstants.SourceSansProRegular(13),
                Frame             = new RectangleF(14f, 22f, 294f, 32f),
                LeftView          = new UIImageView(Images.TimeIcon),
                LeftViewMode      = UITextFieldViewMode.Always,
                Text              = Prayer.Timestamp.ToShortDateString(),
                TextAlignment     = UITextAlignment.Left,
                VerticalAlignment = UIControlContentVerticalAlignment.Center
            };

            ContentArea = new UILabel()
            {
                BackgroundColor = UIColor.White,
                Font            = FontConstants.SourceSansProRegular(13),
                Frame           = new RectangleF(14f, 48f, 294f, 10f),
                LineBreakMode   = UILineBreakMode.TailTruncation,
                Lines           = 0,
                Text            = Prayer.Content,
                TextAlignment   = UITextAlignment.Left
            };
            ScrollView.Add(ContentArea);
            ContentArea.Frame = new RectangleF(14f, 52f, 294f,
                                               InterfaceHelper.ContentSize(ContentArea.Text, ContentArea.Frame.Width, ContentArea.Font));

            var height = ContentArea.Bounds.Height + 79f;

            ShareButton = new UIButton()
            {
                Frame = new RectangleF(33.5f, height, 253f, 33f)
            };
            ShareButton.SetBackgroundImage(Images.ShareButton, UIControlState.Normal);
            ShareButton.AddTarget(HandleShareTapped, UIControlEvent.TouchUpInside);

            ScrollView.Add(TopBarArea);
            ScrollView.Add(ShareButton);

            // ShareButton + NavBar + TabBar + (2 * 22f)
            var contentSize = ShareButton.Frame.Y + 170;

            ScrollView.ContentSize = new SizeF(320f, contentSize);
        }
コード例 #7
0
ファイル: PrayerDetailDialog.cs プロジェクト: arsalan/Verses
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            SetupNavigationBar();
            NavigationController.NavigationBar.SetBackgroundImage(Images.BlankBar, UIBarMetrics.Default);
            NavigationBarLabel       = InterfaceHelper.LabelForTitle(Prayer.Title.ToUpper());
            NavigationItem.TitleView = NavigationBarLabel;

            SetupUI();
        }
コード例 #8
0
ファイル: PrayerDetailDialog.cs プロジェクト: arsalan/Verses
        public override void ViewDidAppear(bool animated)
        {
            base.ViewDidAppear(animated);

            TopBarArea.Text  = Prayer.Timestamp.ToShortDateString();
            ContentArea.Text = Prayer.Content;

            ContentArea.Frame = new RectangleF(14f, 52f, 294f,
                                               InterfaceHelper.ContentSize(ContentArea.Text, ContentArea.Frame.Width, ContentArea.Font));
            ShareButton.Frame = new RectangleF(ShareButton.Frame.X, ContentArea.Frame.Height + 79f, ShareButton.Frame.Width, ShareButton.Frame.Height);
        }
コード例 #9
0
        protected override void PrepareDialogViewController(UIViewController dvc)
        {
            base.PrepareDialogViewController(dvc);

            NavigationBarLabel           = InterfaceHelper.LabelForTitle(Caption.ToUpper());
            dvc.NavigationItem.TitleView = NavigationBarLabel;

            var backButton = new UIButton(new RectangleF(0, 0, 25, 25));

            backButton.SetBackgroundImage(UIImage.FromFile("Images/General/BackButton.png"), UIControlState.Normal);
            backButton.SetBackgroundImage(UIImage.FromFile("Images/General/BackButtonHighlighted.png"), UIControlState.Highlighted);
            backButton.AddTarget((object sender, EventArgs args) => GoBack(dvc),
                                 UIControlEvent.TouchUpInside);

            BackButton = new UIBarButtonItem(backButton);
            dvc.NavigationItem.LeftBarButtonItem = BackButton;
        }
コード例 #10
0
        public override void ViewDidAppear(bool animated)
        {
            base.ViewDidAppear(animated);

            if (verse.Comments.Length != 0)
            {
                BlackLine.Hidden    = false;
                CommentsArea.Hidden = false;

                CommentsArea.Text  = verse.Comments;
                CommentsArea.Frame = new RectangleF(CommentsArea.Frame.X, CommentsArea.Frame.Y, CommentsArea.Frame.Width,
                                                    InterfaceHelper.ContentSize(CommentsArea.Text, ContentArea.Frame.Width, ContentArea.Font));

                ShareButton.Frame      = new RectangleF(ShareButton.Frame.X, CommentsArea.Frame.Bottom + 22f, ShareButton.Frame.Width, ShareButton.Frame.Height);
                ToMemorizeButton.Frame = new RectangleF(ToMemorizeButton.Frame.X, ShareButton.Frame.Bottom + 10f, ToMemorizeButton.Frame.Width, ToMemorizeButton.Frame.Height);
                MemorizedButton.Frame  = new RectangleF(MemorizedButton.Frame.X, ToMemorizeButton.Frame.Bottom + 10f, MemorizedButton.Frame.Width, MemorizedButton.Frame.Height);
            }
        }
コード例 #11
0
        void SetupUI()
        {
            NavigationController.NavigationBar.SetBackgroundImage(Images.BlankBar, UIBarMetrics.Default);
            var title = memorizationCategory.ToString().ToUpper();

            NavigationBarLabel       = InterfaceHelper.LabelForTitle(title);
            NavigationItem.TitleView = NavigationBarLabel;

            var backButton = new UIButton(new RectangleF(0, 0, 25, 25));

            backButton.SetBackgroundImage(Images.BackButton, UIControlState.Normal);
            backButton.SetBackgroundImage(Images.BackButtonHighlighted, UIControlState.Highlighted);
            backButton.AddTarget((sender, args) => NavigationController.PopViewControllerAnimated(true),
                                 UIControlEvent.TouchUpInside);

            BackButton = new UIBarButtonItem(backButton);
            NavigationItem.LeftBarButtonItem = BackButton;

            TableView.SeparatorStyle  = UITableViewCellSeparatorStyle.None;
            TableView.SeparatorColor  = UIColor.Clear;
            TableView.BackgroundView  = null;
            TableView.BackgroundColor = UIColor.FromPatternImage(Images.TableViewBackground);
        }
コード例 #12
0
 private void RefreshNavigationBar()
 {
     NavigationBarLabel       = InterfaceHelper.LabelForTitle(name.ToUpperInvariant());
     NavigationItem.TitleView = NavigationBarLabel;
 }
コード例 #13
0
ファイル: VerseDetailDialog.cs プロジェクト: witheej/Verses
        private void SetupUI()
        {
            View.BackgroundColor = UIColor.White;

            scrollView = new UIScrollView {
                BackgroundColor = UIColor.Clear,
                Frame           = new RectangleF(0, 0, View.Bounds.Width, View.Bounds.Height),
                PagingEnabled   = false,
                ScrollEnabled   = true
            };
            View.Add(scrollView);

            contentArea = new UILabel {
                BackgroundColor = UIColor.Clear,
                Font            = FontConstants.SourceSansProRegular(15),
                Frame           = new RectangleF(14f, 35f, 294f, 10f),
                LineBreakMode   = UILineBreakMode.TailTruncation,
                Lines           = 0,
                Text            = verse.Content,
                TextAlignment   = UITextAlignment.Left
            };
            scrollView.Add(contentArea);
            contentArea.Frame = new RectangleF(14f, 35f, 294f,
                                               InterfaceHelper.ContentSize(contentArea.Text, contentArea.Frame.Width, contentArea.Font));

            var height = contentArea.Bounds.Height + 45f;

            blackLine = new UIView {
                BackgroundColor = UIColor.FromPatternImage(UIImage.FromFile(Images.BlackLine)),
                Frame           = new RectangleF(24, height, 284f, 1f)
            };
            scrollView.Add(blackLine);

            height       = contentArea.Frame.Height + blackLine.Frame.Height + 50f;
            commentsArea = new UILabel {
                BackgroundColor = UIColor.Clear,
                Font            = FontConstants.SourceSansProRegular(15),
                Frame           = new RectangleF(14f, height, 294f, 10f),
                LineBreakMode   = UILineBreakMode.TailTruncation,
                Lines           = 0,
                Text            = verse.Comments,
                TextAlignment   = UITextAlignment.Left
            };
            scrollView.Add(commentsArea);

            if (verse.Comments.Length != 0)
            {
                commentsArea.Frame = new RectangleF(14f, height, 294f,
                                                    InterfaceHelper.ContentSize(commentsArea.Text, contentArea.Frame.Width, contentArea.Font));
            }
            else
            {
                commentsArea.Hidden = true;
                blackLine.Hidden    = true;
            }

            height      = contentArea.Bounds.Height + 45;
            shareButton = new UIButton {
                Frame = new RectangleF(33.5f, height, 253f, 33f)
            };
            shareButton.SetBackgroundImage(UIImage.FromFile(Images.ShareButton), UIControlState.Normal);

            copyrightButton = new UIButton {
                Enabled = true,
                Frame   = new RectangleF(282, 5, 25, 25),
                UserInteractionEnabled = true
            };
            copyrightButton.SetBackgroundImage(UIImage.FromFile(Images.CopyrightButton), UIControlState.Normal);

            scrollView.Add(shareButton);
            scrollView.Add(copyrightButton);

            var contentSize = shareButton.Frame.Y + 170;

            scrollView.ContentSize = new SizeF(320f, contentSize);
        }
コード例 #14
0
        private void SetupUI()
        {
            View.BackgroundColor = UIColor.FromPatternImage(Images.TableViewBackground);

            ScrollView = new UIScrollView {
                BackgroundColor = UIColor.FromPatternImage(Images.TableViewBackground),
                Frame           = new RectangleF(0, 0, View.Bounds.Width, View.Bounds.Height),
                PagingEnabled   = false,
                ScrollEnabled   = true
            };
            View.Add(ScrollView);

            TopBarArea = new UITextField {
                BackgroundColor        = UIColor.White,
                Enabled                = false,
                UserInteractionEnabled = false,
                Font              = FontConstants.SourceSansProRegular(13),
                Frame             = new RectangleF(14f, 22f, 294f, 32f),
                LeftView          = new UIImageView(Images.TimeIcon),
                LeftViewMode      = UITextFieldViewMode.Always,
                Text              = verse.Timestamp.ToShortDateString(),
                TextAlignment     = UITextAlignment.Left,
                VerticalAlignment = UIControlContentVerticalAlignment.Center
            };

            ContentArea = new UILabel {
                BackgroundColor = UIColor.White,
                Font            = FontConstants.SourceSansProRegular(13),
                Frame           = new RectangleF(14f, 48f, 294f, 10f),
                LineBreakMode   = UILineBreakMode.TailTruncation,
                Lines           = 0,
                Text            = verse.Content,
                TextAlignment   = UITextAlignment.Left
            };
            ScrollView.Add(ContentArea);
            ContentArea.Frame = new RectangleF(14f, 52f, 294f,
                                               InterfaceHelper.ContentSize(ContentArea.Text, ContentArea.Frame.Width, ContentArea.Font));

            var height = ContentArea.Bounds.Height + 50f;

            BlackLine = new UIView {
                BackgroundColor = UIColor.FromPatternImage(Images.BlackLine),
                Frame           = new RectangleF(24, height, 284f, 1f)
            };
            ScrollView.Add(BlackLine);

            height       = ContentArea.Frame.Height + BlackLine.Frame.Height + 50f;       // BlackLine.Frame.Height + 50f;
            CommentsArea = new UILabel {
                BackgroundColor = UIColor.White,
                Font            = FontConstants.SourceSansProRegular(13),
                Frame           = new RectangleF(14f, height, 294f, 10f),
                LineBreakMode   = UILineBreakMode.TailTruncation,
                Lines           = 0,
                Text            = verse.Comments,
                TextAlignment   = UITextAlignment.Left
            };
            ScrollView.Add(CommentsArea);

            if (verse.Comments.Length != 0)
            {
                CommentsArea.Frame = new RectangleF(14f, height, 294f,
                                                    InterfaceHelper.ContentSize(CommentsArea.Text, ContentArea.Frame.Width, ContentArea.Font));
            }
            else
            {
                CommentsArea.Hidden = true;
                BlackLine.Hidden    = true;
            }

            height      = CommentsArea.Frame.Bottom + 22f;
            ShareButton = new UIButton {
                Frame = new RectangleF(33.5f, height, 253f, 33f)
            };
            ShareButton.SetBackgroundImage(Images.ShareButton, UIControlState.Normal);
            ShareButton.AddTarget(HandleShareTapped, UIControlEvent.TouchUpInside);

            var toMemorizeHeight = ShareButton.Frame.Bottom + 10f;

            ToMemorizeButton = new UIButton {
                Frame = new RectangleF(33.5f, toMemorizeHeight, 253f, 33f)
            };
            ToMemorizeButton.AddTarget(HandleToMemorizeTapped, UIControlEvent.TouchUpInside);

            var memorizable = verse.Memorizable;

            if (memorizable)
            {
                ToMemorizeButton.SetBackgroundImage(Images.ToMemorizeGreenButton, UIControlState.Normal);
            }
            else
            {
                ToMemorizeButton.SetBackgroundImage(Images.ToMemorizeRedButton, UIControlState.Normal);
            }

            var memorizedHeight = ToMemorizeButton.Frame.Bottom + 10f;

            MemorizedButton = new UIButton {
                Frame = new RectangleF(33.5f, memorizedHeight, 253f, 33f)
            };
            MemorizedButton.AddTarget(HandleMemorizedTapped, UIControlEvent.TouchUpInside);

            var memorized = verse.Memorized;

            if (memorized)
            {
                MemorizedButton.SetBackgroundImage(Images.MemorizedGreenButton, UIControlState.Normal);
            }
            else
            {
                MemorizedButton.SetBackgroundImage(Images.MemorizedRedButton, UIControlState.Normal);
            }

            if (!verse.Memorizable)
            {
                MemorizedButton.Hidden = true;
            }

            CopyrightButton = new UIButton {
                Enabled = true,
                Frame   = new RectangleF(282, 22, 25, 25),
                UserInteractionEnabled = true
            };
            CopyrightButton.SetBackgroundImage(Images.CopyrightButton, UIControlState.Normal);
            CopyrightButton.AddTarget(HandleCopyrightButtonTapped, UIControlEvent.TouchUpInside);

            ScrollView.Add(TopBarArea);
            ScrollView.Add(ShareButton);
            ScrollView.Add(ToMemorizeButton);
            ScrollView.Add(MemorizedButton);
            ScrollView.Add(CopyrightButton);

            var contentSize = MemorizedButton.Frame.Y + 170;

            ScrollView.ContentSize = new SizeF(320f, contentSize);
        }