Example #1
0
        public LeadListHeaderView(Command newLeadTappedCommand)
        {
            _NewLeadTappedCommand = newLeadTappedCommand;

            #region title label
            Label headerTitleLabel = new Label()
            {
                Text = TextResources.Leads_LeadListHeaderTitle.ToUpperInvariant(),
                TextColor = Palette._003,
                FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                FontAttributes = FontAttributes.Bold,
                HorizontalTextAlignment = TextAlignment.Start,
                VerticalTextAlignment = TextAlignment.Center
            };
            #endregion

            #region new lead image "button"
            var newLeadImage = new Image
            {
                Source = new FileImageSource { File = Device.OnPlatform("add_ios_gray", "add_android_gray", null) },
                Aspect = Aspect.AspectFit, 
                HorizontalOptions = LayoutOptions.EndAndExpand,
            };
            //Going to use FAB
            newLeadImage.IsVisible = false;
            newLeadImage.GestureRecognizers.Add(new TapGestureRecognizer()
                {
                    Command = _NewLeadTappedCommand,
                    NumberOfTapsRequired = 1
                });
            #endregion

            #region absolutLayout
            AbsoluteLayout absolutLayout = new AbsoluteLayout();

            absolutLayout.Children.Add(
                headerTitleLabel, 
                new Rectangle(0, .5, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize), 
                AbsoluteLayoutFlags.PositionProportional);

            absolutLayout.Children.Add(
                newLeadImage, 
                new Rectangle(1, .5, AbsoluteLayout.AutoSize, .5), 
                AbsoluteLayoutFlags.PositionProportional | AbsoluteLayoutFlags.HeightProportional);
            #endregion

            #region setup contentView
            ContentView contentView = new ContentView()
            {
                Padding = new Thickness(10, 0), // give the content some padding on the left and right
                HeightRequest = RowSizes.MediumRowHeightDouble, // set the height of the content view
            };
            #endregion

            #region compose the view hierarchy
            contentView.Content = absolutLayout;
            #endregion

            Content = contentView;
        }
 private void InitializeComponent()
 {
     this.LoadFromXaml(typeof(SamplePage));
     list = this.FindByName <ListView>("list");
     modal = this.FindByName <AbsoluteLayout>("modal");
     menu = this.FindByName <StackLayout>("menu");
 }
Example #3
0
        public ProjectListPage()
        {
            NavigationPage.SetHasNavigationBar (this, true);

            Title = "Jira It";

            _listview = new ListView {
                RowHeight = 42,
                ItemTemplate = new DataTemplate (typeof(ProjectItemCell))
            };

            _listview.ItemSelected += (sender, e) => {
                var project = (Project) e.SelectedItem;
                var issueListPage = new IssueListPage(project);

                App.CurrentPage = issueListPage;

                Navigation.PushAsync (issueListPage);
            };

            var main = new StackLayout {
                VerticalOptions = LayoutOptions.FillAndExpand,
                Children = { _listview }
            };

            AbsoluteLayoutHelper.SetControlToFull (main);

            Content = new AbsoluteLayout {
                Children = {
                    main
                }
            };
        }
        public ChessboardDynamicPage()
        {
            absoluteLayout = new AbsoluteLayout
            {
                BackgroundColor = Color.FromRgb(240, 220, 130),
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.Center
            };

            for (int i = 0; i < 32; i++)
            {
                BoxView boxView = new BoxView
                {
                    Color = Color.FromRgb(0, 64, 0)
                };
                absoluteLayout.Children.Add(boxView);
            }

            ContentView contentView = new ContentView
            {
                Content = absoluteLayout
            };
            contentView.SizeChanged += OnContentViewSizeChanged;

            this.Padding = new Thickness(5, Device.OnPlatform(25, 5, 5), 5, 5);
            this.Content = contentView;
        }
        public NewImagePage()
        {
            mImage = new Image
            {
                Source = "http://developer.xamarin.com/demo/IMG_1415.JPG?width=512"
            };

            tapPointsLayout = new AbsoluteLayout
            {
                VerticalOptions = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center,
                BackgroundColor = Color.Teal
            };
            tapPointsLayout.Children.Add(mImage);

            imageContainer = new ContentView
            {
                Content = tapPointsLayout,
                VerticalOptions = LayoutOptions.FillAndExpand,
                BackgroundColor = Color.Yellow
            };
            imageContainer.SizeChanged += imageContainer_SizeChanged;

            Content = new StackLayout
            {
                Children = {
                    new Label { Text = "Hello ContentPage" },
                    imageContainer,
                    new Label { Text = "PAUL IS COOL"}
                }
            };

            //Content.SizeChanged += Content_SizeChanged;
        }
		/// <summary>
		/// Initializes a new instance of the <see cref="AbsoluteLayoutWithDisplayInfoPage" /> class.
		/// </summary>
		/// <param name="display">The display.</param>
		public AbsoluteLayoutWithDisplayInfoPage(IDisplay display)
		{
			this.Title = "Absolute Layout With Display Info";
			var abs = new AbsoluteLayout();
			var inchX = display.WidthRequestInInches(1);
			var inchY = display.HeightRequestInInches(1);
			var originX = display.WidthRequestInInches(display.ScreenWidthInches() / 2);
			var originY = display.HeightRequestInInches(display.ScreenHeightInches() / 2);

			abs.Children.Add(new Label() { Text = "1\"x\"1\" blue frame" });

			abs.Children.Add(new Frame()
				{
					BackgroundColor = Color.Navy,
				},
				new Rectangle(originX - inchX/2, originY - inchY/2, inchX, inchY));

			abs.Children.Add(new Frame()
				{
					BackgroundColor = Color.White
				},
				new Rectangle(originX - inchX/16, originY - inchY/16, inchX/8, inchY/8));

			this.Content = abs;
		}
		public RelativeLayoutDemoCode ()
		{
			Title = "Relative Layout Demo - C#";
			outerLayout = new AbsoluteLayout ();
			layout = new RelativeLayout ();
			centerLabel = new Label { FontSize = 20, Text = "RelativeLayout Demo"};
			buttonLayout = new AbsoluteLayout ();
			box = new BoxView { Color = Color.Blue, HeightRequest = 50, WidthRequest = 50 };
			layout.Children.Add (box, Constraint.RelativeToParent ((parent) => {
				return (parent.Width * .5) - 50;
			}), Constraint.RelativeToParent ((parent) => {
				return (parent.Height * .1) - 50;
			}));
			layout.Children.Add (centerLabel, Constraint.RelativeToParent ((parent) => {
				return (parent.Width * .5) - 50;
			}), Constraint.RelativeToParent ((parent) => {
				return (parent.Height * .5) - 50;
			}));
			moveButton = new Button { BackgroundColor = Color.White, FontSize = 20, TextColor = Color.Lime, Text = "Move", BorderRadius = 0};
			buttonLayout.Children.Add (moveButton, new Rectangle(0,1,1,1), AbsoluteLayoutFlags.All);
			outerLayout.Children.Add (layout, new Rectangle(0,0,1,1), AbsoluteLayoutFlags.All);
			outerLayout.Children.Add (buttonLayout, new Rectangle(0,1,1,50), AbsoluteLayoutFlags.PositionProportional|AbsoluteLayoutFlags.WidthProportional);

			moveButton.Clicked += MoveButton_Clicked;
			x = 0f;
			y = 0f;
			Content = outerLayout;
		}
