Beispiel #1
0
 private void prepareContentView()
 {
     contentView       = new UILabel();
     contentView.Lines = 0;
     contentView.Text  = "Material is an animation and graphics framework that is used to create beautiful applications.";
     contentView.Font  = RobotoFont.RegularWithSize(14);
 }
Beispiel #2
0
 private void prepareDateLabel()
 {
     dateLabel           = new UILabel();
     dateLabel.Font      = RobotoFont.RegularWithSize(12f);
     dateLabel.TextColor = Color.BlueGrey.Base;
     dateLabel.Text      = DateTime.Now.ToLongTimeString();
 }
Beispiel #3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            RaisedButton.SetTitle(title: "Button Raised", forState: UIControlState.Normal);
            RaisedButton.SetTitleColor(color: Color.White, forState: UIControlState.Normal);
            RaisedButton.PulseColor      = Color.White;
            RaisedButton.TitleLabel.Font = RobotoFont.RegularWithSize(24f);
            RaisedButton.BackgroundColor = Color.Blue.Base;
        }
        private void prepareRaisedButtonExample()
        {
            nfloat w      = 200;
            var    button = new RaisedButton(new CGRect((View.Bounds.Width - w) / 2, 200, w, 48));

            button.SetTitle(title: "Button Raised", forState: UIControlState.Normal);
            button.SetTitleColor(color: MaterialColor.Blue.Base, forState: UIControlState.Normal);
            button.PulseColor      = MaterialColor.Blue.Base;
            button.TitleLabel.Font = RobotoFont.RegularWithSize(24f);

            // Add button to UIViewController.
            View.AddSubview(button);
        }
        /// <summary>
        /// Показать диалоговое окно.
        /// </summary>
        /// <param name="title">Заголовок окна.</param>
        /// <param name="text">Содержимое текста сообщения.</param>
        /// <param name="image">Изображение.</param>
        /// <param name="text2">Содержимое текста сообщения (вторая строчка. необязательно).</param>
        /// <param name="linkName">Содержимое текста ссылки (необязательно).</param>
        /// <param name="catalogPath">Путь к каталогу текущего сеанса (необязательно).</param>
        public static void Show(string title, string text, Bitmap image, string text2 = "", string linkName = "", string catalogPath = "")
        {
            _formInformationMessageBox = new FormInformationMessageBox
            {
                Text     = title,
                lblInfo  = { Text = text },
                lblInfo2 = { Text = text2 },
                llPath   = { Text = linkName },
                pbImage  = { Image = image }
            };

            _catalogPath = catalogPath;

            RobotoFont.AllocFont(_formInformationMessageBox.llPath, 11);
            _formInformationMessageBox.llPath.LinkClicked += LinkClicked;

            _formInformationMessageBox.ShowDialog();
        }
		void prepareCardView()
		{
			var cardView = new Card();
			cardView.BackgroundColor = Color.Grey.Lighten5;
			cardView.SetCornerRadiusPreset(CornerRadiusPreset.Radius1);
			cardView.Divider = false;
			cardView.ContentViewEdgeInsets = EdgeInsetsPreset.None;
			cardView.SetLayoutEdgeInsetsPreset(EdgeInsetsPreset.Square2;
			cardView.righ = EdgeInsetsPreset.Square2;
			cardView.ContentViewInsetPreset = EdgeInsetsPreset.None;

			var titleLabel = new UILabel();
			titleLabel.Font = RobotoFont.MediumWithSize(20);
			titleLabel.Text = "Messages";
			titleLabel.TextAlignment = UITextAlignment.Center;
			titleLabel.TextColor = MaterialColor.BlueGrey.Darken4;

			var v = new UIView();
			v.BackgroundColor = MaterialColor.Blue.Accent1;

			var closeButton = new FlatButton();
			closeButton.SetTitle("Close", UIControlState.Normal);
			closeButton.SetTitleColor(MaterialColor.Blue.Accent3, UIControlState.Normal);

			var image = MaterialIcon.CM.Settings;
			var settingButton = new IconButton();
			settingButton.TintColor = MaterialColor.Blue.Accent3;
			settingButton.SetImage(image, UIControlState.Normal);
			settingButton.SetImage(image, UIControlState.Highlighted);

			cardView.TitleLabel = titleLabel;
			cardView.ContentView = tableView;
			cardView.LeftButtons = new UIButton[] { closeButton};
			cardView.RightButtons = new UIButton[] { settingButton };

			View.Layout(cardView).Edges(left: 10f, right: 10f, top: 100f, bottom: 100f);
		}
        private void prepareLargeCardViewExample()
        {
            var image = UIImage.FromBundle(name: "CosmicMindInverted");


            var cardView = new MaterialPulseView(frame: new CGRect(16, 100, View.Bounds.Width - 32, 400));

            cardView.PulseColor = MaterialColor.BlueGrey.Base;
            cardView.Depth      = MaterialDepth.Depth1;
            View.AddSubview(cardView);


            var leftImageView = new MaterialView();

            leftImageView.Image = image;
            leftImageView.ContentsGravityPreset = MaterialGravity.ResizeAspectFill;
            cardView.AddSubview(leftImageView);

            var topImageView = new MaterialView();

            topImageView.Image = image;
            topImageView.ContentsGravityPreset = MaterialGravity.ResizeAspectFill;
            cardView.AddSubview(topImageView);

            var bottomImageView = new MaterialView();

            bottomImageView.Image = image;
            bottomImageView.ContentsGravityPreset = MaterialGravity.ResizeAspectFill;
            cardView.AddSubview(bottomImageView);

            var contentView = new MaterialView();

            contentView.BackgroundColor = MaterialColor.Clear;
            cardView.AddSubview(contentView);


            var titleLabel = new UILabel();

            titleLabel.Text            = "Material";
            titleLabel.TextColor       = MaterialColor.BlueGrey.Darken4;
            titleLabel.BackgroundColor = MaterialColor.Clear;
            contentView.AddSubview(titleLabel);


            image = MaterialIcon.CM.Add;
            var moreButton = new IconButton();

            moreButton.ContentEdgeInsetsPreset = MaterialEdgeInset.None;
            moreButton.PulseColor = MaterialColor.BlueGrey.Darken4;
            moreButton.TintColor  = MaterialColor.BlueGrey.Darken4;
            moreButton.SetImage(image: image, forState: UIControlState.Normal);
            moreButton.SetImage(image: image, forState: UIControlState.Highlighted);
            contentView.AddSubview(moreButton);

            var detailLabel = new UILabel();

            detailLabel.Lines           = 0;
            detailLabel.LineBreakMode   = UILineBreakMode.TailTruncation;
            detailLabel.Font            = RobotoFont.RegularWithSize(12);
            detailLabel.Text            = "Express your creativity with Material, an animation and graphics framework for Google's Material Design and Apple's Flat UI in Swift.";
            detailLabel.TextColor       = MaterialColor.BlueGrey.Darken4;
            detailLabel.BackgroundColor = MaterialColor.Clear;
            contentView.AddSubview(detailLabel);

            var alarmLabel = new UILabel();

            alarmLabel.Font            = RobotoFont.RegularWithSize(12);
            alarmLabel.Text            = "34 min";
            alarmLabel.TextColor       = MaterialColor.BlueGrey.Darken4;
            alarmLabel.BackgroundColor = MaterialColor.Clear;
            contentView.AddSubview(alarmLabel);


            image = UIImage.FromBundle(name: "ic_alarm_white").ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);
            var alarmButton = new IconButton();

            alarmButton.ContentEdgeInsetsPreset = MaterialEdgeInset.None;
            alarmButton.PulseColor = MaterialColor.BlueGrey.Darken4;
            alarmButton.TintColor  = MaterialColor.Red.Base;
            alarmButton.SetImage(image: image, forState: UIControlState.Normal);
            alarmButton.SetImage(image: image, forState: UIControlState.Highlighted);
            contentView.AddSubview(alarmButton);

            leftImageView.Grid().Rows    = 7;
            leftImageView.Grid().Columns = 6;


            topImageView.Grid().Rows = 4;
            topImageView.Grid().Columns = 6;
            topImageView.Grid().Offset.Columns = 6;


            bottomImageView.Grid().Rows = 3;
            bottomImageView.Grid().Offset.Rows = 4;
            bottomImageView.Grid().Columns = 6;
            bottomImageView.Grid().Offset.Columns = 6;


            contentView.Grid().Rows = 5;
            contentView.Grid().Offset.Rows = 7;


            cardView.Grid().Axis.Direction = GridAxisDirection.None;
            cardView.Grid().Spacing = 4;
            cardView.Grid().Views   = new List <UIView> {
                leftImageView,
                topImageView,
                bottomImageView,
                contentView
            };


            titleLabel.Grid().Rows    = 3;
            titleLabel.Grid().Columns = 8;


            moreButton.Grid().Rows = 3;
            moreButton.Grid().Columns = 2;
            moreButton.Grid().Offset.Columns = 10;


            detailLabel.Grid().Rows = 6;
            detailLabel.Grid().Offset.Rows = 3;


            alarmLabel.Grid().Rows = 3;
            alarmLabel.Grid().Columns = 8;
            alarmLabel.Grid().Offset.Rows = 9;


            alarmButton.Grid().Rows = 3;
            alarmButton.Grid().Offset.Rows = 9;
            alarmButton.Grid().Columns = 2;
            alarmButton.Grid().Offset.Columns = 10;


            contentView.Grid().Spacing = 8;
            contentView.Grid().Axis.Direction = GridAxisDirection.None;
            contentView.Grid().ContentInsetPreset = MaterialEdgeInset.Square3;
            contentView.Grid().Views              = new List <UIView> {
                titleLabel,
                moreButton,
                detailLabel,
                alarmLabel,
                alarmButton
            };
        }
Beispiel #8
0
        private DateTime _worktimestart;                                    // Сколько времени ушло на декодирование (потом удалить).

        public Form()
        {
            RobotoFont.LoadFont();
            InitializeComponent();
        }