Exemple #1
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(new App());


            Window.SetSoftInputMode(SoftInput.AdjustResize);
            if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
            {
                // Bug in Android 5+, this is an adequate workaround
                AndroidBug5497WorkaroundForXamarinAndroid.assistActivity(this, WindowManager);
            }
        }
Exemple #2
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            Window.SetSoftInputMode(Android.Views.SoftInput.AdjustResize);
            AndroidBug5497WorkaroundForXamarinAndroid.assistActivity(this);

            Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, bundle);

            Forms.SetFlags("FastRenderers_Experimental");
            Forms.Init(this, bundle);

            Calendar.Plugin.Platforms.Android.Calendar.Init();
            CarouselView.FormsPlugin.Android.CarouselViewRenderer.Init();

            // Init Dialogs
            Acr.UserDialogs.UserDialogs.Init(this);

            // Init Barcode Scanner
            ZXing.Net.Mobile.Forms.Android.Platform.Init();
            ZXing.Mobile.MobileBarcodeScanner.Initialize(Application);

            // Init Image Plugins
            FFImageLoading.Forms.Platform.CachedImageRenderer.Init(enableFastRenderer: true);
            ImageCircle.Forms.Plugin.Droid.ImageCircleRenderer.Init();
            Stormlion.ImageCropper.Droid.Platform.Init();

            // Init GoogleMaps
            Xamarin.FormsGoogleMaps.Init(this, bundle, new Xamarin.Forms.GoogleMaps.Android.PlatformConfig
            {
                BitmapDescriptorFactory = new CachingNativeBitmapDescriptorFactory()
            });

            LoadApplication(new App());

            //Xamarin.Forms.Application.Current.On<Xamarin.Forms.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize);
        }
Exemple #3
0
 private void AndroidSetSoftInputMode(bool adjustResize)
 {
     Window.SetSoftInputMode(adjustResize ? Android.Views.SoftInput.AdjustResize : Android.Views.SoftInput.AdjustNothing);
     AndroidBug5497WorkaroundForXamarinAndroid.assistActivity(this);
 }