コード例 #1
0
        void ShowBackgroundForPopup(Android.Graphics.Color color)
        {
            if (_popupBasePage == null)
            {
                return;
            }
            if (_popupRenderer == null)
            {
                return;
            }
            _backgroundOverlay = new global::Android.Widget.LinearLayout(Android.App.Application.Context);
            _pageRenderer.ViewGroup.AddView(_backgroundOverlay);
            _backgroundOverlay.SetBackgroundColor(color);

            _backgroundOverlay.Touch -= HidePopup;
            _backgroundOverlay.Touch += HidePopup;

            var metrics = _pageRenderer.Resources.DisplayMetrics;

            _backgroundOverlay.Layout(
                0,
                0,
                (int)(ScreenSizeHelper.ScreenWidth * metrics.Density),
                (int)(ScreenSizeHelper.ScreenHeight * metrics.Density));
        }
コード例 #2
0
        void ShowBackgroundOverlay (double alpha)
        {
            if (_basePage == null)
                return;
            var menu = _basePage.SlideMenu;
            if (menu == null)
                return;

            double value = (double)(alpha * _basePage.SlideMenu.BackgroundViewColor.A);
            if (_backgroundOverlay != null) {
                var color = _basePage.SlideMenu.BackgroundViewColor.ToAndroid ();
                color.A = (Byte)(255 * value);
                _backgroundOverlay.SetBackgroundColor (color);
                return;
            }
            _backgroundOverlay = new global::Android.Widget.LinearLayout (Android.App.Application.Context);
            _pageRenderer.ViewGroup.AddView (_backgroundOverlay);
            _backgroundOverlay.SetBackgroundColor (_basePage.SlideMenu.BackgroundViewColor.ToAndroid ());

            _backgroundOverlay.Touch -= HideMenu;
            _backgroundOverlay.Touch += HideMenu;
            var metrics = _pageRenderer.Resources.DisplayMetrics;
            _backgroundOverlay.Layout (
                0,
                0,
                (int)(ScreenSizeHelper.ScreenWidth * metrics.Density),
                (int)(ScreenSizeHelper.ScreenHeight * metrics.Density));

        }
コード例 #3
0
        void ShowBackgroundForPopup(Android.Graphics.Color color)
        {
            if (_popupBasePage == null)
            {
                return;
            }
            if (_popupRenderer == null)
            {
                return;
            }
            _backgroundOverlay = new global::Android.Widget.LinearLayout(Forms.Context);
            _pageRenderer.ViewGroup.AddView(_backgroundOverlay);
            _backgroundOverlay.SetBackgroundColor(color);

            _backgroundOverlay.Touch += (object sender, Android.Views.View.TouchEventArgs e) => {
                _popupBasePage.HidePopupAction();
            };
            var metrics = _pageRenderer.Resources.DisplayMetrics;

            _backgroundOverlay.Layout(
                0,
                0,
                (int)(ScreenSizeHelper.ScreenWidth * metrics.Density),
                (int)(ScreenSizeHelper.ScreenHeight * metrics.Density));
        }
コード例 #4
0
        void ShowBackgroundOverlay(double alpha)
        {
            if (_basePage == null)
                return;
            var menu = _basePage.SlideMenu;
            if (menu == null)
                return;

            double value = (double)(alpha * _basePage.SlideMenu.BackgroundViewColor.A);
            if (_backgroundOverlay != null) {
                var color = _basePage.SlideMenu.BackgroundViewColor.ToAndroid ();
                color.A = (Byte)(255 * value);
                _backgroundOverlay.SetBackgroundColor (color);
                return;
            }
            _backgroundOverlay = new global::Android.Widget.LinearLayout (Forms.Context);
            _pageRenderer.ViewGroup.AddView (_backgroundOverlay);
            _backgroundOverlay.SetBackgroundColor (_basePage.SlideMenu.BackgroundViewColor.ToAndroid ());

            _backgroundOverlay.Touch += (object sender, Android.Views.View.TouchEventArgs e) => {
                _basePage.HideMenuAction ();
            };
            var metrics = _pageRenderer.Resources.DisplayMetrics;
            _backgroundOverlay.Layout (
                0,
                0,
                (int)(ScreenSizeHelper.ScreenWidth * metrics.Density),
                (int)(ScreenSizeHelper.ScreenHeight * metrics.Density));
        }