コード例 #1
0
ファイル: BorderWindow.cs プロジェクト: hinohie/TizenFX
        /// Create the border UI.
        private bool CreateBorder()
        {
            rootView = new View()
            {
                WidthResizePolicy  = ResizePolicyType.FillToParent,
                HeightResizePolicy = ResizePolicyType.FillToParent,
                BackgroundColor    = Color.Transparent,
            };

            // Gets the Border's UI.
            borderInterface.CreateBorderView(rootView);
            if (rootView == null)
            {
                return(false);
            }
            else
            {
                if (borderInterface.OverlayMode == true)
                {
                    rootView.InterceptTouchEvent += OverlayInterceptTouch;
                }
                // Add a view to the border layer.
                GetBorderWindowBottomLayer().Add(rootView);

                return(true);
            }
        }
コード例 #2
0
ファイル: BorderWindow.cs プロジェクト: wonrst/TizenFX
        /// Create the border UI.
        private bool CreateBorder()
        {
            rootView = new View()
            {
                WidthResizePolicy  = ResizePolicyType.FillToParent,
                HeightResizePolicy = ResizePolicyType.FillToParent,
                BackgroundColor    = Color.Transparent,
            };

            ushort padding = (ushort)borderInterface.BorderLineThickness;

            borderView = new View()
            {
                GrabTouchAfterLeave = true,
                WidthResizePolicy   = ResizePolicyType.FillToParent,
                HeightResizePolicy  = ResizePolicyType.FillToParent,
                BackgroundColor     = Color.Transparent,
                Layout = new LinearLayout()
                {
                    LinearOrientation = LinearLayout.Orientation.Vertical,
                    LinearAlignment   = LinearLayout.Alignment.Top
                },
                Padding = new Extents(padding, padding, padding, padding),
            };
            borderInterface.CreateBorderView(borderView);

            topView = new View()
            {
                WidthSpecification = LayoutParamPolicies.MatchParent,
                SizeHeight         = borderInterface.BorderHeight,
                BackgroundColor    = Color.Transparent,
            };

            contentsView = new View()
            {
                BackgroundColor    = Color.Transparent,
                WidthSpecification = LayoutParamPolicies.MatchParent,
            };

            bottomView = new View()
            {
                WidthSpecification = LayoutParamPolicies.MatchParent,
                SizeHeight         = borderInterface.BorderHeight,
                BackgroundColor    = Color.Transparent,
            };

            // // Gets the Border's UI.
            if (borderInterface.CreateTopBorderView(topView) == true && topView != null)
            {
                borderView.Add(topView);
                isTop = true;
            }
            borderView.Add(contentsView);
            if (borderInterface.CreateBottomBorderView(bottomView) == true && bottomView != null)
            {
                borderView.Add(bottomView);
                isBottom = true;
            }
            rootView.Add(borderView);

            return(isTop || isBottom);
        }