private static void CalculateDisplayHeight()
        {
            Rect r = new Rect();

            _childOfContent.GetWindowVisibleDisplayFrame(r);
            int visibleheight = r.Height();

            _displayheight     = _childOfContent.RootView.Height;
            _extrascreenheight = _displayheight - visibleheight;
        }
        private static void CalculateDisplayHeight()
        {
            var r = new Rect();

            childOfContent.GetWindowVisibleDisplayFrame(r);
            var visibleheight = r.Height();

            displayheight     = childOfContent.RootView.Height;
            extrascreenheight = displayheight - visibleheight;
        }
示例#3
0
        private int computeUsableHeight()
        {
            Rect r = new Rect();

            mChildOfContent.GetWindowVisibleDisplayFrame(r);
            return(r.Bottom - r.Top);
        }
示例#4
0
 private int computeUsableHeight()
 {
     Android.Graphics.Rect r = new Android.Graphics.Rect();
     mChildOfContent.GetWindowVisibleDisplayFrame(r);
     if (Build.VERSION.SdkInt < BuildVersionCodes.Lollipop)
     {
         return(r.Bottom - r.Top);
     }
     return(r.Bottom);
 }
示例#5
0
        protected override void OnCreate(Bundle bundle)
        {
            AppCenter.Start("9c1f248c-5434-458f-9c4c-f69b39722c1f", typeof(Analytics), typeof(Crashes));

            BitExceptionHandler.Current = new SanaapExceptionHandler();

            UserDialogs.Init(this);

            base.OnCreate(bundle);

            FFImageLoading.Forms.Platform.CachedImageRenderer.Init(false);

            UseDefaultConfiguration(bundle);

            Xamarin.Essentials.Platform.Init(this, bundle);

            CrossCurrentActivity.Current.Init(this, bundle);

            FormsGoogleMaps.Init(this, bundle);

            BitCSharpClientControls.Init();

            Forms.Init(this, bundle);

            CarouselViewRenderer.Init();

            ImageCircleRenderer.Init();

            Rg.Plugins.Popup.Popup.Init(this, bundle);

            LoadApplication(new App(new SanaapAppDroidInitializer(this)));

            //Xamarin.Forms.Application.Current.On<Xamarin.Forms.PlatformConfiguration.Android>()
            //    .UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize);

            Android.Views.View root = FindViewById(Android.Resource.Id.Content);
            Rect r = new Rect();

            {
                root.GetWindowVisibleDisplayFrame(r);
            }

            root.ViewTreeObserver.GlobalFocusChange += ViewTreeObserver_GlobalFocusChange;
            root.ViewTreeObserver.GlobalLayout      += (object sender, EventArgs e) =>
            {
                Rect r2 = new Rect();
                root.GetWindowVisibleDisplayFrame(r2);

                int keyboardHeight = r2.Height();

                root.ScrollTo(0, 20);

                if (clickYPosition > keyboardHeight)
                {
                    root.ScrollTo(0, clickYPosition - keyboardHeight + 30);
                }
                else
                {
                    root.ScrollTo(0, 0);
                }
            };
        }