コード例 #1
0
        public Toolbar(bool isTemplateFolder)
        {
            this.isTemplateFolder = isTemplateFolder;

            BackgroundColor = Colors.CartoNavy;

            ExpandButton = new ExpandButton();

            Tabs           = new FileTabs();
            Tabs.IsVisible = false;

            double padding = 5;

            SaveButton              = new ToolbarButton();
            SaveButton.Source       = "icon_save.png";
            SaveButton.ImagePadding = padding;

            EmailButton              = new ToolbarButton();
            EmailButton.Source       = "icon_email.png";
            EmailButton.ImagePadding = padding;

            UploadButton              = new ToolbarButton();
            UploadButton.Source       = "icon_upload.png";
            UploadButton.ImagePadding = padding;

            Overlay = new BaseView();
            Overlay.BackgroundColor = Colors.CartoNavyTransparent;
            HideOverlay(false);
        }
コード例 #2
0
        public void ToggleTabs()
        {
            bool willExpand = FileTabs.Toggle();

            if (willExpand)
            {
                Toolbar.ExpandButton.UpdateText(FileTabs.CurrentHighlight);
            }

            Toolbar.ExpandButton.UpdateImage();
        }
コード例 #3
0
        public override void LayoutSubviews()
        {
            base.LayoutSubviews();

            bool isSmall = DeviceInfo.IsSmallScreen;

            if (isSmall)
            {
                MapView.IsRefreshButtonVisibile = false;
                AddSubview(MapView, 0, 0, Width, Height);
                return;
            }

            toolbarHeight = 60;

            double x   = 0;
            double y   = 0;
            double w   = Width;
            double h   = toolbarHeight;
            double min = 50;

            if (h < min)
            {
                h = min;
            }

            AddSubview(Toolbar, x, y, w, h);

            double mapWidth  = Width / 3 * 1.9;
            double mapHeight = Height - h;

            y += h;
            w  = mapWidth;
            h  = mapHeight;

            AddSubview(MapView, x, y, w, h);

            x += w;
            w  = Width - w;
            AddSubview(Editor, x, y, w, h);

            if (Data != null)
            {
                double rowCount  = Math.Ceiling((double)Data.DecompressedFiles.Count / 3);
                double rowHeight = Toolbar.Height;

                h = rowCount * rowHeight;
                w = Width / 3;
                x = Width - w;
                y = rowHeight;

                FileTabs.RowCount = rowCount;

                if (Data.StyleFileNames.Count > Toolbar.MaxCount)
                {
                    //FileTabs.Show();
                    AddSubview(FileTabs, x, y, w, h);
                }

                Editor.Initialize(Data);
                Toolbar.Initialize(Data);
                FileTabs.Initialize(Data);
            }

            AddSubview(GithubUpload, 0, 0, Width, Height);

#if __UWP__
            double zoomPadding = 15;
            w = mapWidth / 5;
            h = w / 3;
            x = mapWidth - (w + zoomPadding);
            y = Height - (h + zoomPadding);

            AddSubview(Zoom, x, y, w, h);
#endif
        }