Example #8
0
        public ProductImagePage(ImageSource productImageSource)
        {
            Padding = Device.OnPlatform(new Thickness(0, 20, 0, 0), new Thickness(0), new Thickness(0));
            _productImageSource = productImageSource;
            BackgroundColor = Color.FromRgba(0, 0, 0, 127);

            var absoluteLayout = new AbsoluteLayout
            {
                VerticalOptions = LayoutOptions.FillAndExpand
            };
            var closeButtom = new Button
            {
                WidthRequest = 50,
                Image = "backspace.png",
                BackgroundColor = Color.Transparent
            };
            closeButtom.Clicked += OnCloseButtonClicked;
            var image = new Image
            {
                Source = _productImageSource
            };
            AbsoluteLayout.SetLayoutFlags(closeButtom, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds(closeButtom, new Rectangle(1f, 0f, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
            AbsoluteLayout.SetLayoutFlags(image, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds(image, new Rectangle(0.5f, 0.5f, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
            absoluteLayout.Children.Add(image); 
            absoluteLayout.Children.Add(closeButtom);

            Content = absoluteLayout;
        }
Example #9
0
 public GradientChanger(SensorManager sensorManager, SensorType sensorType, AbsoluteLayout layout)
 {
     this._sensorManager = sensorManager;
     this._sensorType = sensorType;
     _layout = layout;
     this.StartListening();
 }
        public ChessboardFixed()
        {
            const double squareSize = 35;

            AbsoluteLayout absoluteLayout = new AbsoluteLayout
            {
                BackgroundColor = Color.FromRgb(240, 220, 130),
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.Center
            };

            for (int row = 0; row < 8; row++)
            {
                for (int col = 0; col < 8; col++)
                {
                    //Skip every other square.
                    if (((row ^ col) & 1) == 0)
                        continue;

                    BoxView boxView = new BoxView
                    {
                        Color = Color.FromRgb(0, 64, 0)
                    };

                    Rectangle rect = new Rectangle(col * squareSize,
                        row * squareSize,
                        squareSize, squareSize);

                    absoluteLayout.Children.Add(boxView, rect);
                }
            }

            this.Content = absoluteLayout;
        }
Example #11
0
		protected override void Init ()
		{
			AbsoluteLayout layout = new AbsoluteLayout {
				HorizontalOptions = LayoutOptions.FillAndExpand,
				VerticalOptions = LayoutOptions.FillAndExpand,
			};

			BackgroundColor = Color.FromUint (0xFFDBDBDB);

			_btnLogin = new Button {
				HorizontalOptions = LayoutOptions.FillAndExpand,

				Text = "Press me",
				BackgroundColor = Color.FromUint (0xFF6E932D),
				TextColor = Color.White,
			};
			_btnLogin.Clicked += BtnLogin_Clicked;
			layout.Children.Add (_btnLogin, new Rectangle (0.5f, 0.5f, 0.25f, 0.25f), AbsoluteLayoutFlags.All);

			_busyBackground = new BoxView {
				BackgroundColor = new Color (0, 0, 0, 0.5f),
				IsVisible = false,
				InputTransparent = false
			};
			layout.Children.Add (_busyBackground, new Rectangle (0, 0, 1, 1), AbsoluteLayoutFlags.SizeProportional);

			Content = layout;
		}
		public MyAbsoluteLayout ()
		{
			var red = new Label {
				Text = "Stop", 
				BackgroundColor = Color.Red,
				Font = Font.SystemFontOfSize (20), 
				WidthRequest = 200, HeightRequest = 30
			};
			var yellow = new Label {
				Text = "Slow down", 
				BackgroundColor = Color.Yellow,
				Font = Font.SystemFontOfSize (20),
				 WidthRequest = 160, HeightRequest = 160
			};
			var green = new Label {
				Text = "Go", 
				BackgroundColor = Color.Green,
				Font = Font.SystemFontOfSize (20),
				WidthRequest = 50, HeightRequest = 50
			};

			var absLayout = new AbsoluteLayout ();
			absLayout.Children.Add (red, new Point (20, 20));
			absLayout.Children.Add (yellow, new Point (40, 60));
			absLayout.Children.Add (green, new Point (80, 180));

			Content = absLayout;
		}
		/// <summary>
		/// Initializes a new instance of the <see cref="DLToolkit.Forms.Controls.FlowListViewInternalCell"/> class.
		/// </summary>
		/// <param name="flowListViewRef">Flow list view reference.</param>
		public FlowListViewInternalCell(WeakReference<FlowListView> flowListViewRef)
		{
			_flowListViewRef = flowListViewRef;
			FlowListView flowListView = null;
			flowListViewRef.TryGetTarget(out flowListView);
			_useGridAsMainRoot = !flowListView.FlowUseAbsoluteLayoutInternally;

			if (!_useGridAsMainRoot)
			{
				_rootLayout = new AbsoluteLayout()
				{
					Padding = 0d,
					BackgroundColor = flowListView.FlowRowBackgroundColor,
				};
				View = _rootLayout;
			}
			else
			{
				_rootLayoutAuto = new Grid()
				{
					RowSpacing = 0d,
					ColumnSpacing = 0d,
					Padding = 0d,
					BackgroundColor = flowListView.FlowRowBackgroundColor,
				};
				View = _rootLayoutAuto;
			}

			_flowColumnTemplate = flowListView.FlowColumnTemplate;
			_desiredColumnCount = flowListView.DesiredColumnCount;
			_flowColumnExpand = flowListView.FlowColumnExpand;
		}
Example #14
0
        public AboutPage()
        {
            Title = "Informacoes";
            //			GetValue ();

            var stack = new StackLayout {

                VerticalOptions = LayoutOptions.FillAndExpand,
                Children = {
                    lbInformation
                }
            };

            var scroll = new ScrollView {
                BackgroundColor = Colors.BackgroundDefault,
                Content = stack
            };

            var absoluteLayout = new AbsoluteLayout ();
            var background = new Image {
                Style = Styles.BackgroundImage
            };

            absoluteLayout.Children.Add (background, new Rectangle (0, 0, 1, 1), AbsoluteLayoutFlags.All);
            absoluteLayout.Children.Add (scroll, new Rectangle (0, 0, 1, 1), AbsoluteLayoutFlags.All);

            Content = absoluteLayout;
        }
		public RotateAnimationWithAnchorsPageCS ()
		{
			Title = "Rotate Animation with Anchors";

			image = new Image { Source = ImageSource.FromFile ("monkey.png"), VerticalOptions = LayoutOptions.EndAndExpand };
			startButton = new Button { Text = "Start Animation", VerticalOptions = LayoutOptions.End };
			cancelButton = new Button { Text = "Cancel Animation", IsEnabled = false };

			image.SizeChanged += OnImageSizeChanged;
			startButton.Clicked += OnStartAnimationButtonClicked;
			cancelButton.Clicked += OnCancelAnimationButtonClicked;

			absoluteLayout = new AbsoluteLayout ();
			absoluteLayout.Children.Add (image);

			var stackLayout = new StackLayout {
				Children = {
					startButton,
					cancelButton
				}
			};

			var grid = new Grid { 
				RowDefinitions = {
					new RowDefinition { Height = new GridLength (0.8, GridUnitType.Star) },
					new RowDefinition { Height = new GridLength (0.2, GridUnitType.Star) }
				},
				Children = {
					absoluteLayout,
				}
			};

			grid.Children.Add (stackLayout, 0, 1);
			Content = grid;
		}
        public GerenciarFeriadosView(GerenciarFeriadosViewModel viewModel)
        {

            Title = "Feriados";
            BindingContext = viewModel;
            this.SetBinding(ContentPage.NavigationProperty, "Navigation", BindingMode.TwoWay);
            // message.SetBinding(Label.IsVisibleProperty, "messageVisibility", BindingMode.TwoWay);
            listViewHolidays.SetBinding(ListView.ItemsSourceProperty, "holidays", BindingMode.TwoWay);
            listViewHolidays.ItemTemplate = new DataTemplate(typeof(TwoColumnsGridCell));
            listViewHolidays.ItemTapped += listViewHolidays_ItemTapped;

            FloatButton.AnimateWithAction();
            FloatButton.Command = new Command(toolbarAddHoliday);
            /*ToolbarItems.Add(new ToolbarItem
            {
                Icon = Images.Add2,
                Order = ToolbarItemOrder.Primary,
                Command = new Command(toolbarAddHoliday)
            });*/

            iconStack = new StackLayout
            {
                VerticalOptions = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                Children = { iconMsg, message }
            };

            stack = new StackLayout
            {
                Padding = new Thickness(0, 15, 0, 0),
                VerticalOptions = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                BackgroundColor = Color.FromHex("#ECEFF1"),
                Children = { listViewHolidays }
            };

            var absoluteLayout = new AbsoluteLayout
            {
                VerticalOptions = LayoutOptions.FillAndExpand,
            };
            //var background = new Image { Source = Images.Background, Aspect = Aspect.Fill };

            //absoluteLayout.Children.Add (background, new Rectangle (0, 0, 1, 1), AbsoluteLayoutFlags.All);
            //AbsoluteLayout.SetLayoutFlags(background, AbsoluteLayoutFlags.All);
            //AbsoluteLayout.SetLayoutBounds(background, new Rectangle(0, 0, 1, 1));

            //absoluteLayout.Children.Add (stack, new Rectangle (0, 0, 1, 1), AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutFlags(stack, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(stack, new Rectangle(0, 0, 1, 1));

            //absoluteLayout.Children.Add (Add, new Rectangle (0.85, 0.85, 0.185, 0.1), AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutFlags(FloatButton, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds(FloatButton, new Rectangle(0.99f, 0.98f, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));

            //absoluteLayout.Children.Add(background);
            absoluteLayout.Children.Add(stack);
            absoluteLayout.Children.Add(FloatButton);

            Content = absoluteLayout;
        }
        public AbsoluteLayoutExample()
        {
            Label red = new Label
                        {
                            Text = "Stop",
                            BackgroundColor = Color.Red,
                            FontSize = 20,
                            WidthRequest = 200,
                            HeightRequest = 30
                        };
            Label yellow = new Label
                           {
                               Text = "Slow down",
                               BackgroundColor = Color.Yellow,
                               FontSize = 20,
                               WidthRequest = 160,
                               HeightRequest = 160
                           };
            Label green = new Label
                          {
                              Text = "Go",
                              BackgroundColor = Color.Green,
                              FontSize = 20,
                              WidthRequest = 50,
                              HeightRequest = 50
                          };
            AbsoluteLayout absLayout = new AbsoluteLayout();
            absLayout.Children.Add(red, new Point(20, 20));
            absLayout.Children.Add(yellow, new Point(40, 60));
            absLayout.Children.Add(green, new Point(80, 180));

            Content = absLayout;
        }
		public RightPage ()
		{
			Title = "Right";

			tray = new Tray (TrayOrientation.Right, 0.5) {
				VerticalOptions = LayoutOptions.End,
			};

			tray.Content = new ContentView {
				HorizontalOptions = LayoutOptions.FillAndExpand,
				VerticalOptions = LayoutOptions.FillAndExpand,
				BackgroundColor = Color.Red
			};

			Button switchTray = new Button { 
				Text = "Open/Close Tray",
				WidthRequest = 0.5 * App.ScreenWidth
			};
			switchTray.Clicked += ToggleTray;

			AbsoluteLayout layout = new AbsoluteLayout () {
				HeightRequest = App.ScreenHeight,
				WidthRequest = App.ScreenWidth,
				BackgroundColor = Color.Yellow
			};

			layout.Children.Add (switchTray, new Rectangle (App.ScreenWidth * 0.25, 100, switchTray.WidthRequest, 50));
			layout.Children.Add (tray, new Rectangle (App.ScreenWidth, 0, tray.WidthRequest, App.ScreenHeight));

			Content = layout;
		}
        public OptionsContentCell()
        {
            var labelName = new Label
            {
                Text = "Texto principal",
                TextColor = Color.Black,
                FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                VerticalOptions = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.StartAndExpand,
                FontFamily = Device.OnPlatform("GillSans", "Quattrocento Sans", "Comic Sans MS")
            };
            labelName.SetBinding(Label.TextProperty, "Text");

            StackLayout stack = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                VerticalOptions = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Padding = new Thickness(5, 0, 0, 0),
                Children = { labelName }
            };

            var absoluteLayout = new AbsoluteLayout();
            var background = new Image
            {
                Style = Styles.CellBackground
            };

            absoluteLayout.Children.Add(background, new Rectangle(0, 0, 1, 1), AbsoluteLayoutFlags.All);
            absoluteLayout.Children.Add(stack, new Rectangle(0, 0, 1, 1), AbsoluteLayoutFlags.All);

            View = absoluteLayout;
        }
		protected override void InitializeCell ()
		{
			var width = CellWidth;
			var height = CellHeight;

			_titleLabel = new Label ();

			AbsoluteLayout simpleLayout = new AbsoluteLayout {
				VerticalOptions = LayoutOptions.FillAndExpand,
				WidthRequest = CellWidth,
				HeightRequest = CellHeight,
			};

			_image = new FastImage () {
				Aspect = Aspect.AspectFill,
				BackgroundColor = Color.Black,
			};

			_titleLabel = new Label {
				Text = "",
				TextColor = Color.White,
				FontSize = 14,
				XAlign = TextAlignment.Center,
				YAlign = TextAlignment.Center,
				LineBreakMode = LineBreakMode.TailTruncation,
				BackgroundColor = Color.FromHex ("#272727"),
			};

			simpleLayout.Children.Add (_image, new Rectangle (0, 0, width, height - 30));
			simpleLayout.Children.Add (_titleLabel, new Rectangle (0, height - 30, width, 30));
			View = simpleLayout;
		}
        public CircularTextPage()
        {
            // Create the AbsoluteLayout.
            absoluteLayout = new AbsoluteLayout();
            absoluteLayout.SizeChanged += (sender, args) =>
                {
                    LayOutLabels();
                };
            Content = absoluteLayout;

            // Create the Labels.
            string text = "Xamarin.Forms makes me want to code more with ";
            labels = new Label[text.Length];
            double fontSize = 1.5 * Device.GetNamedSize(NamedSize.Large, typeof(Label));
            int countSized = 0;

            for (int index = 0; index < text.Length; index++)
            {
                char ch = text[index];

                Label label = new Label
                {
                    Text = ch == ' ' ? "\u00A0" : ch.ToString(),
                    FontSize = fontSize,
                };
                label.SizeChanged += (sender, args) =>
                    {
                        if (++countSized >= labels.Length)
                            LayOutLabels();
                    };

                labels[index] = label;
                absoluteLayout.Children.Add(label);
            }
        }
Example #22
0
        public ClockPage()
        {
            AbsoluteLayout absoluteLayout = new AbsoluteLayout();

            for (int i = 0; i < tickMarks.Length; i++)
            {
                tickMarks[i] = new BoxView
                {
                    Color = Color.Accent
                };
                absoluteLayout.Children.Add(tickMarks[i]);
            }

            absoluteLayout.Children.Add(hourHand =
                new BoxView
                {
                    Color = Color.Accent
                });
            absoluteLayout.Children.Add(minuteHand =
                new BoxView
                {
                    Color = Color.Accent
                });
            absoluteLayout.Children.Add(secondHand =
                new BoxView
                {
                    Color = Color.Red
                });

            Content = absoluteLayout;

            Device.StartTimer(TimeSpan.FromMilliseconds(16), OnTimerTick);
            SizeChanged += OnPageSizeChanged;
        }
 private void InitializeComponent()
 {
     this.LoadFromXaml(typeof(MatrixControlPrototype));
     cnvTitle = this.FindByName<ContentView>("cnvTitle");
     lblTitle = this.FindByName<Label>("lblTitle");
     rootCanvas = this.FindByName<AbsoluteLayout>("rootCanvas");
 }
		public StackLayoutAbsolute ()
		{
			AbsoluteLayout absoluteLayout = new AbsoluteLayout 
			{
				VerticalOptions = LayoutOptions.FillAndExpand
			};

			Label firstlabel = new Label 
			{
				Text = "FirstLabel"
			};

			Label secondlabel = new Label 
			{
				Text = "SecondLabel"
			};


			absoluteLayout.Children.Add (secondlabel);
			AbsoluteLayout.SetLayoutFlags (secondlabel,
				AbsoluteLayoutFlags.PositionProportional);
			AbsoluteLayout.SetLayoutBounds (secondlabel,
				new Rectangle (0, 1, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));



			absoluteLayout.Children.Add (firstlabel);
			AbsoluteLayout.SetLayoutFlags (firstlabel,
				AbsoluteLayoutFlags.PositionProportional);
			AbsoluteLayout.SetLayoutBounds (firstlabel,
				new Rectangle (0,0, AbsoluteLayout.AutoSize,AbsoluteLayout.AutoSize));


			this.Content = absoluteLayout;
		}
Example #25
0
        public EditGateUser(GerenciarPortoesViewModel viewModel, GateDevices gateKey)
        {
            _viewModel = viewModel;
            Grid grid = new Grid();
            this.gateKey = gateKey;
            string name = gateKey.SKeyName;
            if (name.Length <= 4)
                name = gateKey.SkeyBleId;

            Title = "Editar " + name;

            removerUserGate.AnimateWithAction();
            removerUserGate.Clicked += removerUserGate_Clicked;


            grid.Children.AddVertical(listProfileDisponiveis);
            grid.Children.Add(removerUserGate);

            listProfileDisponiveis.ItemTapped += listProfileDisponiveis_ItemTapped;

            var absoluteLayout = new AbsoluteLayout();
            var background = new Image
            {
                Style = Styles.BackgroundImage
            };

            absoluteLayout.Children.Add(background, new Rectangle(0, 0, 1, 1), AbsoluteLayoutFlags.All);
            absoluteLayout.Children.Add(grid, new Rectangle(0, 0, 1, 1), AbsoluteLayoutFlags.All);

            Content = absoluteLayout;
        }
		public AbsoluteLayoutExplorationCode ()
		{
			Title = "Absolute Layout Exploration - C#";
			var layout = new AbsoluteLayout();

			var centerLabel = new Label {Text = "I'm centered on iPhone 4 but no other device.", LineBreakMode = LineBreakMode.WordWrap, FontSize = 20};

			AbsoluteLayout.SetLayoutBounds (centerLabel, new Rectangle (115, 159, 100, 100));
			// it is not necessary to set layout flags because absolute positioning is the default

			var bottomLabel = new Label { Text = "I'm bottom center on every device.", LineBreakMode = LineBreakMode.WordWrap };
			AbsoluteLayout.SetLayoutBounds (bottomLabel, new Rectangle (.5, 1, .5, .1));
			AbsoluteLayout.SetLayoutFlags (bottomLabel, AbsoluteLayoutFlags.All);

			var rightBox = new BoxView{ Color = Color.Olive };
			AbsoluteLayout.SetLayoutBounds (rightBox, new Rectangle (1, .5, 25, 100));
			AbsoluteLayout.SetLayoutFlags (rightBox, AbsoluteLayoutFlags.PositionProportional);

			var leftBox = new BoxView{ Color = Color.Red };
			AbsoluteLayout.SetLayoutBounds (leftBox, new Rectangle (0, .5, 25, 100));
			AbsoluteLayout.SetLayoutFlags (leftBox, AbsoluteLayoutFlags.PositionProportional);

			var topBox = new BoxView{ Color = Color.Blue };
			AbsoluteLayout.SetLayoutBounds (topBox, new Rectangle (.5, 0, 100, 25));
			AbsoluteLayout.SetLayoutFlags (topBox, AbsoluteLayoutFlags.PositionProportional);

			layout.Children.Add (bottomLabel);
			layout.Children.Add (centerLabel);
			layout.Children.Add (rightBox);
			layout.Children.Add (leftBox);
			layout.Children.Add (topBox);

			Content = layout;
		}
		public AbsoluteLayoutPageCode ()
		{
			Title = "AbsoluteLayout - C#";
			BackgroundImage = "deer.jpg";
			var outerLayout = new AbsoluteLayout ();
			var scroll = new ScrollView ();
			outerLayout.Children.Add (scroll, new Rectangle (0, 0, 1, 1), AbsoluteLayoutFlags.All);
			outerLayout.Children.Add (new Button {
				Text = "Previous",
				BackgroundColor = Color.White,
				TextColor = Color.Green,
				BorderRadius = 0
			}, new Rectangle (0, 1, .5, 60), AbsoluteLayoutFlags.PositionProportional | AbsoluteLayoutFlags.WidthProportional);
			outerLayout.Children.Add (new Button {
				Text = "Next",
				BackgroundColor = Color.White,
				TextColor = Color.Green,
				BorderRadius = 0
			}, new Rectangle (1, 1, .5, 60), AbsoluteLayoutFlags.PositionProportional | AbsoluteLayoutFlags.WidthProportional);
			var innerLayout = new AbsoluteLayout ();
			scroll.Content = innerLayout;
			innerLayout.Children.Add (new Image { Source = "deer.jpg" }, new Rectangle (.5, 0, 300, 300), AbsoluteLayoutFlags.PositionProportional);
			innerLayout.Children.Add (new BoxView { Color = Color.FromHex ("#CC1A7019") }, new Rectangle (.5, 300, .7, 50), AbsoluteLayoutFlags.XProportional | AbsoluteLayoutFlags.WidthProportional);
			innerLayout.Children.Add (new Label { Text = "deer.jpg", XAlign = TextAlignment.Center, TextColor = Color.White }, new Rectangle (.5, 310, 1, 50), AbsoluteLayoutFlags.XProportional | AbsoluteLayoutFlags.WidthProportional);
			Content = outerLayout;
		}
 private void InitializeComponent() {
     this.LoadFromXaml(typeof(StandingsView));
     NameGrid = this.FindByName<Grid>("NameGrid");
     MessagesLayoutFrame = this.FindByName<AbsoluteLayout>("MessagesLayoutFrame");
     MessagesLayoutFrameInner = this.FindByName<ContentView>("MessagesLayoutFrameInner");
     MessagesListView = this.FindByName<ListView>("MessagesListView");
 }
        // Argument is SharedLineMesh derivative in Forms3D
        public DisplayPage(Type figureType)
        {
            Title = figureType.Name;

            SharedLineMesh mesh = (SharedLineMesh)Activator.CreateInstance(figureType);
            SharedLine[] sharedLines = mesh.SharedLines.ToArray();
            LineView[] lineViews = new LineView[sharedLines.Length];

            // Set up page with LineView elements.
            AbsoluteLayout absoluteLayout = new AbsoluteLayout();

            for (int i = 0; i < lineViews.Length; i++)
            {
                lineViews[i] = new LineView
                {
                    Thickness = 3
                };
                absoluteLayout.Children.Add(lineViews[i]);
            }

            this.Content = absoluteLayout;

            // Run animation.
            stopwatch.Start();

            Device.StartTimer(TimeSpan.FromMilliseconds(16), () =>
            {
                double totalSeconds = stopwatch.Elapsed.TotalSeconds;

                Matrix4D matX = Matrix4D.RotationX(Math.PI * totalSeconds / 5);
                Matrix4D matY = Matrix4D.RotationY(Math.PI * totalSeconds / 3);
                Matrix4D matZ = Matrix4D.RotationZ(Math.PI * totalSeconds / 7);
                Matrix4D matView = Matrix4D.OrthographicView(new Point(this.Width / 2, this.Height / 2),
                                                             Math.Min(this.Width, this.Height) / 4);

                // Get composite 3D transform matrix.
                Matrix4D matrix = matX * matY * matZ * matView;

                // Loop through the shared lines that comprise the figure.
                for (int i = 0; i < sharedLines.Length; i++)
                {
                    // Transform the points and normals of those points.
                    Point3D point1 = sharedLines[i].Point1 * matrix;
                    Point3D point2 = sharedLines[i].Point2 * matrix;
                    Vector3D normal1 = (Point3D)((Point3D)(sharedLines[i].Normal1) * matrix);
                    Vector3D normal2 = (Point3D)((Point3D)(sharedLines[i].Normal2) * matrix);

                    // Set each LineView to its new position.
                    lineViews[i].Point1 = point1;
                    lineViews[i].Point2 = point2;

                    // Determine if the line is visible or hidden.
                    bool isFacing = normal1.Z > 0 || normal2.Z > 0;
                    lineViews[i].Color = isFacing ? Color.Accent : Color.FromRgba(0.75, 0.75, 0.75, 0.5);
                }

                return !stopAnimation;
            });
        }
Example #30
0
		protected override void OnCreate(Bundle bundle)
		{
			base.OnCreate(bundle);
			var mLayout = new AbsoluteLayout(this);
			var surface = UrhoSurface.CreateSurface<SamplyGame>(this);
			mLayout.AddView(surface);
			SetContentView(mLayout);
		}
Example #31
0
        public LoginPage()
        {
            try
            {
                AbsoluteLayout peakLayout = new AbsoluteLayout
                {
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    BackgroundColor   = Color.Transparent
                };

                imgBG = new Image()
                {
                    Source = Shared.Classes.Optimizer.Image.FromFile("coffee_mug.9"),
                    Aspect = Aspect.AspectFill,
                };

                imgLogo = new Image()
                {
                    Source        = Shared.Classes.Optimizer.Image.FromFile("ic_logo"),
                    Aspect        = Aspect.AspectFit,
                    HeightRequest = 120,
                    WidthRequest  = 170
                };

                pasarPicker = new cxPicker {
                    Title             = "Pilih Pasar",
                    FontFamily        = Shared.Settings.Styles.Fonts.BaseBoldSemi,
                    Alignment         = TextAlignment.Center,
                    FontSize          = Shared.Settings.Styles.Sizes.Font.DrawerTitle,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions   = LayoutOptions.StartAndExpand,
                    TextColor         = Color.White,
                    BackgroundColor   = Color.FromHex("7fffffff"),
                };

                #region Username
                var boxImgUsername = new AbsoluteLayout
                {
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                };

                var boxUsername = new BoxView()
                {
                    Color             = Color.FromHex("7fffffff"),
                    HeightRequest     = 60,
                    WidthRequest      = 60,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                };

                imgUsername = new Image()
                {
                    Source = Shared.Classes.Optimizer.Image.FromFile("username_icon"),
                    Aspect = Aspect.AspectFill
                };

                AbsoluteLayout.SetLayoutFlags(boxUsername, AbsoluteLayoutFlags.PositionProportional);
                AbsoluteLayout.SetLayoutBounds(boxUsername, new Rectangle(0, 0, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
                AbsoluteLayout.SetLayoutFlags(imgUsername, AbsoluteLayoutFlags.PositionProportional);
                AbsoluteLayout.SetLayoutBounds(imgUsername, new Rectangle(0.5, 0.5, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));

                boxImgUsername.Children.Add(boxUsername);
                boxImgUsername.Children.Add(imgUsername);

                var boxTxtUsername = new AbsoluteLayout
                {
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                };

                var BoxLabelUsername = new BoxView()
                {
                    Color             = Color.FromHex("7fffffff"),
                    HeightRequest     = 60,
                    WidthRequest      = 200,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                };

                txtUsername = new cxEntry()
                {
                    Placeholder          = "Username",
                    TextColor            = Color.Black,
                    WidthRequest         = Device.OnPlatform(175, 195, 0),
                    FontFamily           = Shared.Settings.Styles.Fonts.BaseLight,
                    PlaceholderTextColor = Color.Black,
                    FontSize             = 20,
                    MaxLength            = 30,
                };

                AbsoluteLayout.SetLayoutFlags(BoxLabelUsername, AbsoluteLayoutFlags.PositionProportional);
                AbsoluteLayout.SetLayoutBounds(BoxLabelUsername, new Rectangle(0, 0, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
                AbsoluteLayout.SetLayoutFlags(txtUsername, AbsoluteLayoutFlags.PositionProportional);
                AbsoluteLayout.SetLayoutBounds(txtUsername, new Rectangle(0.5, 0.5, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));

                boxTxtUsername.Children.Add(BoxLabelUsername);
                boxTxtUsername.Children.Add(txtUsername);

                var UsernameLayout = new StackLayout()
                {
                    Spacing           = 4,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    Orientation       = StackOrientation.Horizontal,
                    Children          =
                    {
                        boxImgUsername,
                        boxTxtUsername
                    }
                };
                #endregion

                #region Password
                var boxImgPassword = new AbsoluteLayout
                {
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                };

                var boxPassword = new BoxView()
                {
                    Color             = Color.FromHex("7fffffff"),
                    HeightRequest     = 60,
                    WidthRequest      = 60,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                };

                imgPassword = new Image()
                {
                    Source = Shared.Classes.Optimizer.Image.FromFile("password_icon"),
                    Aspect = Aspect.AspectFill
                };

                AbsoluteLayout.SetLayoutFlags(boxPassword, AbsoluteLayoutFlags.PositionProportional);
                AbsoluteLayout.SetLayoutBounds(boxPassword, new Rectangle(0, 0, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
                AbsoluteLayout.SetLayoutFlags(imgPassword, AbsoluteLayoutFlags.PositionProportional);
                AbsoluteLayout.SetLayoutBounds(imgPassword, new Rectangle(0.5, 0.5, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));

                boxImgPassword.Children.Add(boxPassword);
                boxImgPassword.Children.Add(imgPassword);

                var boxTxtPassword = new AbsoluteLayout
                {
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                };

                var BoxLabelPassword = new BoxView()
                {
                    Color             = Color.FromHex("7fffffff"),
                    HeightRequest     = 60,
                    WidthRequest      = 200,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                };

                txtPassword = new cxEntry()
                {
                    Placeholder          = "Password",
                    TextColor            = Color.Black,
                    WidthRequest         = Device.OnPlatform(175, 195, 0),
                    IsPassword           = true,
                    FontFamily           = Shared.Settings.Styles.Fonts.BaseLight,
                    PlaceholderTextColor = Color.Black,
                    FontSize             = 20,
                    MaxLength            = 30,
                };

                AbsoluteLayout.SetLayoutFlags(BoxLabelPassword, AbsoluteLayoutFlags.PositionProportional);
                AbsoluteLayout.SetLayoutBounds(BoxLabelPassword, new Rectangle(0, 0, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
                AbsoluteLayout.SetLayoutFlags(txtPassword, AbsoluteLayoutFlags.PositionProportional);
                AbsoluteLayout.SetLayoutBounds(txtPassword, new Rectangle(0.5, 0.5, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));

                boxTxtPassword.Children.Add(BoxLabelPassword);
                boxTxtPassword.Children.Add(txtPassword);

                var PasswordLayout = new StackLayout()
                {
                    Spacing           = 4,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    Orientation       = StackOrientation.Horizontal,
                    Children          =
                    {
                        boxImgPassword,
                        boxTxtPassword
                    }
                };
                #endregion

                #region button
                BtnLogin = new cxButton
                {
                    Text            = "LOGIN",
                    TextColor       = Color.White,
                    FontSize        = 20,
                    FontFamily      = Shared.Settings.Styles.Fonts.Base,
                    BackgroundColor = Shared.Settings.Styles.Colors.Background.LightBlue,
                    HeightRequest   = 50,
                    WidthRequest    = 265,
                };
                #endregion

                var fields = new StackLayout()
                {
                    Spacing           = 8,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    Children          =
                    {
                        pasarPicker,
                        UsernameLayout,
                        PasswordLayout
                    }
                };

                versionLabel = new cxLabel
                {
                    Text              = "",
                    FontSize          = Shared.Settings.Styles.Sizes.Font.Base,
                    TextColor         = Color.White,
                    FontFamily        = Shared.Settings.Styles.Fonts.BaseLight,
                    HorizontalOptions = LayoutOptions.Center,
                    VerticalOptions   = LayoutOptions.Center,
                };

                var buttons = new StackLayout()
                {
                    Spacing           = 8,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    Children          =
                    {
                        BtnLogin,
                        versionLabel
                    }
                };

                AbsoluteLayout.SetLayoutFlags(imgBG, AbsoluteLayoutFlags.All);
                AbsoluteLayout.SetLayoutBounds(imgBG, new Rectangle(0, 0, 1f, 1f));

                AbsoluteLayout.SetLayoutFlags(imgLogo, AbsoluteLayoutFlags.PositionProportional);
                AbsoluteLayout.SetLayoutBounds(imgLogo,
                                               new Rectangle(0.5, 0.15, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));

                AbsoluteLayout.SetLayoutFlags(fields, AbsoluteLayoutFlags.PositionProportional);
                AbsoluteLayout.SetLayoutBounds(fields,
                                               new Rectangle(0.5, 0.55, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));

                AbsoluteLayout.SetLayoutFlags(buttons, AbsoluteLayoutFlags.PositionProportional);
                AbsoluteLayout.SetLayoutBounds(buttons,
                                               new Rectangle(0.5, 0.9, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));

                peakLayout.Children.Add(imgBG);
                peakLayout.Children.Add(imgLogo);
                peakLayout.Children.Add(fields);
                peakLayout.Children.Add(buttons);

                var MainLayout = new StackLayout {
                    BackgroundColor   = Shared.Settings.Styles.Colors.Background.Accent,
                    Spacing           = 0,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    Children          =
                    {
                        peakLayout
                    }
                };

                Content = new StackLayout()
                {
                    BackgroundColor   = Shared.Settings.Styles.Colors.Background.LightBlue,
                    Spacing           = 0,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    Children          =
                    {
                        peakLayout
                    }
                };

                pasarPicker.SelectedIndexChanged += (sender, e) => {
                    if (pasarPicker.SelectedIndex != -1)
                    {
                        strKdPasar = contPasar[pasarPicker.SelectedIndex].kdpasar.ToString();
                    }
                };

                txtUsername.Completed += (sender, e) => {
                    txtPassword.Focus();
                };

                txtPassword.Completed += (sender, e) => {
                    if (pasarPicker.SelectedIndex != -1)
                    {
                        Login(txtUsername.Text.Trim(), txtPassword.Text.Trim());
                    }
                    else
                    {
                        Shared.Settings.Panels.Alert.Display("Mohon pilih pasar yang akan dituju", "Pasar Tidak Ditemukan", "OK");
                    }
                };

                BtnLogin.Clicked += (sender, e) =>
                {
                    if (pasarPicker.SelectedIndex != -1)
                    {
                        Login(txtUsername.Text.Trim(), txtPassword.Text.Trim());
                    }
                    else
                    {
                        Shared.Settings.Panels.Alert.Display("Mohon pilih pasar yang akan dituju", "Pasar Tidak Ditemukan", "OK");
                    }
                };
            }
            catch (Exception ex)
            {
                Shared.Services.Logs.Insights.Send("Layout", ex);
            }
        }
Example #32
0
        public CoreRootPage(Page rootPage, NavigationBehavior navigationBehavior = NavigationBehavior.PushAsync)
        {
            ValidateRegistrar();

            IStringProvider stringProvider = DependencyService.Get <IStringProvider>();

            Title = stringProvider.CoreGalleryTitle;

            var corePageView = new CorePageView(rootPage, navigationBehavior);

            var searchBar = new SearchBar()
            {
                AutomationId = "SearchBar"
            };

            var testCasesButton = new Button
            {
                Text         = "Go to Test Cases",
                AutomationId = "GoToTestButton",
                Command      = new Command(async() =>
                {
                    if (!string.IsNullOrEmpty(searchBar.Text))
                    {
                        await corePageView.PushPage(searchBar.Text);
                    }
                    else
                    {
                        await Navigation.PushModalAsync(TestCases.GetTestCases());
                    }
                })
            };

            var stackLayout = new StackLayout()
            {
                Children =
                {
                    testCasesButton,
                    searchBar,
                    new Button {
                        Text    = "Click to Force GC",
                        Command = new Command(() => {
                            GC.Collect();
                            GC.WaitForPendingFinalizers();
                            GC.Collect();
                        })
                    }
                }
            };

            this.SetAutomationPropertiesName("Gallery");
            this.SetAutomationPropertiesHelpText("Lists all gallery pages");

            Content = new AbsoluteLayout
            {
                Children =
                {
                    { new CoreRootView(), new Rectangle(0, 0.0,   1, 0.35), AbsoluteLayoutFlags.All },
                    { stackLayout,        new Rectangle(0, 0.5,   1, 0.30), AbsoluteLayoutFlags.All },
                    { corePageView,       new Rectangle(0, 1.0, 1.0, 0.35), AbsoluteLayoutFlags.All },
                }
            };
        }
Example #33
0
        public StartPage()
        {
            ToolbarItems.Add(new ToolbarItem
            {
                Text    = "検索",
                Icon    = "Search.png",
                Command = new Command(() => DisplayAlert("Search", "Search is tapped.", "OK")),
            });
            ToolbarItems.Add(new ToolbarItem
            {
                Text    = "設定",
                Icon    = "Setting.png",
                Command = new Command(() => DisplayAlert("Setting", "Setting is tapped.", "OK")),
            });

            AbsoluteLayout abs = new AbsoluteLayout {
            };

            ml = new StackLayout
            {
                BackgroundColor = Color.White,
                Padding         = 15,
                Children        =
                {
                    new Label  {
                        XAlign    = TextAlignment.Center,
                        Text      = "Welcome to Xamarin Forms!",
                        TextColor = Color.Black,
                    },
                    new Button {
                        Text            = "Show QuickStart",
                        TextColor       = Color.Black,
                        BackgroundColor = Color.FromHex("CCC"),
                        BorderColor     = Color.Gray,
                        BorderRadius    = 5,
                        BorderWidth     = 1,
                        Command         = new Command(() => {
                            qslVisible = true;
                            Application.Current.Properties["qsl"] = qslVisible;
                            DisplayAlert("Show QuickStart", "Show QuickStart when you re-launch this app.", "OK");
                        }),
                    },
                },
            };

            bl = new ContentView
            {
                BackgroundColor = Color.Black,
                Opacity         = 0.65d,
            };

            qsl = new ContentView
            {
                Content = new StackLayout
                {
                    Padding         = new Thickness(10, 0, 10, 10),
                    VerticalOptions = LayoutOptions.FillAndExpand,
                    Children        =
                    {
                        new Image  {
                            Source            = "QuickStart.png",
                            WidthRequest      = 250,
                            HorizontalOptions = LayoutOptions.End,
                        },
                        new Image  {
                            Source       = "QuickStartSwipe.png",
                            WidthRequest = 340,
                        },
                        new Button {
                            Text            = "閉じる",
                            TextColor       = Color.White,
                            BackgroundColor = Color.FromHex("49d849"),
                            BorderRadius    = 5,
                            VerticalOptions = LayoutOptions.EndAndExpand,
                            Command         = new Command(() => {
                                qsl.IsVisible = false;
                                bl.IsVisible  = false;
                                qslVisible    = false;
                                Application.Current.Properties["qsl"] = qslVisible;
                            }),
                        },
                    },
                },
            };


            abs.Children.Add(ml);
            if (Application.Current.Properties.ContainsKey("qsl"))
            {
                var bqsl = (bool)Application.Current.Properties["qsl"];
                if (bqsl)
                {
                    abs.Children.Add(bl);
                    if (Device.OS == TargetPlatform.WinPhone)
                    {
                    }
                    else
                    {
                        abs.Children.Add(qsl);
                    }
                }
            }
            else
            {
                abs.Children.Add(bl);
                if (Device.OS == TargetPlatform.WinPhone)
                {
                }
                else
                {
                    abs.Children.Add(qsl);
                }
            }


            Title   = "QuickStartLayer";
            Content = abs;

            SizeChanged += OnPageSizeChanged;
        }
Example #34
0
        async private void animationLoop()
        {
            while (true)
            {
                AbsoluteLayout.SetLayoutBounds(boxView, new Rectangle((layoutSize - boxSize) / 2, 0, boxSize, boxSize));

                boxView.AnchorX = layoutSize / 2 / boxSize;
                boxView.AnchorY = 0.5;
                await boxView.RotateTo(-90, arcDuration);

                Rectangle rectNormal = new Rectangle(layoutSize - boxSize,
                                                     (layoutSize - boxSize) / 2, boxSize, boxSize);

                Rectangle rectSquashed = new Rectangle(rectNormal.X + boxSize / 2,
                                                       rectNormal.Y - boxSize / 2, boxSize / 2, 2 * boxSize);

                boxView.BatchBegin();
                boxView.Rotation = 0;
                boxView.AnchorX  = 0.5;
                boxView.AnchorY  = 0.5;
                AbsoluteLayout.SetLayoutBounds(boxView, rectNormal);
                boxView.BatchCommit();

                await boxView.LayoutTo(rectSquashed, bounceDuration, Easing.SinOut);

                await boxView.LayoutTo(rectNormal, bounceDuration, Easing.SinIn);

                boxView.AnchorX = 0.5;
                boxView.AnchorY = layoutSize / 2 / boxSize;
                await boxView.RotateTo(-90, arcDuration);

                rectNormal = new Rectangle((layoutSize - boxSize) / 2,
                                           layoutSize - boxSize, boxSize, boxSize);

                rectSquashed = new Rectangle(rectNormal.X - boxSize / 2, rectNormal.Y + boxSize / 2, 2 * boxSize, boxSize / 2);

                boxView.BatchBegin();
                boxView.Rotation = 0;
                boxView.AnchorX  = 0.5;
                boxView.AnchorY  = 0.5;
                AbsoluteLayout.SetLayoutBounds(boxView, rectNormal);
                boxView.BatchCommit();

                await boxView.LayoutTo(rectSquashed, bounceDuration, Easing.SinOut);

                await boxView.LayoutTo(rectNormal, bounceDuration, Easing.SinIn);

                boxView.AnchorX = 1 - layoutSize / 2 / boxSize;
                boxView.AnchorY = 0.5;
                await boxView.RotateTo(-90, arcDuration);

                rectNormal   = new Rectangle(0, (layoutSize - boxSize) / 2, boxSize, boxSize);
                rectSquashed = new Rectangle(rectNormal.X, rectNormal.Y - boxSize / 2, boxSize / 2, 2 * boxSize);

                boxView.BatchBegin();
                boxView.Rotation = 0;
                boxView.AnchorX  = 0.5;
                boxView.AnchorY  = 0.5;
                AbsoluteLayout.SetLayoutBounds(boxView, rectNormal);
                boxView.BatchCommit();

                await boxView.LayoutTo(rectSquashed, bounceDuration, Easing.SinOut);

                await boxView.LayoutTo(rectNormal, bounceDuration, Easing.SinIn);

                boxView.AnchorX = 0.5;
                boxView.AnchorY = 1 - layoutSize / 2 / boxSize;
                await boxView.RotateTo(-90, arcDuration);

                rectNormal   = new Rectangle((layoutSize - boxSize) / 2, 0, boxSize, boxSize);
                rectSquashed = new Rectangle(rectNormal.X - boxSize / 2, 0, 2 * boxSize, boxSize / 2);

                boxView.BatchBegin();
                boxView.Rotation = 0;
                boxView.AnchorX  = 0.5;
                boxView.AnchorY  = 0.5;
                AbsoluteLayout.SetLayoutBounds(boxView, rectNormal);
                boxView.BatchCommit();

                await boxView.LayoutTo(rectSquashed, bounceDuration, Easing.SinOut);

                await boxView.LayoutTo(rectNormal, bounceDuration, Easing.SinIn);
            }
        }
Example #35
0
        public AfterCalcPage(PaiDataClass.TensuReturnedData tensuReturnedData, PaiDataClass.BCPagePaiData bCPagePaiData, PaiDataClass.PaiImage paiImage, int label_padding)
        {
            NavigationPage.SetHasNavigationBar(this, false);

            PaiDataClass.YakuData yakuData = new PaiDataClass.YakuData();

            #region 箱の挙動

            //上
            outestAl.Children.Add(topAl);
            AbsoluteLayout.SetLayoutFlags(topAl, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(topAl, new Rectangle(0, 0, 1, 0.14));

            //下
            outestAl.Children.Add(bottomAl);
            AbsoluteLayout.SetLayoutFlags(bottomAl, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(bottomAl, new Rectangle(0, 1, 1, 0.86));

            //下の上
            bottomAl.Children.Add(bottomTopAl);
            AbsoluteLayout.SetLayoutFlags(bottomTopAl, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(bottomTopAl, new Rectangle(0.5, 0, 1, (21.0 / 86.0)));

            //下の下
            bottomAl.Children.Add(bottomBottomAl);
            AbsoluteLayout.SetLayoutFlags(bottomBottomAl, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(bottomBottomAl, new Rectangle(0, 1, 1, (65.0 / 86.0)));

            //下の下の左
            bottomBottomAl.Children.Add(bottomBottomLeftAl);
            AbsoluteLayout.SetLayoutFlags(bottomBottomLeftAl, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(bottomBottomLeftAl, new Rectangle(0, 0, 0.64, 1));

            //下の下の左の上
            bottomBottomLeftAl.Children.Add(bottomBottomLeftTopAl);
            AbsoluteLayout.SetLayoutFlags(bottomBottomLeftTopAl, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(bottomBottomLeftTopAl, new Rectangle(0, 0, 1, (51.0 / 65.0)));

            //下の下の左の上の左
            bottomBottomLeftTopAl.Children.Add(bottomBottomLeftTopLeftAl);
            AbsoluteLayout.SetLayoutFlags(bottomBottomLeftTopLeftAl, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(bottomBottomLeftTopLeftAl, new Rectangle(0, 0, 0.5, 1));

            //下の下の左の上の左の上
            bottomBottomLeftTopLeftAl.Children.Add(bottomBottomLeftTopLeftTopAl);
            AbsoluteLayout.SetLayoutFlags(bottomBottomLeftTopLeftTopAl, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(bottomBottomLeftTopLeftTopAl, new Rectangle(0, 0, 1, (34.0 / 51.0)));

            //下の下の左の上の左の上の上
            bottomBottomLeftTopLeftTopAl.Children.Add(bottomBottomLeftTopLeftTopTopAl);
            AbsoluteLayout.SetLayoutFlags(bottomBottomLeftTopLeftTopTopAl, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(bottomBottomLeftTopLeftTopTopAl, new Rectangle(0, 0, 1, (9.0 / 34.0)));


            //下の下の左の上の左の上の下
            bottomBottomLeftTopLeftTopAl.Children.Add(bottomBottomLeftTopLeftTopBottomAl);
            AbsoluteLayout.SetLayoutFlags(bottomBottomLeftTopLeftTopBottomAl, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(bottomBottomLeftTopLeftTopBottomAl, new Rectangle(0, 1, 1, (25.0 / 34.0)));


            //下の下の左の上の左の下
            bottomBottomLeftTopLeftAl.Children.Add(bottomBottomLeftTopLeftBottomAl);
            AbsoluteLayout.SetLayoutFlags(bottomBottomLeftTopLeftBottomAl, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(bottomBottomLeftTopLeftBottomAl, new Rectangle(0, 1, 1, (17.0 / 51.0)));

            //下の下の左の上の右
            bottomBottomLeftTopAl.Children.Add(bottomBottomLeftTopRightAl);
            AbsoluteLayout.SetLayoutFlags(bottomBottomLeftTopRightAl, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(bottomBottomLeftTopRightAl, new Rectangle(1, 0, 0.5, 1));

            //下の下の左の下
            bottomBottomLeftAl.Children.Add(bottomBottomLeftBottomAl);
            AbsoluteLayout.SetLayoutFlags(bottomBottomLeftBottomAl, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(bottomBottomLeftBottomAl, new Rectangle(0, 1, 1, (14.0 / 65.0)));

            //下の下の右
            bottomBottomAl.Children.Add(bottomBottomRightAl);
            AbsoluteLayout.SetLayoutFlags(bottomBottomRightAl, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(bottomBottomRightAl, new Rectangle(1, 0, 0.36, 1));

            //下の下の右の上
            bottomBottomRightAl.Children.Add(bottomBottomRightTopAl);
            AbsoluteLayout.SetLayoutFlags(bottomBottomRightTopAl, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(bottomBottomRightTopAl, new Rectangle(0, 0, 1, (14.0 / 65.0)));

            //下の下の右の下
            bottomBottomRightAl.Children.Add(bottomBottomRightBottomAl);
            AbsoluteLayout.SetLayoutFlags(bottomBottomRightBottomAl, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(bottomBottomRightBottomAl, new Rectangle(0, 1, 1, (51.0 / 65.0)));

            #endregion

            #region ボタン・ラベル追加

            #region 一番上の部分

            topAl.Children.Add(topSl);
            AbsoluteLayout.SetLayoutFlags(topSl, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(topSl, new Rectangle(0.5, 0.5, 1, 1));

            label_agari_pai.Margin = new Thickness(0, 0, label_padding, 0);
            topSl.Children.Add(label_agari_pai);

            topAl.Children.Add(label_agariKatachi);
            AbsoluteLayout.SetLayoutFlags(label_agariKatachi, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds(label_agariKatachi, new Rectangle(0.5, 0.5, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));

            #endregion

            #region アガリ牌の部分

            bottomTopAl.Children.Add(agariPaiSl);
            AbsoluteLayout.SetLayoutFlags(agariPaiSl, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(agariPaiSl, new Rectangle(0.5, 0.5, 1, 1));

            agariPaiSl.Spacing           = 0;
            agariPaiSl.HorizontalOptions = LayoutOptions.FillAndExpand;

            #region メンゼン牌・鳴き牌・アガリ牌を生成

            //メンゼン牌1個目
            agariPaiSl.Children.Add(new Image
            {
                Aspect               = Aspect.AspectFill,
                Source               = ImageSource.FromResource(paiImage.PaiImage0dLoc[bCPagePaiData.menzenPai[0]]),
                VerticalOptions      = LayoutOptions.CenterAndExpand,
                HorizontalOptions    = LayoutOptions.EndAndExpand,
                MinimumWidthRequest  = 5,
                MinimumHeightRequest = 7,
                Margin               = new Thickness(5, 0, 0, 0),
            });

            //メンゼン牌2個目以降
            for (int i = 1; i < bCPagePaiData.menzenPai.Count; i++)
            {
                agariPaiSl.Children.Add(new Image
                {
                    Aspect               = Aspect.AspectFill,
                    Source               = ImageSource.FromResource(paiImage.PaiImage0dLoc[bCPagePaiData.menzenPai[i]]),
                    VerticalOptions      = LayoutOptions.CenterAndExpand,
                    HorizontalOptions    = LayoutOptions.Center,
                    MinimumWidthRequest  = 5,
                    MinimumHeightRequest = 7,
                });
            }

            //鳴き牌
            for (int i = 0; i < bCPagePaiData.nakiSet.Count; i++)
            {
                for (int j = 0; j < bCPagePaiData.nakiSet[i].pai.Count; j++)
                {
                    if (j == 0 && bCPagePaiData.nakiSet[i].nakiType == "chi")
                    {
                        agariPaiSl.Children.Add(new Image
                        {
                            Aspect               = Aspect.AspectFill,
                            Source               = ImageSource.FromResource(paiImage.PaiImage90dLoc[bCPagePaiData.nakiSet[i].pai[j]]),
                            VerticalOptions      = LayoutOptions.CenterAndExpand,
                            HorizontalOptions    = LayoutOptions.Center,
                            MinimumWidthRequest  = 7,
                            MinimumHeightRequest = 7,
                            Margin               = new Thickness(10, 0, 0, 0)
                        });
                    }
                    else if (j == 0)
                    {
                        agariPaiSl.Children.Add(new Image
                        {
                            Aspect               = Aspect.AspectFill,
                            Source               = ImageSource.FromResource(paiImage.PaiImage0dLoc[bCPagePaiData.nakiSet[i].pai[j]]),
                            VerticalOptions      = LayoutOptions.CenterAndExpand,
                            HorizontalOptions    = LayoutOptions.Center,
                            MinimumWidthRequest  = 5,
                            MinimumHeightRequest = 7,
                            Margin               = new Thickness(10, 0, 0, 0)
                        });
                    }
                    else if (j == 1 && bCPagePaiData.nakiSet[i].nakiType == "pon")
                    {
                        agariPaiSl.Children.Add(new Image
                        {
                            Aspect               = Aspect.AspectFill,
                            Source               = ImageSource.FromResource(paiImage.PaiImage90dLoc[bCPagePaiData.nakiSet[i].pai[j]]),
                            VerticalOptions      = LayoutOptions.CenterAndExpand,
                            HorizontalOptions    = LayoutOptions.Center,
                            MinimumWidthRequest  = 7,
                            MinimumHeightRequest = 7,
                        });
                    }
                    else if (j == 2 && bCPagePaiData.nakiSet[i].nakiType == "min_kan")
                    {
                        agariPaiSl.Children.Add(new Image
                        {
                            Aspect               = Aspect.AspectFill,
                            Source               = ImageSource.FromResource(paiImage.PaiImage90dLoc[bCPagePaiData.nakiSet[i].pai[j]]),
                            VerticalOptions      = LayoutOptions.CenterAndExpand,
                            HorizontalOptions    = LayoutOptions.Center,
                            MinimumWidthRequest  = 7,
                            MinimumHeightRequest = 7,
                        });
                    }
                    else
                    {
                        agariPaiSl.Children.Add(new Image
                        {
                            Aspect               = Aspect.AspectFill,
                            Source               = ImageSource.FromResource(paiImage.PaiImage0dLoc[bCPagePaiData.nakiSet[i].pai[j]]),
                            VerticalOptions      = LayoutOptions.CenterAndExpand,
                            HorizontalOptions    = LayoutOptions.Center,
                            MinimumWidthRequest  = 5,
                            MinimumHeightRequest = 7,
                        });
                    }
                }
            }

            //アガリ牌
            agariPaiSl.Children.Add(new Image
            {
                Aspect               = Aspect.AspectFill,
                Source               = ImageSource.FromResource(paiImage.PaiImage0dLoc[bCPagePaiData.agariPai]),
                VerticalOptions      = LayoutOptions.CenterAndExpand,
                HorizontalOptions    = LayoutOptions.StartAndExpand,
                MinimumWidthRequest  = 5,
                MinimumHeightRequest = 7,
                Margin               = new Thickness(20, 0, 5, 0)
            });

            #endregion

            #endregion

            #region ドラ表示牌・ラベル(新レイアウトのみ)

            Border.SetOn(bottomBottomLeftTopLeftAl, true);
            Border.SetColor(bottomBottomLeftTopLeftAl, Color.DarkOliveGreen);
            Border.SetRadius(bottomBottomLeftTopLeftAl, 3);
            Border.SetWidth(bottomBottomLeftTopLeftAl, 3);

            #region ドラの画像の設定

            //ドラ表示牌Image配列格納
            Image[] image_dora =
            {
                image_dora01,
                image_dora02,
                image_dora03,
                image_dora04,
                image_dora05,
                image_dora06,
                image_dora07,
                image_dora08,
                image_dora09,
                image_dora10,
            };

            //ドラ表示牌の画像設定
            for (int i = 0; i < image_dora.Length; i++)
            {
                image_dora[i].Source = ImageSource.FromResource(paiImage.PaiImage0dLoc[bCPagePaiData.doraPai[i]]);

                if (i < bCPagePaiData.doraPai.Count)
                {
                    image_dora[i].Source = ImageSource.FromResource(paiImage.PaiImage0dLoc[bCPagePaiData.doraPai[i]]);
                }
                else
                {
                    image_dora[i].Source = ImageSource.FromResource(paiImage.PaiImage0dLoc["bs"]);
                }
            }

            #endregion

            bottomBottomLeftTopLeftTopTopAl.Children.Add(label_dora_hyoujiPai);
            AbsoluteLayout.SetLayoutFlags(label_dora_hyoujiPai, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds(label_dora_hyoujiPai, new Rectangle(0.5, 0.5, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));


            bottomBottomLeftTopLeftTopBottomAl.Children.Add(doraHyojiSl01);
            AbsoluteLayout.SetLayoutFlags(doraHyojiSl01, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(doraHyojiSl01, new Rectangle(0.5, 0, 1, 0.5));

            bottomBottomLeftTopLeftTopBottomAl.Children.Add(doraHyojiSl02);
            AbsoluteLayout.SetLayoutFlags(doraHyojiSl02, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(doraHyojiSl02, new Rectangle(0.5, 1, 1, 0.5));

            doraHyojiSl01.Spacing = 0;
            doraHyojiSl02.Spacing = 0;

            for (int i = 0; i < image_dora.Length; i++)
            {
                if (i % 2 == 0)
                {
                    doraHyojiSl01.Children.Add(image_dora[i]);
                    image_dora[i].VerticalOptions = LayoutOptions.EndAndExpand;
                }
                else
                {
                    doraHyojiSl02.Children.Add(image_dora[i]);
                    image_dora[i].VerticalOptions = LayoutOptions.StartAndExpand;
                }

                if (i < 2)
                {
                    image_dora[i].HorizontalOptions = LayoutOptions.EndAndExpand;
                }
                else if (i > 7)
                {
                    image_dora[i].HorizontalOptions = LayoutOptions.StartAndExpand;
                }
                else
                {
                    image_dora[i].HorizontalOptions = LayoutOptions.Center;
                }

                image_dora[i].MinimumWidthRequest  = 5;
                image_dora[i].MinimumHeightRequest = 7;
            }

            #endregion

            #region 場風・自風の牌・ラベル

            image_bakaze.Source = ImageSource.FromResource(paiImage.PaiImage0dLoc[bCPagePaiData.bakazePai]);
            image_jikaze.Source = ImageSource.FromResource(paiImage.PaiImage0dLoc[bCPagePaiData.jikazePai]);

            StackLayout slBakazeJikaze = new StackLayout
            {
                Orientation = StackOrientation.Horizontal,
                //BackgroundColor = Color.DarkGray,
                Spacing = 0,
            };

            bottomBottomLeftTopLeftBottomAl.Children.Add(slBakazeJikaze);
            AbsoluteLayout.SetLayoutFlags(slBakazeJikaze, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(slBakazeJikaze, new Rectangle(0.5, 0.5, 1, 1));

            slBakazeJikaze.Children.Add(image_bakaze);
            image_bakaze.HorizontalOptions = LayoutOptions.EndAndExpand;
            image_bakaze.VerticalOptions   = LayoutOptions.Center;

            slBakazeJikaze.Children.Add(label_bakaze);
            label_bakaze.HorizontalOptions = LayoutOptions.StartAndExpand;
            label_bakaze.VerticalOptions   = LayoutOptions.Center;

            slBakazeJikaze.Children.Add(image_jikaze);
            image_jikaze.HorizontalOptions = LayoutOptions.EndAndExpand;
            image_jikaze.VerticalOptions   = LayoutOptions.Center;

            slBakazeJikaze.Children.Add(label_jikaze);
            label_jikaze.HorizontalOptions = LayoutOptions.StartAndExpand;
            label_jikaze.VerticalOptions   = LayoutOptions.Center;

            #endregion

            #region 左下のボタン2つ

            bottomBottomLeftBottomAl.Children.Add(button_returnToTake);
            AbsoluteLayout.SetLayoutFlags(button_returnToTake, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(button_returnToTake, new Rectangle(0.1, 0.5, 0.4, 0.9));
            button_returnToTake.Clicked += ButtonReturnToCameraTap;

            bottomBottomLeftBottomAl.Children.Add(button_maegamaen);
            AbsoluteLayout.SetLayoutFlags(button_maegamaen, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(button_maegamaen, new Rectangle(0.9, 0.5, 0.4, 0.9));
            button_maegamaen.Clicked += ButtonReturnToBeforeCalcTap;

            #endregion

            #region 役の部分

            Border.SetOn(bottomBottomLeftTopRightAl, true);
            Border.SetColor(bottomBottomLeftTopRightAl, Color.DarkOliveGreen);
            Border.SetRadius(bottomBottomLeftTopRightAl, 3);
            Border.SetWidth(bottomBottomLeftTopRightAl, 3);

            bottomBottomLeftTopRightAl.Children.Add(yakuAlSl);
            AbsoluteLayout.SetLayoutFlags(yakuAlSl, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(yakuAlSl, new Rectangle(0.5, 0.5, 1, 1));

            yakuAlSl.Children.Add(label_yaku);
            label_yaku.VerticalOptions   = LayoutOptions.Start;
            label_yaku.HorizontalOptions = LayoutOptions.Center;

            yakuAlSl.Children.Add(scrollView_yaku);
            scrollView_yaku.VerticalOptions = LayoutOptions.StartAndExpand;

            yakuSl.Padding          = new Thickness(0, 0, 0, 0);
            scrollView_yaku.Content = yakuSl;
            for (int i = 0; i < tensuReturnedData.yaku.Count; i++)
            {
                Debug.WriteLine("役を変数に入れる前");
                string yaku  = tensuReturnedData.yaku[i].name;
                int    hansu = tensuReturnedData.yaku[i].han;

                Debug.WriteLine(yaku + " " + hansu.ToString() + "翻 " + "役を変数に入れた後");

                #region いらない子

                /*
                 * int hansukari;
                 *
                 * if (yaku.Contains("Dora"))
                 * {
                 *  if (yaku.Contains("Aka"))
                 *  {
                 *      hansu = int.Parse(yaku.Substring(9, yaku.Length - 9));
                 *      yaku = yaku.Substring(0, 8);
                 *
                 *  }
                 *  else
                 *  {
                 *      hansu = int.Parse(yaku.Substring(5, yaku.Length - 5));
                 *      yaku = yaku.Substring(0, 4);
                 *
                 *  }
                 * }
                 * else
                 * {
                 *  hansukari = yakuData.YakuHan[yaku];
                 *  hansu = hansukari % 100;
                 *  if (bCPagePaiData.nakiSet.Count > 0)
                 *  {
                 *      for (int j = 0; j < bCPagePaiData.nakiSet.Count; j++)
                 *      {
                 *          if (bCPagePaiData.nakiSet[j].nakiType != "an_kan")
                 *          {
                 *              hansu = (hansukari % 100) - (hansukari / 100);
                 *              break;
                 *          }
                 *      }
                 *  }
                 * }
                 */
                #endregion

                yakuSl.Children.Add
                (
                    new StackLayout
                {
                    Orientation       = StackOrientation.Horizontal,
                    Padding           = new Thickness(0),
                    Margin            = new Thickness(0, 0, 0, 3),
                    HorizontalOptions = LayoutOptions.Fill,
                    BackgroundColor   = Color.White,
                    Children          =
                    {
                        new Label
                        {
                            Text = yakuData.YakuName[yaku],
                            HorizontalOptions = LayoutOptions.StartAndExpand,
                            FontSize          = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                            Margin            = new Thickness(10, 5, 0, 5),
                            TextColor         = Color.Black
                        },
                        new Label
                        {
                            Text = hansu.ToString() + "翻",
                            HorizontalOptions = LayoutOptions.EndAndExpand,
                            VerticalOptions   = LayoutOptions.Center,
                            FontSize          = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                            Margin            = new Thickness(0, 5, 10, 5),
                            TextColor         = Color.Black
                        }
                    }
                }
                );
            }

            foreach (StackLayout item in yakuSl.Children.OfType <StackLayout>())
            {
                Border.SetOn(item, true);
                Border.SetWidth(item, 1);
                Border.SetColor(item, Color.Black);
                Border.SetRadius(item, 3);
            }

            #endregion

            #region 点数の部分

            Border.SetOn(bottomBottomRightAl, true);
            Border.SetColor(bottomBottomRightAl, Color.DarkOliveGreen);
            Border.SetRadius(bottomBottomRightAl, 3);
            Border.SetWidth(bottomBottomRightAl, 3);

            bottomBottomRightTopAl.Children.Add(label_tensu);
            AbsoluteLayout.SetLayoutFlags(label_tensu, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds(label_tensu, new Rectangle(0.5, 0, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));

            int    ten = 0;
            int    oya = 0;
            int    ko  = 0;
            string oyakoTen;

            if (tensuReturnedData.cost.additional == 0)
            {
                oyakoTen = "";
                ten      = tensuReturnedData.cost.main;
            }
            else if (tensuReturnedData.cost.main == tensuReturnedData.cost.additional)
            {
                ko       = tensuReturnedData.cost.additional;
                ten      = ko * 3;
                oyakoTen = Environment.NewLine + ko.ToString() + "オール";
            }
            else
            {
                ko       = tensuReturnedData.cost.additional;
                oya      = tensuReturnedData.cost.main;
                ten      = oya + (ko * 2);
                oyakoTen = Environment.NewLine + ko.ToString() + "・" + oya.ToString();
            }

            string hu = "";

            if (tensuReturnedData.han < 5)
            {
                hu = tensuReturnedData.fu.ToString() + "符";
            }

            label_tensu_meisai.Text = tensuReturnedData.han.ToString() + "翻 " + hu + Environment.NewLine
                                      + ten.ToString() + "点" + oyakoTen;


            bottomBottomRightBottomAl.Children.Add(tensuSl);
            AbsoluteLayout.SetLayoutFlags(tensuSl, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(tensuSl, new Rectangle(0.5, 0.5, 1, 1));

            tensuSl.Children.Add(label_tensu_meisai);
            label_tensu_meisai.VerticalOptions   = LayoutOptions.Start;
            label_tensu_meisai.HorizontalOptions = LayoutOptions.Center;

            //満貫以上のロゴ
            if ((ten >= 12000 && bCPagePaiData.jikazePai == "h1") || (ten >= 8000 && bCPagePaiData.jikazePai != "h1"))
            {
                if (tensuReturnedData.yaku_is_yakuman == "役満")
                {
                    if (tensuReturnedData.han == (13 * 6))
                    {
                        label_mangan.Text = "6倍役満";
                    }
                    else if (tensuReturnedData.han == (13 * 5))
                    {
                        label_mangan.Text = "5倍役満";
                    }
                    else if (tensuReturnedData.han == (13 * 4))
                    {
                        label_mangan.Text = "4倍役満";
                    }
                    else if (tensuReturnedData.han == (13 * 3))
                    {
                        label_mangan.Text = "3倍役満";
                    }
                    else if (tensuReturnedData.han == (13 * 2))
                    {
                        label_mangan.Text = "2倍役満";
                    }
                    else if (tensuReturnedData.han == (13 * 1))
                    {
                        label_mangan.Text = "役満";
                    }
                }
                else if (tensuReturnedData.han > 12)
                {
                    label_mangan.Text = "数え役満";
                }
                else if (tensuReturnedData.han == 12 || tensuReturnedData.han == 11)
                {
                    label_mangan.Text = "3倍満";
                }
                else if (tensuReturnedData.han == 10 || tensuReturnedData.han == 9 || tensuReturnedData.han == 8)
                {
                    label_mangan.Text = "倍満";
                }
                else if (tensuReturnedData.han == 7 || tensuReturnedData.han == 6)
                {
                    label_mangan.Text = "跳満";
                }
                else
                {
                    label_mangan.Text = "満貫";
                }
            }

            tensuSl.Children.Add(label_mangan);
            label_tensu_meisai.VerticalOptions   = LayoutOptions.Start;
            label_tensu_meisai.HorizontalOptions = LayoutOptions.Center;

            #endregion

            #endregion

            Content = outestAl;
        }
Example #36
0
        public EmbeddingControls()
        {
            var iconTapCommand = new AsyncValueCommand(async() =>
            {
                if (BindingContext is not MediaPlayer player)
                {
                    throw new InvalidOperationException($"{nameof(BindingContext)} must be {nameof(MediaPlayer)}");
                }

                if (player.State == PlaybackState.Playing)
                {
                    player.Pause();
                }
                else
                {
                    await player.Start();
                }
            });

            PlayIcon = new Grid
            {
                Children =
                {
                    new ShapesPath
                    {
                        Scale             = 0.7,
                        Data              = (ShapesPathGeometry) new Forms.Shapes.PathGeometryConverter().ConvertFromInvariantString("M93.5 52.4019C95.5 53.5566 95.5 56.4434 93.5 57.5981L5 108.694C3 109.848 0.499996 108.405 0.499996 106.096V3.9045C0.499996 1.5951 3 0.151723 5 1.30642L93.5 52.4019Z"),
                        Fill              = Brush.White,
                        Opacity           = 0.4,
                        Aspect            = Stretch.Uniform,
                        HorizontalOptions = LayoutOptions.Center
                    }
                }
            };

            PlayIcon.GestureRecognizers.Add(new TapGestureRecognizer()
            {
                Command = iconTapCommand
            });
            AbsoluteLayout.SetLayoutFlags(PlayIcon, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(PlayIcon, new Rectangle(0.5, 0.5, 0.25, 0.25));

            PauseIcon = new Grid
            {
                HorizontalOptions = LayoutOptions.Center,
                Children          =
                {
                    new ShapesPath
                    {
                        Scale             = 0.7,
                        Data              = (ShapesPathGeometry) new Forms.Shapes.PathGeometryConverter().ConvertFromInvariantString("M1 1H36V131H1V1Z"),
                        Fill              = Brush.White,
                        Opacity           = 0.4,
                        Aspect            = Stretch.Uniform,
                        HorizontalOptions = LayoutOptions.Start
                    },
                    new ShapesPath
                    {
                        Scale             = 0.7,
                        Data              = (ShapesPathGeometry) new Forms.Shapes.PathGeometryConverter().ConvertFromInvariantString("M71 1H106V131H71V1Z"),
                        Fill              = Brush.White,
                        Opacity           = 0.4,
                        Aspect            = Stretch.Uniform,
                        HorizontalOptions = LayoutOptions.Start
                    }
                }
            };

            PauseIcon.GestureRecognizers.Add(new TapGestureRecognizer()
            {
                Command = iconTapCommand
            });
            AbsoluteLayout.SetLayoutFlags(PauseIcon, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(PauseIcon, new Rectangle(0.5, 0.5, 0.25, 0.25));

            var bufferingLabel = new XLabel
            {
                FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label), false),
                HorizontalTextAlignment = XTextAlignment.Center,
                TextColor = Color.FromHex("#eeeeeeee")
            };

            bufferingLabel.SetBinding(XLabel.TextProperty, new Binding
            {
                Path         = "BufferingProgress",
                StringFormat = "{0:0%}"
            });
            bufferingLabel.SetBinding(IsVisibleProperty, new Binding
            {
                Path = "IsBuffering",
            });
            AbsoluteLayout.SetLayoutFlags(bufferingLabel, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(bufferingLabel, new Rectangle(0.5, 0.5, 0.25, 0.25));

            var progressBoxView = new BoxView
            {
                Color = Color.FromHex($"#4286f4")
            };

            progressBoxView.SetBinding(AbsoluteLayout.LayoutBoundsProperty, new Binding
            {
                Path      = "Progress",
                Converter = new ProgressToBoundTextConverter()
            });
            AbsoluteLayout.SetLayoutFlags(progressBoxView, AbsoluteLayoutFlags.All);

            var posLabel = new XLabel
            {
                Margin   = new Thickness(10, 0, 0, 0),
                FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(XLabel)),
                HorizontalTextAlignment = XTextAlignment.Start
            };

            posLabel.SetBinding(XLabel.TextProperty, new Binding
            {
                Path      = "Position",
                Converter = new MillisecondToTextConverter()
            });
            AbsoluteLayout.SetLayoutFlags(posLabel, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(posLabel, new Rectangle(0, 0, 1, 1));

            var durationLabel = new XLabel
            {
                Margin   = new Thickness(0, 0, 10, 0),
                FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(XLabel)),
                HorizontalTextAlignment = XTextAlignment.End
            };

            durationLabel.SetBinding(XLabel.TextProperty, new Binding
            {
                Path      = "Duration",
                Converter = new MillisecondToTextConverter()
            });
            AbsoluteLayout.SetLayoutFlags(durationLabel, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(durationLabel, new Rectangle(0, 0, 1, 1));

            var progressInnerLayout = new AbsoluteLayout
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                HeightRequest     = 23,
                BackgroundColor   = Color.FromHex("#80000000"),
                Children          =
                {
                    progressBoxView,
                    posLabel,
                    durationLabel
                }
            };

            var progressLayout = new StackLayout
            {
                Children =
                {
                    new StackLayout {
                        VerticalOptions = LayoutOptions.FillAndExpand
                    },
                    new StackLayout
                    {
                        Margin            = Device.Idiom == TargetIdiom.Watch ? new Thickness(80, 0, 80, 0) : 20,
                        VerticalOptions   = LayoutOptions.End,
                        HorizontalOptions = LayoutOptions.FillAndExpand,
                        BackgroundColor   = Color.FromHex("#50000000"),
                        Children          = { progressInnerLayout }
                    }
                }
            };

            AbsoluteLayout.SetLayoutFlags(progressLayout, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(progressLayout, new Rectangle(0, 0, 1, 1));

            Content = new AbsoluteLayout
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                Children          =
                {
                    progressLayout,
                    PlayIcon,
                    PauseIcon,
                    bufferingLabel
                }
            };
        }
Example #37
0
 public ContainerResolver(AbsoluteLayout container)
 {
     Container = container;
 }
 public static TView WithAbsBounds <TView>(this TView view, double x, double y, double width, double height) where TView : VisualElement
 {
     AbsoluteLayout.SetLayoutBounds(view, new Rectangle(x, y, width, height));
     return(view);
 }
 public static TView WithAbsFlags <TView>(this TView view, AbsFlags flags) where TView : VisualElement
 {
     AbsoluteLayout.SetLayoutFlags(view, (AbsoluteLayoutFlags)flags);
     return(view);
 }
Example #40
0
 private void Initialize()
 {
     Layout = new AbsoluteLayout();
 }
Example #41
0
        private void BindCalendar()
        {
            this.Padding         = 0;
            this.BackgroundColor = CalendarBackColor;
            int Year  = DisplayYear;
            int Month = DisplayMonth;

            CalendarGrid = new Grid
            {
                RowSpacing     = CellSpacing,
                ColumnSpacing  = CellSpacing,
                RowDefinitions = new RowDefinitionCollection {
                    new RowDefinition {
                    }, new RowDefinition {
                    }, new RowDefinition {
                    }, new RowDefinition {
                    }, new RowDefinition {
                    }, new RowDefinition {
                    }, new RowDefinition {
                    },
                },
                ColumnDefinitions = new ColumnDefinitionCollection {
                    new ColumnDefinition {
                    }, new ColumnDefinition {
                    }, new ColumnDefinition {
                    }, new ColumnDefinition {
                    }, new ColumnDefinition {
                    }, new ColumnDefinition {
                    }, new ColumnDefinition {
                    }
                }
            };

            btnPrevious = new Button {
                Text = "<", IsVisible = ShowPreviousMonth, BackgroundColor = NavigationBackgroundColor, TextColor = NavigationTextColor
            };
            btnPrevious.Clicked += BtnPrevious_Clicked;
            Label lblMonthName = new Label {
                TextColor = MonthTextColor, FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)), FontAttributes = FontAttributes.Bold, VerticalOptions = LayoutOptions.CenterAndExpand, Text = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Month).ToString() + " " + Year, HorizontalOptions = LayoutOptions.CenterAndExpand
            };

            btnNext = new Button {
                Text = ">", IsVisible = ShowNextMonth, BackgroundColor = NavigationBackgroundColor, TextColor = NavigationTextColor
            };
            btnNext.Clicked += BtnNext_Clicked;
            BoxView bvPrevious = new BoxView {
                BackgroundColor = TitleBarColor, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand
            };

            CalendarGrid.Children.Add(bvPrevious);
            Grid.SetColumn(bvPrevious, 0);
            Grid.SetRow(bvPrevious, 0);
            CalendarGrid.Children.Add(btnPrevious);
            Grid.SetColumn(btnPrevious, 0);
            Grid.SetRow(btnPrevious, 0);



            BoxView bvMonthName = new BoxView {
                BackgroundColor = TitleBarColor, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand
            };

            CalendarGrid.Children.Add(bvMonthName);
            Grid.SetColumn(bvMonthName, 1);
            Grid.SetRow(bvMonthName, 0);
            Grid.SetColumnSpan(bvMonthName, 5);
            CalendarGrid.Children.Add(lblMonthName);
            Grid.SetColumn(lblMonthName, 1);
            Grid.SetRow(lblMonthName, 0);
            Grid.SetColumnSpan(lblMonthName, 5);


            BoxView bvNext = new BoxView {
                BackgroundColor = TitleBarColor, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand
            };

            CalendarGrid.Children.Add(bvNext);
            Grid.SetColumn(bvNext, 6);
            Grid.SetRow(bvNext, 0);
            CalendarGrid.Children.Add(btnNext);
            Grid.SetColumn(btnNext, 6);
            Grid.SetRow(btnNext, 0);


            for (int i = 0; i < 7; i++)
            {
                BoxView dayNameBackground = new BoxView {
                    BackgroundColor = DayNameBackgroundColor, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand
                };
                string DayName = ((DayOfWeek)i).ToString();
                lblDayName = new Label {
                    Text = DayName.Substring(0, 3), TextColor = DayNameTextColor, HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.CenterAndExpand
                };
                CalendarGrid.Children.Add(dayNameBackground);
                CalendarGrid.Children.Add(lblDayName);
                Grid.SetColumn(dayNameBackground, i);
                Grid.SetRow(dayNameBackground, 1);
                Grid.SetColumn(lblDayName, i);
                Grid.SetRow(lblDayName, 1);
            }

            List <CalanderDays> DateList = new List <CalanderDays>();

            int LastYear          = Month == 1 ? Year - 1 : Year;
            int LastMonth         = Month == 1 ? 12 : Month - 1;
            int PreviousMonthDays = DateTime.DaysInMonth(LastYear, LastMonth);

            DateTime Firstdate = new DateTime(Year, Month, 01);

            int FirstDayNumber = (int)Firstdate.DayOfWeek;

            int StartNumber = 0;

            if (FirstDayNumber == 0)
            {
                StartNumber = (PreviousMonthDays + 1) - (FirstDayNumber + 7);
            }
            else
            {
                StartNumber = (PreviousMonthDays + 1) - FirstDayNumber;
            }

            int DaysInMonth = DateTime.DaysInMonth(Year, Month);

            for (int i = StartNumber; i <= PreviousMonthDays; i++)
            {
                DateList.Add(new CalanderDays(1, i));
            }

            for (int i = 1; i <= DaysInMonth; i++)
            {
                DateList.Add(new CalanderDays(2, i));
            }
            int NextMonthDay = 1;

            for (int i = DateList.Count; i < 42; i++)
            {
                DateList.Add(new CalanderDays(3, NextMonthDay));
                NextMonthDay++;
            }
            int cn = 0, rn = 2;
            int TodayDate = DateTime.Today.Day;

            foreach (var item in DateList)
            {
                StackLayout slCellContainer = new StackLayout {
                    BackgroundColor = CellBackgroundColor
                };

                switch (item.DayType)
                {
                case 1:
                case 3:

                    lblOtherMonthDayNumber = new Label {
                        Text = item.DayNumber.ToString(), TextColor = OtherMonthDayColor, HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.CenterAndExpand
                    };
                    slCellContainer.Children.Add(lblOtherMonthDayNumber);
                    Grid.SetColumn(lblOtherMonthDayNumber, cn);
                    Grid.SetRow(lblOtherMonthDayNumber, rn);
                    break;

                case 2:
                    lblCurrentMonthDayNumber = new Label {
                        Text = item.DayNumber.ToString(), TextColor = DateColor, HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.CenterAndExpand
                    };
                    if (item.DayNumber == TodayDate && Month == DateTime.Today.Month)
                    {
                        slCellContainer.BackgroundColor    = TodayBackgroundColor;
                        lblCurrentMonthDayNumber.TextColor = TodayTextColor;
                    }

                    slCellContainer.Children.Add(lblCurrentMonthDayNumber);
                    TapGestureRecognizer tapGestureRecognizer = new TapGestureRecognizer();
                    tapGestureRecognizer.Tapped += TapGestureRecognizer_Tapped;
                    slCellContainer.GestureRecognizers.Add(tapGestureRecognizer);
                    break;
                }

                slCellContainer.StyleId = item.DayNumber.ToString();
                CalendarGrid.Children.Add(slCellContainer);
                if (item.DayType == 2)
                {
                    DateRendered(slCellContainer, null);
                }
                Grid.SetColumn(slCellContainer, cn);
                Grid.SetRow(slCellContainer, rn);

                if (cn == 6)
                {
                    cn = 0;
                    rn++;
                }
                else
                {
                    cn++;
                }
            }
            container = new AbsoluteLayout();



            imgBackground = new Image {
                Source = CalendarBackgroundImage
            };


            container.Children.Add(imgBackground);
            AbsoluteLayout.SetLayoutBounds(imgBackground, Rectangle.FromLTRB(0, 0, 1, 1));
            AbsoluteLayout.SetLayoutFlags(imgBackground, AbsoluteLayoutFlags.All);



            container.Children.Add(CalendarGrid);
            AbsoluteLayout.SetLayoutBounds(CalendarGrid, Rectangle.FromLTRB(0, 0, 1, 1));
            AbsoluteLayout.SetLayoutFlags(CalendarGrid, AbsoluteLayoutFlags.All);
            Frame frame = new Frame {
                BorderColor = BorderColor, CornerRadius = BorderRadius, Padding = 5, HasShadow = HasShadow
            };

            frame.Content = container;

            this.Content = frame;
        }
Example #42
0
        private void initialize()
        {
            popupStyle = Style as PopupStyle;
            if (popupStyle == null)
            {
                throw new Exception("Popup style is null.");
            }

            BackgroundColor        = Color.Black;
            Size                   = new Size(POPUP_WIDTH, POPUP_HEIGHT);
            PositionUsesPivotPoint = true;
            ParentOrigin           = NUI.ParentOrigin.Center;
            PivotPoint             = NUI.PivotPoint.Center;
            Layout                 = new AbsoluteLayout();

            layer = new Layer()
            {
                Name = "PopupLayer",
            };
            layer.Add(this);

            buttonList = new Dictionary <string, Button>();

            buttonContainer = new View()
            {
                WidthSpecification  = LayoutParamPolicies.MatchParent,
                HeightSpecification = LayoutParamPolicies.MatchParent,
            };
            Add(buttonContainer);

            titleContentContainer = new View()
            {
                WidthSpecification  = LayoutParamPolicies.MatchParent,
                HeightSpecification = LayoutParamPolicies.MatchParent,
            };
            Add(titleContentContainer);

            //will be fixed later.
            //titleContentContainer.Layout = new LinearLayout()
            //{
            //    LinearOrientation = LinearLayout.Orientation.Vertical,
            //    LinearAlignment = LinearLayout.Alignment.Top,
            //};

            title = new TextLabel()
            {
                Name                = "Title",
                Size                = new Size(TITLE_WIDTH, TITLE_HEIGHT),
                PointSize           = TEXT_POINT_SIZE,
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment   = VerticalAlignment.Center,
                TextColor           = Color.Cyan,

                //will be removed later.
                PositionUsesPivotPoint = true,
                ParentOrigin           = Tizen.NUI.ParentOrigin.TopCenter,
                PivotPoint             = Tizen.NUI.PivotPoint.TopCenter,
                Position = new Position(0, TITLE_POSITION_Y),
            };
            titleContentContainer.Add(title);

            LinearLayout scrollLayout = new LinearLayout();

            scrollLayout.LinearOrientation = LinearLayout.Orientation.Vertical;

            ContentContainer = new View()
            {
                Layout = scrollLayout,

                //will be removed later.
                PositionUsesPivotPoint = true,
                ParentOrigin           = Tizen.NUI.ParentOrigin.TopCenter,
                PivotPoint             = Tizen.NUI.PivotPoint.TopCenter,
            };

            scroll = new ScrollableBase()
            {
                Name = "Scroll",
                PositionUsesPivotPoint = true,
                ScrollingDirection     = ScrollableBase.Direction.Vertical,
                ScrollEnabled          = true,
                WidthResizePolicy      = ResizePolicyType.FillToParent,
                HeightResizePolicy     = ResizePolicyType.FillToParent,

                //will be removed later.
                ParentOrigin = Tizen.NUI.ParentOrigin.TopCenter,
                PivotPoint   = Tizen.NUI.PivotPoint.TopCenter,
                Position     = new Position(0, CONTENT_POSITION_Y),
            };
            titleContentContainer.Add(scroll);
            scroll.Add(ContentContainer);

            scrollList = new Dictionary <string, View>();

            TouchEvent += Popup_TouchEvent;

            title.PropertyChanged += Title_PropertyChanged;
        }
        public AboutPage()
        {
            NavigationPage.SetHasNavigationBar(this, false);
            AbsoluteLayout peakLayout = new AbsoluteLayout
            {
                HeightRequest   = 250,
                BackgroundColor = Color.Black
            };

            var title = new Label
            {
                Text       = "Sapienza University",
                FontSize   = 30,
                FontFamily = "AvenirNext-DemiBold",
                TextColor  = Color.White
            };

            var where = new Label
            {
                Text       = "Italy, Rome",
                TextColor  = Color.FromHex("#ddd"),
                FontFamily = "AvenirNextCondensed-Medium"
            };

            var image = new Image()
            {
                Source = "/Users/pirouz/Projects/xamarin projects/Sapienza/Sapienza/Resources/sapienzaback.jpeg",
                Aspect = Aspect.AspectFill,
            };

            var overlay = new BoxView()
            {
                Color = Color.Black.MultiplyAlpha(.7f)
            };

            var pin = new Image()
            {
                Source        = "/Users/pirouz/Projects/xamarin projects/Sapienza/Sapienza/Resources/white-pin-hi.png",
                HeightRequest = 25,
                WidthRequest  = 25
            };

            var description = new Frame()
            {
                Padding         = new Thickness(10, 5),
                HasShadow       = false,
                BackgroundColor = Color.FromHex("#77202D"),
                Content         = new Label()
                {
                    FontSize  = 14,
                    TextColor = Color.FromHex("#ddd"),
                    Text      = "The Sapienza University of Rome (Italian: Sapienza – Università di Roma), also called simply Sapienza or the University of Rome, is a collegiate research university located in Rome, Italy. Formally known as Università degli Studi di Roma 'La Sapienza', it is one of the largest European universities by enrollments and one of the oldest in history, founded in 1303. The University is one of the most prestigious Italian universities, commonly ranking first in national rankings and in Southern Europe."
                }
            };

            AbsoluteLayout.SetLayoutFlags(overlay, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(overlay, new Rectangle(0, 1, 1, 0.3));

            AbsoluteLayout.SetLayoutFlags(image, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(image, new Rectangle(0f, 0f, 1f, 1f));

            AbsoluteLayout.SetLayoutFlags(title, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds(title,
                                           new Rectangle(0.1, 0.85, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize)
                                           );

            AbsoluteLayout.SetLayoutFlags(where, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds(where,
                                           new Rectangle(0.1, 0.95, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize)
                                           );

            AbsoluteLayout.SetLayoutFlags(pin, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds(pin,
                                           new Rectangle(0.95, 0.9, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize)
                                           );

            peakLayout.Children.Add(image);
            peakLayout.Children.Add(overlay);
            peakLayout.Children.Add(title);
            peakLayout.Children.Add(where);
            peakLayout.Children.Add(pin);

            Content = new StackLayout()
            {
                BackgroundColor = Color.FromHex("#77202D"),
                Children        =
                {
                    peakLayout,
                    description,
                }
            };
        }
Example #44
0
        public SalesDashboardPage()
        {
            _AuthenticationService = DependencyService.Get <IAuthenticationService>();

            this.SetBinding(Page.TitleProperty, new Binding()
            {
                Source = TextResources.Sales
            });

            #region sales chart view
            var salesChartView = new SalesDashboardChartView()
            {
                BindingContext = _SalesDashboardChartViewModel = new SalesDashboardChartViewModel()
            };

            #endregion

            #region leads view
            var leadsView = new LeadsView {
                BindingContext = _SalesDashboardLeadsViewModel = new SalesDashboardLeadsViewModel(new Command(PushTabbedLeadPageAction))
            };
            #endregion

            _ScrollView = new ScrollView
            {
                Content = new StackLayout
                {
                    Spacing  = 0,
                    Children =
                    {
                        salesChartView,
                        leadsView
                    }
                }
            };

            #region compose view hierarchy
            if (Device.OS == TargetPlatform.Android)
            {
                _Fab = new FloatingActionButtonView
                {
                    ImageName    = "fab_add.png",
                    ColorNormal  = Palette._001,
                    ColorPressed = Palette._002,
                    ColorRipple  = Palette._001,
                    Clicked      = (sender, args) =>
                                   _SalesDashboardLeadsViewModel.PushTabbedLeadPageCommand.Execute(null),
                };

                var absolute = new AbsoluteLayout
                {
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                };

                // Position the pageLayout to fill the entire screen.
                // Manage positioning of child elements on the page by editing the pageLayout.
                AbsoluteLayout.SetLayoutFlags(_ScrollView, AbsoluteLayoutFlags.All);
                AbsoluteLayout.SetLayoutBounds(_ScrollView, new Rectangle(0f, 0f, 1f, 1f));
                absolute.Children.Add(_ScrollView);

                // Overlay the FAB in the bottom-right corner
                AbsoluteLayout.SetLayoutFlags(_Fab, AbsoluteLayoutFlags.PositionProportional);
                AbsoluteLayout.SetLayoutBounds(_Fab, new Rectangle(1f, 1f, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
                absolute.Children.Add(_Fab);

                Content = absolute;
            }
            else
            {
                ToolbarItems.Add(new ToolbarItem("Add", "add_ios_gray", () =>
                                                 _SalesDashboardLeadsViewModel.PushTabbedLeadPageCommand.Execute(null)));

                Content = _ScrollView;
            }
            #endregion

            #region wire up MessagingCenter
            // Catch the login success message from the MessagingCenter.
            // This is really only here for Android, which doesn't fire the OnAppearing() method in the same way that iOS does (every time the page appears on screen).
            Device.OnPlatform(Android: () => MessagingCenter.Subscribe <SplashPage>(this, MessagingServiceConstants.AUTHENTICATED, sender => OnAppearing()));
            #endregion
        }
        private void AbsoluteLayout_Unfocused(object sender, FocusEventArgs e)
        {
            AbsoluteLayout layout = (AbsoluteLayout)sender;

            layout.BackgroundColor = Color.LightSteelBlue;
        }
Example #46
0
        public AbsoluteLayout TitleCirleButtons(string text, params CustomButton[] buttons)
        {
            var result = new AbsoluteLayout
            {
                BackgroundColor   = Palette.Transparent,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand
            };

            var label = new CustomLabel
            {
                Text      = text,
                TextColor = Palette.White,
                HorizontalTextAlignment = TextAlignment.Center,
                HorizontalOptions       = LayoutOptions.CenterAndExpand,
                VerticalOptions         = LayoutOptions.Center,
                FontAttributes          = FontAttributes.Bold,
                FontSize = PaletteText.FontSizeM
            };

            AbsoluteLayout.SetLayoutBounds(label, new Rectangle(0.5, 0.5, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
            AbsoluteLayout.SetLayoutFlags(label, AbsoluteLayoutFlags.PositionProportional);
            result.Children.Add(label);

            var buttonStack = new StackLayout
            {
                Orientation       = StackOrientation.Horizontal,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Spacing           = 10,
                Padding           = new Thickness(0, 0, 10, 0)
            };

            foreach (var button in buttons)
            {
                var layoutButton = new AbsoluteLayout
                {
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    HorizontalOptions = LayoutOptions.FillAndExpand
                };

                var labelButton = new CustomLabel
                {
                    Text      = button.Text,
                    TextColor = Color.White,
                    FontSize  = PaletteText.FontSizeL,
                    HorizontalTextAlignment = TextAlignment.Center,
                    VerticalTextAlignment   = TextAlignment.Center,
                    VerticalOptions         = LayoutOptions.FillAndExpand,
                    HorizontalOptions       = LayoutOptions.FillAndExpand
                };

                double xLabel = 0.5;
                double yLabel = 0.4;

                AbsoluteLayout.SetLayoutBounds(labelButton,
                                               new Rectangle(xLabel, yLabel, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
                AbsoluteLayout.SetLayoutFlags(labelButton, AbsoluteLayoutFlags.PositionProportional);

                AbsoluteLayout.SetLayoutBounds(button, new Rectangle(0, 0.5, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
                AbsoluteLayout.SetLayoutFlags(button, AbsoluteLayoutFlags.PositionProportional);

                layoutButton.Children.Add(button);
                layoutButton.Children.Add(labelButton);


                buttonStack.Children.Add(layoutButton);
            }
            AbsoluteLayout.SetLayoutBounds(buttonStack, new Rectangle(1, .5, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
            AbsoluteLayout.SetLayoutFlags(buttonStack, AbsoluteLayoutFlags.PositionProportional);
            result.Children.Add(buttonStack);

            return(result);
        }
Example #47
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:Mapsui.UI.Forms.MapView"/> class.
        /// </summary>
        public MapView()
        {
            MyLocationEnabled = false;
            MyLocationFollow  = false;

            IsClippedToBounds = true;

            _mapControl = new MapControl()
            {
                UseDoubleTap = false
            };
            _mapMyLocationLayer = new MyLocationLayer(this)
            {
                Enabled = true
            };
            _mapPinLayer = new Layer(PinLayerName)
            {
                IsMapInfoLayer = true
            };
            _mapDrawableLayer = new Layer(DrawableLayerName)
            {
                IsMapInfoLayer = true
            };

            // Get defaults from MapControl
            RotationLock = Map.RotationLock;
            ZoomLock     = Map.ZoomLock;
            PanLock      = Map.PanLock;

            // Add some events to _mapControl
            _mapControl.Viewport.ViewportChanged += HandlerViewportChanged;
            _mapControl.ViewportInitialized      += HandlerViewportInitialized;
            _mapControl.Info            += HandlerInfo;
            _mapControl.PropertyChanged += HandlerMapControlPropertyChanged;
            _mapControl.SingleTap       += HandlerTap;
            _mapControl.DoubleTap       += HandlerTap;
            _mapControl.LongTap         += HandlerLongTap;
            _mapControl.Hovered         += HandlerHover;
            _mapControl.TouchMove       += (s, e) =>
            {
                Device.BeginInvokeOnMainThread(() => MyLocationFollow = false);
            };

            AbsoluteLayout.SetLayoutBounds(_mapControl, new Rectangle(0, 0, 1, 1));
            AbsoluteLayout.SetLayoutFlags(_mapControl, AbsoluteLayoutFlags.All);

            _pictMyLocationNoCenter = (new SkiaSharp.Extended.Svg.SKSvg()).Load(Mapsui.Utilities.EmbeddedResourceLoader.Load("Images.LocationNoCenter.svg", typeof(MapView)));
            _pictMyLocationCenter   = (new SkiaSharp.Extended.Svg.SKSvg()).Load(Mapsui.Utilities.EmbeddedResourceLoader.Load("Images.LocationCenter.svg", typeof(MapView)));

            _mapZoomInButton = new SvgButton(Mapsui.Utilities.EmbeddedResourceLoader.Load("Images.ZoomIn.svg", typeof(MapView)))
            {
                BackgroundColor = Color.White,
                WidthRequest    = 40,
                HeightRequest   = 40,
                Command         = new Command((object obj) => { _mapControl.Navigator.ZoomIn(); Refresh(); }),
            };

            _mapZoomOutButton = new SvgButton(Mapsui.Utilities.EmbeddedResourceLoader.Load("Images.ZoomOut.svg", typeof(MapView)))
            {
                BackgroundColor = Color.White,
                WidthRequest    = 40,
                HeightRequest   = 40,
                Command         = new Command((object obj) => { _mapControl.Navigator.ZoomOut(); Refresh(); }),
            };

            _mapSpacingButton1 = new Image {
                BackgroundColor = Color.Transparent, WidthRequest = 40, HeightRequest = 8
            };

            _mapMyLocationButton = new SvgButton(_pictMyLocationNoCenter)
            {
                BackgroundColor = Color.White,
                WidthRequest    = 40,
                HeightRequest   = 40,
                Command         = new Command((object obj) => MyLocationFollow = !MyLocationFollow),
            };

            _mapSpacingButton2 = new Image {
                BackgroundColor = Color.Transparent, WidthRequest = 40, HeightRequest = 8
            };

            _mapNorthingButton = new SvgButton(Mapsui.Utilities.EmbeddedResourceLoader.Load("Images.RotationZero.svg", typeof(MapView)))
            {
                BackgroundColor = Color.White,
                WidthRequest    = 40,
                HeightRequest   = 40,
                Command         = new Command((object obj) => Device.BeginInvokeOnMainThread(() => _mapControl.Navigator.RotateTo(0))),
            };

            _mapButtons = new StackLayout {
                BackgroundColor = Color.Transparent, Opacity = 0.8, Spacing = 0, IsVisible = true
            };

            _mapButtons.Children.Add(_mapZoomInButton);
            _mapButtons.Children.Add(_mapZoomOutButton);
            _mapButtons.Children.Add(_mapSpacingButton1);
            _mapButtons.Children.Add(_mapMyLocationButton);
            _mapButtons.Children.Add(_mapSpacingButton2);
            _mapButtons.Children.Add(_mapNorthingButton);

            AbsoluteLayout.SetLayoutBounds(_mapButtons, new Rectangle(0.95, 0.03, 40, 176));
            AbsoluteLayout.SetLayoutFlags(_mapButtons, AbsoluteLayoutFlags.PositionProportional);

            Content = new AbsoluteLayout
            {
                Children =
                {
                    _mapControl,
                    _mapButtons,
                }
            };

            _pins.CollectionChanged     += HandlerPinsOnCollectionChanged;
            _drawable.CollectionChanged += HandlerDrawablesOnCollectionChanged;

            _mapPinLayer.DataSource = new ObservableCollectionProvider <Pin>(_pins);
            _mapPinLayer.Style      = null; // We don't want a global style for this layer

            _mapDrawableLayer.DataSource = new ObservableCollectionProvider <Drawable>(_drawable);
            _mapDrawableLayer.Style      = null; // We don't want a global style for this layer
        }
        /// <summary>
        /// Draw the battle board
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void DrawBattleBoard()
        {
            BattleBoard.Children.Clear();

            var map = EngineViewModel.Engine.MapModel;

            int num_row = map.MapXAxiesCount;

            int num_col = map.MapXAxiesCount;

            // Create rows and columns
            for (int i = 0; i < num_row; i++)
            {
                BattleBoard.RowDefinitions.Add(new RowDefinition {
                    Height = new GridLength(100)
                });
            }

            for (int i = 0; i < num_col; i++)
            {
                BattleBoard.ColumnDefinitions.Add(new ColumnDefinition {
                    Width = new GridLength(100)
                });
            }

            // Fill the grid with players
            for (int i = 0; i < num_row; i++)
            {
                for (int j = 0; j < num_col; j++)
                {
                    var player = map.MapGridLocation[i, j].Player;

                    var cellContent = new AbsoluteLayout();

                    var backgroundImage = new Image {
                        Source = "battle_tile.png"
                    };

                    cellContent.Children.Add(backgroundImage, new Rectangle(0, 0, 1, 1), AbsoluteLayoutFlags.All);

                    // Image button for characters
                    if (player.PlayerType == PlayerTypeEnum.Character)
                    {
                        var characterButtonImage = new ImageButton {
                            Source = player.ImageURI
                        };

                        characterButtonImage.BindingContext = player;

                        characterButtonImage.Clicked += OnPlayerClicked;

                        cellContent.Children.Add(characterButtonImage, new Rectangle(0, 0, 1, 1), AbsoluteLayoutFlags.All);
                    }
                    // Image for monsters
                    else if (player.PlayerType == PlayerTypeEnum.Monster)
                    {
                        var monsterImage = new Image {
                            Source = player.ImageURI
                        };

                        cellContent.Children.Add(monsterImage, new Rectangle(0, 0, 1, 1), AbsoluteLayoutFlags.All);
                    }

                    BattleBoard.Children.Add(cellContent, i, j);
                }
            }
        }
        public CardsSampleView()
        {
            var cardsView = new CardsView
            {
                ItemTemplate    = new DataTemplate(() => new DefaultCardItemView()),
                BackgroundColor = Color.Black.MultiplyAlpha(.9)
            };

            AbsoluteLayout.SetLayoutFlags(cardsView, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(cardsView, new Rectangle(0, 0, 1, 1));

            //cardsView.GestureRecognizers.
            //AbsoluteLayout.SetLayoutBounds(cardsView, new Rectangle(0, 0, HeightRequest = 50, WidthRequest = 100));

            var prevItem = new ToolbarItem
            {
                Text             = "**Prev**",
                Icon             = "prev",
                CommandParameter = false
            };

            prevItem.SetBinding(MenuItem.CommandProperty, nameof(CardsSampleViewModel.PanPositionChangedCommand));

            var nextItem = new ToolbarItem
            {
                Text             = "**Next**",
                Icon             = "next",
                CommandParameter = true
            };

            nextItem.SetBinding(MenuItem.CommandProperty, nameof(CardsSampleViewModel.PanPositionChangedCommand));

            ToolbarItems.Add(prevItem);
            ToolbarItems.Add(nextItem);

            cardsView.SetBinding(CardsView.ItemsSourceProperty, nameof(CardsSampleViewModel.Items));
            cardsView.SetBinding(CardsView.SelectedIndexProperty, nameof(CardsSampleViewModel.CurrentIndex));

            Title = "Tips for a Happy Classroom";


            //var removeButton = new Button
            //{
            //	Text = "Remove current",
            //	FontAttributes = FontAttributes.Bold,
            //	TextColor = Color.Black,
            //	BackgroundColor = Color.Yellow.MultiplyAlpha(.7),
            //	Margin = new Thickness(0, 0, 0, 10)
            //};

            //removeButton.SetBinding(Button.CommandProperty, nameof(CardsSampleViewModel.RemoveCurrentItemCommand));

            //AbsoluteLayout.SetLayoutFlags(removeButton, AbsoluteLayoutFlags.PositionProportional);
            //AbsoluteLayout.SetLayoutBounds(removeButton, new Rectangle(.5, 1, 150, 40));



            Content = new AbsoluteLayout()
            {
                Children =
                {
                    cardsView
                    //removeButton
                }
            };

            BindingContext = new CardsSampleViewModel();
        }
        public CustomerDetailHeaderView()
        {
            #region company image
            Image companyImage = new Image()
            {
                Aspect = Aspect.AspectFill
            };
            companyImage.SetBinding(Image.SourceProperty, "Account.ImageUrl");
            #endregion

            #region gradient image
            Image gradientImage = new Image()
            {
                Aspect = Aspect.Fill, Source = new FileImageSource()
                {
                    File = "bottom_up_gradient"
                }, HeightRequest = 75, BindingContext = companyImage
            };
            gradientImage.SetBinding(Image.IsVisibleProperty, "IsLoading", converter: new InverseBooleanConverter());
            #endregion

            #region activity indicator
            ActivityIndicator imageLoadingIndicator = new ActivityIndicator()
            {
                BindingContext = companyImage
            };
            imageLoadingIndicator.SetBinding(ActivityIndicator.IsEnabledProperty, "IsLoading");
            imageLoadingIndicator.SetBinding(ActivityIndicator.IsVisibleProperty, "IsLoading"); // here, since we're bound to the companyImage already, we can just reference the IsLoading property
            imageLoadingIndicator.SetBinding(ActivityIndicator.IsRunningProperty, "IsLoading"); // here, since we're bound to the companyImage already, we can just reference the IsLoading property
            #endregion

            #region company label
            Label companyLabel = new Label()
            {
                TextColor     = Color.White,
                FontSize      = Device.OnPlatform(Device.GetNamedSize(NamedSize.Large, typeof(Label)), Device.GetNamedSize(NamedSize.Large, typeof(Label)), Device.GetNamedSize(NamedSize.Large, typeof(Label))),
                LineBreakMode = LineBreakMode.TailTruncation
            };
            companyLabel.SetBinding(Label.TextProperty, "Account.Company");
            companyLabel.SetBinding(Label.TextColorProperty, new Binding("IsLoading", source: companyImage, converter: new CompanyLabelBooleanToColorConverter()));
            #endregion

            #region industry label
            Label industryLabel = new Label()
            {
                TextColor     = Palette._008,
                FontSize      = Device.OnPlatform(Device.GetNamedSize(NamedSize.Small, typeof(Label)), Device.GetNamedSize(NamedSize.Small, typeof(Label)), Device.GetNamedSize(NamedSize.Small, typeof(Label))),
                LineBreakMode = LineBreakMode.TailTruncation
            };
            industryLabel.SetBinding(Label.TextProperty, "Account.Industry");
            industryLabel.SetBinding(Label.TextColorProperty, new Binding("IsLoading", source: companyImage, converter: new IndustryLabelBooleanToColorConverter()));
            #endregion

            #region compose view hierarchy
            StackLayout stackLayout = new UnspacedStackLayout()
            {
                Children =
                {
                    companyLabel,
                    industryLabel
                },
                Padding = new Thickness(20)
            };
            AbsoluteLayout absoluteLayout = new AbsoluteLayout()
            {
                HeightRequest = 150
            };
            absoluteLayout.Children.Add(companyImage, new Rectangle(0, 0, 1, 1), AbsoluteLayoutFlags.All);
            absoluteLayout.Children.Add(imageLoadingIndicator, new Rectangle(0, .5, 1, AbsoluteLayout.AutoSize), AbsoluteLayoutFlags.WidthProportional | AbsoluteLayoutFlags.PositionProportional);
            absoluteLayout.Children.Add(gradientImage, new Rectangle(0, 1, 1, AbsoluteLayout.AutoSize), AbsoluteLayoutFlags.WidthProportional | AbsoluteLayoutFlags.PositionProportional);
            absoluteLayout.Children.Add(stackLayout, new Rectangle(0, 1, 1, AbsoluteLayout.AutoSize), AbsoluteLayoutFlags.WidthProportional | AbsoluteLayoutFlags.PositionProportional);
            #endregion

            Content = absoluteLayout;
        }
Example #51
0
        private void InsertPopupViewInCurrentPage(ContentPage currentPage, DialogPage modalPage, View popupView, bool hideOnBackgroundTapped, Action <IDialogParameters> callback)
        {
            View mask = DialogLayout.GetMask(popupView);

            if (mask is null)
            {
                Style overlayStyle = GetOverlayStyle(popupView);

                mask = new BoxView
                {
                    Style = overlayStyle
                };
            }

            mask.SetBinding(VisualElement.WidthRequestProperty, new Binding {
                Path = "Width", Source = modalPage
            });
            mask.SetBinding(VisualElement.HeightRequestProperty, new Binding {
                Path = "Height", Source = modalPage
            });

            if (hideOnBackgroundTapped)
            {
                var dismissCommand = new Command(() => callback(new DialogParameters()));
                mask.GestureRecognizers.Add(new TapGestureRecognizer
                {
                    Command = dismissCommand
                });
            }

            var overlay        = new AbsoluteLayout();
            var popupContainer = new DialogContainer
            {
                IsPopupContent    = true,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Center,
                Content           = popupView,
            };

            var relativeWidth = DialogLayout.GetRelativeWidthRequest(popupView);

            if (relativeWidth != null)
            {
                popupContainer.SetBinding(DialogContainer.WidthRequestProperty,
                                          new Binding("Width",
                                                      BindingMode.OneWay,
                                                      new RelativeContentSizeConverter {
                    RelativeSize = relativeWidth.Value
                },
                                                      source: modalPage));
            }

            var relativeHeight = DialogLayout.GetRelativeHeightRequest(popupView);

            if (relativeHeight != null)
            {
                popupContainer.SetBinding(DialogContainer.HeightRequestProperty,
                                          new Binding("Height",
                                                      BindingMode.OneWay,
                                                      new RelativeContentSizeConverter {
                    RelativeSize = relativeHeight.Value
                },
                                                      source: modalPage));
            }

            AbsoluteLayout.SetLayoutFlags(popupContainer, AbsoluteLayoutFlags.PositionProportional);
            var popupBounds = DialogLayout.GetLayoutBounds(popupView);

            AbsoluteLayout.SetLayoutBounds(popupContainer, popupBounds);

            if (DialogLayout.GetUseMask(popupContainer.Content) ?? true)
            {
                overlay.Children.Add(mask);
            }

            overlay.Children.Add(popupContainer);

            modalPage.Content    = overlay;
            modalPage.DialogView = popupView;
            currentPage.Navigation.PushModalAsync(modalPage, true);
        }
Example #52
0
        void StartTestChangeST()
        {
            var rand = new Random2(0);

            breakTest = false;

            var width  = grid.Width;
            var height = grid.Height;

            const int step   = 20;
            var       labels = new Label[step * 2];

            var processed = 0;

            long   prevTicks     = 0;
            long   prevMs        = 0;
            int    prevProcessed = 0;
            double avgSum        = 0;
            int    avgN          = 0;
            var    sw            = new Stopwatch();

            var texts = new string[] { "dOpe", "Dope", "doPe", "dopE" };

            Action loop = null;

            loop = () =>
            {
                if (breakTest)
                {
                    var avg = avgSum / avgN;
                    dopes.Text = string.Format("{0:0.00} Dopes/s (AVG)", avg).PadLeft(21);
                    return;
                }


                var now = sw.ElapsedMilliseconds;

                //60hz, 16ms to build the frame
                while (sw.ElapsedMilliseconds - now < 16)
                {
                    var label = new Label()
                    {
                        Text      = "Dope",
                        TextColor = new Color(rand.NextDouble(), rand.NextDouble(), rand.NextDouble()),
                        Rotation  = rand.NextDouble() * 360
                    };

                    AbsoluteLayout.SetLayoutFlags(label, AbsoluteLayoutFlags.PositionProportional);
                    AbsoluteLayout.SetLayoutBounds(label, new Rectangle(rand.NextDouble(), rand.NextDouble(), 80, 24));

                    if (processed > max)
                    {
                        (absolute.Children[processed % max] as Label).Text = texts[(int)Math.Floor(rand.NextDouble() * 4)];
                    }
                    else
                    {
                        absolute.Children.Add(label);
                    }

                    processed++;

                    if (sw.ElapsedMilliseconds - prevMs > 500)
                    {
                        var r = (double)(processed - prevProcessed) / ((double)(sw.ElapsedTicks - prevTicks) / Stopwatch.Frequency);
                        prevTicks     = sw.ElapsedTicks;
                        prevProcessed = processed;

                        if (processed > max)
                        {
                            dopes.Text = string.Format("{0:0.00} Dopes/s", r).PadLeft(15);
                            avgSum    += r;
                            avgN++;
                        }

                        prevMs = sw.ElapsedMilliseconds;
                    }
                }

                Device.BeginInvokeOnMainThread(loop);
            };

            sw.Start();

            Device.BeginInvokeOnMainThread(loop);
        }
Example #53
0
        /// <summary>
        /// <inheritdoc/>
        /// </summary>
        /// <param name="index"></param>
        protected override void OnScrolled(double index)
        {
            lock (m_lock)
            {
                base.OnScrolled(index);
                if (Width < 0.1)
                {
                    return;
                }
                var center        = base.Center;
                var itemWidth     = base.GetItemWidth();
                var selectedIndex = GetIndexFromValue(index);
                var itemCount     = (center * 2) / itemWidth + 1;

                ClearViewCache(selectedIndex, (int)Math.Floor(itemCount));

                var toAdd = new HashSet <View>();
                for (var i = index - itemCount; i <= index + itemCount; i++)
                {
                    var iIndex = (int)Math.Floor(i);
                    if (iIndex < Config.MinValue || iIndex > Config.MaxValue)
                    {
                        continue;
                    }
                    var view = CreateItem(iIndex);

                    UpdateSelected(view, selectedIndex == iIndex);

                    if (ScaleDown)
                    {
                        var dist     = (Math.Abs(index - iIndex) / itemCount);
                        var position = (itemWidth * (1 - dist * 0.33) * (iIndex - index));
                        AbsoluteLayout.SetLayoutBounds(view, new Rectangle(Center + position - itemWidth / 2, 0, ElementWidth, 1));
                        view.Scale = 1 - dist * 0.5;
                    }
                    else
                    {
                        AbsoluteLayout.SetLayoutBounds(view, new Rectangle(Center + (iIndex - index) * itemWidth - itemWidth / 2, 0, ElementWidth, 1));
                    }

                    toAdd.Add(view);
                }

                for (var i = m_container.Children.Count - 1; i >= 0; i--)
                {
                    var item = m_container.Children[i];
                    if (!toAdd.Contains(item))
                    {
                        m_currentChildren.Remove(item);
                        m_container.Children.RemoveAt(i);
                    }
                }

                foreach (var item in toAdd)
                {
                    if (!m_currentChildren.Add(item))
                    {
                        continue;
                    }
                    m_container.Children.Add(item);
                }
            }
        }
Example #54
0
        void StartTestMT()
        {
            var rand = new Random2(0);

            breakTest = false;

            var width  = absolute.Width;
            var height = absolute.Height;

            var i         = 0;
            var processed = 0;

            var thread = new Thread(() =>
            {
                while (true)
                {
                    if (processed < i - 20)
                    {
                        Thread.Sleep(1);
                        continue;
                    }

                    var label = new Label()
                    {
                        Text      = "Dope",
                        TextColor = new Color(rand.NextDouble(), rand.NextDouble(), rand.NextDouble()),
                        Rotation  = rand.NextDouble() * 360
                    };

                    AbsoluteLayout.SetLayoutFlags(label, AbsoluteLayoutFlags.PositionProportional);
                    AbsoluteLayout.SetLayoutBounds(label, new Rectangle(rand.NextDouble(), rand.NextDouble(), 80, 24));

                    absolute.Dispatcher.BeginInvokeOnMainThread(() =>
                    {
                        if (i > max)
                        {
                            absolute.Children.RemoveAt(0);
                        }

                        absolute.Children.Add(label);

                        processed++;
                    });

                    if (breakTest)
                    {
                        break;
                    }

                    i++;
                }
            });

            thread.IsBackground = true;
            thread.Priority     = ThreadPriority.Lowest;
            thread.Start();

            var sw = new Stopwatch();

            sw.Start();
            long   prevTicks     = 0;
            int    prevProcessed = 0;
            double avgSum        = 0;
            int    avgN          = 0;

            Device.StartTimer(TimeSpan.FromMilliseconds(500), () =>
            {
                if (stop.IsVisible)
                {
                    var avg    = avgSum / avgN;
                    dopes.Text = string.Format("{0:0.00} Dopes/s (AVG)", avg).PadLeft(21);
                    return(false);
                }

                var r         = (double)(processed - prevProcessed) / ((double)(sw.ElapsedTicks - prevTicks) / Stopwatch.Frequency);
                dopes.Text    = string.Format("{0:0.00} Dopes/s", r).PadLeft(15);
                prevTicks     = sw.ElapsedTicks;
                prevProcessed = processed;

                if (i > max)
                {
                    avgSum += r;
                    avgN++;
                }

                return(true);
            });
        }
        public CoverFlowView(double width)
        {
            var itemTemplate = new DataTemplate(() =>
            {
                var layout = new AbsoluteLayout()
                {
                    WidthRequest = width / 3,
                };
                var fLabel = new Frame()
                {
                    CornerRadius = 5,
                    Padding      = 0
                };
                var frame = new Frame()
                {
                    Padding           = 0,
                    HasShadow         = false,
                    CornerRadius      = 10,
                    IsClippedToBounds = true
                };
                layout.Children.Add(frame, new Rectangle(.5, .5, width / 3, width / 3), AbsoluteLayoutFlags.PositionProportional);
                layout.Children.Add(fLabel, new Rectangle(.5, .6, width / 8, width / 12), AbsoluteLayoutFlags.PositionProportional);

                fLabel.SetBinding(BackgroundColorProperty, "Color");
                frame.SetBinding(BackgroundColorProperty, "Color");
                var label = new Label
                {
                    TextColor               = Color.White,
                    HorizontalOptions       = LayoutOptions.Center,
                    VerticalOptions         = LayoutOptions.Center,
                    HorizontalTextAlignment = TextAlignment.Center,
                    VerticalTextAlignment   = TextAlignment.Center,
                    FontAttributes          = FontAttributes.Bold,
                    FontSize = 16
                };
                label.SetBinding(Label.TextProperty, "Text");
                fLabel.Content = label;

                var image = new CachedImage
                {
                    Aspect = Aspect.AspectFill,
                };
                //image.SetBinding(CachedImage.SourceProperty, "Source");
                //frame.Content = image;

                return(layout);
            });

            var coverFlowLeft = new PanCardView.CoverFlowView
            {
                ItemTemplate      = itemTemplate,
                ViewPosition      = CoverItemPosition.Left,
                FirstItemPosition = CoverItemPosition.Left,
                Spacing           = 20,
                IsCyclical        = false
            };
            var coverFlowCentered = new PanCardView.CoverFlowView
            {
                ItemTemplate      = itemTemplate,
                ViewPosition      = CoverItemPosition.Center,
                FirstItemPosition = CoverItemPosition.Center,
                Spacing           = 20,
                IsCyclical        = true
            };
            var coverFlowRight = new PanCardView.CoverFlowView
            {
                ItemTemplate      = itemTemplate,
                ViewPosition      = CoverItemPosition.Left,
                FirstItemPosition = CoverItemPosition.Left,
                Spacing           = 20,
                IsCyclical        = true
            };

            coverFlowLeft.SetBinding(PanCardView.CoverFlowView.ItemsSourceProperty, nameof(CoverFlowViewModel.Items));
            coverFlowCentered.SetBinding(PanCardView.CoverFlowView.ItemsSourceProperty, nameof(CoverFlowViewModel.Items));
            coverFlowRight.SetBinding(PanCardView.CoverFlowView.ItemsSourceProperty, nameof(CoverFlowViewModel.Items));

            BackgroundColor = Color.Black;
            Title           = "CoverFlowView";

            var scrollView = new ScrollView()
            {
                Orientation       = ScrollOrientation.Vertical,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
            };
            var stack = new StackLayout
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                Spacing           = 5,
            };


            stack.Children.Add(new Label()
            {
                Text = "Simple List positionned on Left", TextColor = Color.White
            });
            stack.Children.Add(coverFlowLeft);
            stack.Children.Add(new Label()
            {
                Text = "Circular List positionned on Center", TextColor = Color.White
            });
            stack.Children.Add(coverFlowCentered);
            stack.Children.Add(new Label()
            {
                Text = "Cicular List positionned on Left", TextColor = Color.White
            });
            stack.Children.Add(coverFlowRight);

            scrollView.Content = stack;

            Content        = scrollView;
            BindingContext = new CoverFlowViewModel();
        }
Example #56
0
        void StartTestMT2()
        {
            var rand = new Random2(0);

            breakTest = false;

            var width  = absolute.Width;
            var height = absolute.Height;

            const int step = 75;

            var processed = 0;

            long   prevTicks     = 0;
            long   prevMs        = 0;
            int    prevProcessed = 0;
            double avgSum        = 0;
            int    avgN          = 0;
            var    sw            = new Stopwatch();

            var bankA = new Label[step];
            var bankB = new Label[step];

            Action <Label[]> addLabels = (Label[] labels) =>
            {
                for (int k = 0; k < step; k++)
                {
                    var label = new Label()
                    {
                        Text      = "Dope",
                        TextColor = new Color(rand.NextDouble(), rand.NextDouble(), rand.NextDouble()),
                        Rotation  = rand.NextDouble() * 360
                    };

                    AbsoluteLayout.SetLayoutFlags(label, AbsoluteLayoutFlags.PositionProportional);
                    AbsoluteLayout.SetLayoutBounds(label, new Rectangle(rand.NextDouble(), rand.NextDouble(), 80, 24));

                    labels[k] = label;
                }
            };

            addLabels(bankA);
            addLabels(bankB);

            var bank = bankA;

            Action loop = null;

            var  i    = 0;
            Task task = null;

            loop = () =>
            {
                if (breakTest)
                {
                    var avg = avgSum / avgN;
                    dopes.Text = string.Format("{0:0.00} Dopes/s (AVG)", avg).PadLeft(21);
                    return;
                }

                if (processed > max)
                {
                    absolute.Children.RemoveAt(0);
                }

                absolute.Children.Add(bank[i]);
                i++;

                if (i == step)
                {
                    if (task != null && task.Status != TaskStatus.RanToCompletion)
                    {
                        task.Wait();
                    }
                    task = Task.Run(() => addLabels(bank));
                    if (bank == bankA)
                    {
                        bank = bankB;
                    }
                    else
                    {
                        bank = bankA;
                    }
                    i = 0;
                }

                processed++;

                if (sw.ElapsedMilliseconds - prevMs > 500)
                {
                    var r = (double)(processed - prevProcessed) / ((double)(sw.ElapsedTicks - prevTicks) / Stopwatch.Frequency);
                    prevTicks     = sw.ElapsedTicks;
                    prevProcessed = processed;

                    if (processed > max)
                    {
                        dopes.Text = string.Format("{0:0.00} Dopes/s", r).PadLeft(15);
                        avgSum    += r;
                        avgN++;
                    }

                    prevMs = sw.ElapsedMilliseconds;
                }

                Device.BeginInvokeOnMainThread(loop);
            };

            sw.Start();


            Device.BeginInvokeOnMainThread(loop);
        }
Example #57
0
        public Callout(MapControl mapControl)
        {
            _mapControl = mapControl ?? throw new ArgumentNullException("MapControl shouldn't be null");

            // We want any drawing outside of the info window
            IsClippedToBounds = true;

            // Defaults
            base.BackgroundColor = Color.Transparent;
            base.Padding         = new Thickness(0);

            _background = new SKCanvasView
            {
                BackgroundColor = Color.Transparent,
            };

            _background.PaintSurface += HandlePaintSurface;

            AbsoluteLayout.SetLayoutBounds(_background, new Rectangle(0, 0, 1.0, 1.0));
            AbsoluteLayout.SetLayoutFlags(_background, AbsoluteLayoutFlags.SizeProportional);

            _grid = new Grid()
            {
                BackgroundColor = Color.Transparent,
                Margin          = Padding,
            };

            _grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            _grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(20, GridUnitType.Absolute)
            });

            _grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Auto)
            });
            _grid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });

            _grid.SizeChanged += GridSizeChanged;

            AbsoluteLayout.SetLayoutBounds(_grid, new Rectangle(0, 0, 1.0, 1.0));
            AbsoluteLayout.SetLayoutFlags(_grid, AbsoluteLayoutFlags.SizeProportional);

            _close = new Button
            {
                BackgroundColor   = Color.Transparent,
                WidthRequest      = 16,
                HeightRequest     = 16,
                HorizontalOptions = LayoutOptions.EndAndExpand,
                VerticalOptions   = LayoutOptions.StartAndExpand,
                Command           = new Command(() => CloseCalloutClicked(this, new EventArgs())),
            };

            _title = new Label
            {
                Text                    = string.Empty,
                LineBreakMode           = LineBreakMode.NoWrap,
                FontFamily              = "Arial",
                FontSize                = 16,
                FontAttributes          = FontAttributes.Bold,
                BackgroundColor         = Color.Transparent,
                HorizontalTextAlignment = TextAlignment.Start,
                VerticalTextAlignment   = TextAlignment.Start,
            };

            _subtitle = new Label
            {
                Text = string.Empty,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions   = LayoutOptions.Start,
                FontFamily        = "Arial",
                FontSize          = 10,
                FontAttributes    = FontAttributes.Bold,
                BackgroundColor   = Color.Transparent,
            };

            _grid.Children.Add(_close, 1, 0);
            _grid.Children.Add(_title, 0, 0);
            _grid.Children.Add(_subtitle, 0, 1);
            Grid.SetColumnSpan(_subtitle, 2);

            _content = new ContentView
            {
                IsVisible = false,
            };

            base.Content = new AbsoluteLayout
            {
                Children =
                {
                    _background,
                    _grid,
                    _content,
                }
            };

            var tapGestureRecognizer = new TapGestureRecognizer();

            tapGestureRecognizer.Tapped += (s, e) => HandleCalloutClicked(s, e);
            GestureRecognizers.Add(tapGestureRecognizer);

            SizeChanged += CalloutSizeChanged;

            UpdateGridSize();
            UpdatePath();
            UpdateMargin();
        }
Example #58
0
            public SvgListHeavyCell()
            {
                image1 = new SvgCachedImage()
                {
                    HorizontalOptions    = LayoutOptions.FillAndExpand,
                    HeightRequest        = 100,
                    DownsampleToViewSize = true,
                    Aspect = Aspect.AspectFill,
                    TransformPlaceholders = false,
                    LoadingPlaceholder    = "loading.png",
                    ErrorPlaceholder      = "error.png",
                };

                image2 = new SvgCachedImage()
                {
                    HorizontalOptions    = LayoutOptions.FillAndExpand,
                    HeightRequest        = 100,
                    DownsampleToViewSize = true,
                    Aspect = Aspect.AspectFill,
                    TransformPlaceholders = false,
                    LoadingPlaceholder    = "loading.png",
                    ErrorPlaceholder      = "error.png",
                };

                image3 = new SvgCachedImage()
                {
                    HorizontalOptions    = LayoutOptions.FillAndExpand,
                    HeightRequest        = 100,
                    DownsampleToViewSize = true,
                    Aspect = Aspect.AspectFill,
                    TransformPlaceholders = true,
                    LoadingPlaceholder    = "loading.png",
                    ErrorPlaceholder      = "error.png",
                };

                image4 = new SvgCachedImage()
                {
                    HorizontalOptions    = LayoutOptions.FillAndExpand,
                    HeightRequest        = 100,
                    DownsampleToViewSize = true,
                    Aspect = Aspect.AspectFill,
                    TransformPlaceholders = true,
                    LoadingPlaceholder    = "loading.png",
                    ErrorPlaceholder      = "error.png",
                };

                var root = new AbsoluteLayout()
                {
                    Padding = 5,
                };

                AbsoluteLayout.SetLayoutFlags(image1, AbsoluteLayoutFlags.All);
                AbsoluteLayout.SetLayoutBounds(image1, new Rectangle(0d, 0d, 0.25d, 1d));

                AbsoluteLayout.SetLayoutFlags(image2, AbsoluteLayoutFlags.All);
                AbsoluteLayout.SetLayoutBounds(image2, new Rectangle(0.25d / (1d - 0.25d), 0d, 0.25d, 1d));

                AbsoluteLayout.SetLayoutFlags(image3, AbsoluteLayoutFlags.All);
                AbsoluteLayout.SetLayoutBounds(image3, new Rectangle(0.50d / (1d - 0.25d), 0d, 0.25d, 1d));

                AbsoluteLayout.SetLayoutFlags(image4, AbsoluteLayoutFlags.All);
                AbsoluteLayout.SetLayoutBounds(image4, new Rectangle(0.75d / (1d - 0.25d), 0d, 0.25d, 1d));

                root.Children.Add(image1);
                root.Children.Add(image2);
                root.Children.Add(image3);
                root.Children.Add(image4);

                View = root;
            }
 public MineTransaction()
 {
     InitializeComponent();
     AbsoluteLayout.SetLayoutFlags(LoadingIndicator, AbsoluteLayoutFlags.PositionProportional);
     AbsoluteLayout.SetLayoutBounds(LoadingIndicator, new Rectangle(0.5, 0.5, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
 }
Example #60
0
        public void ToMainPage()
        {
            Children.Clear();

            cabinetSelectPage = new SingleSelectionPage(LocalStorageController.DeleteCabinetSynchronous, FireBaseController.DeleteCabinetSynchronous, ContentManager.StorageSelection.cabinet);
            fridgeSelectPage  = new SingleSelectionPage(LocalStorageController.DeleteFridgeSynchronous, FireBaseController.DeleteFridgeSynchronous, ContentManager.StorageSelection.fridge);
            unplacedPage      = new UnplacedPage(LocalStorageController.AddItem, FireBaseController.SaveItem, LocalStorageController.DeleteItem, FireBaseController.DeleteItem);

            // offset view from the top of IOS black box
            if (Device.RuntimePlatform == Device.iOS)
            {
                cabinetSelectPage.Content.AddEffect(new SafeAreaPadding());
            }
            cabinetSelectPage.Title = "Pantry";
            fridgeSelectPage.Title  = "Fridge";
            unplacedPage.Title      = "My Items";

            Children.Add(cabinetSelectPage);
            Children.Add(unplacedPage);
            Children.Add(fridgeSelectPage);
            navigationStack.Add(cabinetSelectPage, new List <string>());
            navigationStack.Add(fridgeSelectPage, new List <string>());
            navigationStack.Add(unplacedPage, new List <string>());
            navigationParams.Add(cabinetSelectPage, new List <List <object> >());
            navigationParams.Add(fridgeSelectPage, new List <List <object> >());
            navigationParams.Add(unplacedPage, new List <List <object> >());
            navigationStack[cabinetSelectPage].Add(single_selection_name);
            navigationParams[cabinetSelectPage].Add(new List <object>()
            {
            });
            navigationStack[fridgeSelectPage].Add(single_selection_name);
            navigationParams[fridgeSelectPage].Add(new List <object>()
            {
            });
            navigationStack[unplacedPage].Add(unplaced_page_name);
            navigationParams[unplacedPage].Add(new List <object>()
            {
            });

            currentPageContainer = (ContentPage)CurrentPage;
            currentPageContent   = ((IMainPage)CurrentPage).GetLayout();

            CurrentPageChanged += (o, a) =>
            {
                currentPageContainer = (ContentPage)CurrentPage;
                currentPageContent   = ((IMainPage)CurrentPage).GetLayout();
                RecordTabbedNavigationInfo();

                // offset view from the top of IOS black box
                if (Device.RuntimePlatform == Device.iOS)
                {
                    Console.WriteLine("PageController 157 inset set");
                    currentPageContent.AddEffect(new SafeAreaPadding());
                }

                // For Android only, resize and detect icon expiration
                resizeIconAction?.Invoke();
                Console.WriteLine("Pagecontroller 163 resize action is null " + (resizeIconAction == null));
            };
            OverwriteRootPage(this);
        }