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

            base.OnCreate(bundle);

            // Set Status Bar Color
            Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);
            Window.SetStatusBarColor(Color.Black);

            //// FFImageLoading
            //CachedImageRenderer.Init();

            //// AudioService setup
            Instance = this;
            System.Threading.Tasks.Task.Run(() =>
            {
                AudioServiceIntent = new Intent(Droid.Audio.AudioService.ActionStart);
                ComponentName name = StartService(AudioServiceIntent);
                _connection        = new AudioServiceConnection(this);
                bool binded        = BindService(AudioServiceIntent, _connection, Bind.AutoCreate);
            });


            //global::Xamarin.Forms.Forms.Init(this, bundle);

            //// FlowListView
            //FlowListView.Init();

            LoadApplication(new App());
        }
Beispiel #2
0
                public override void OnCreate(Bundle savedInstanceState)
                {
                    base.OnCreate(savedInstanceState);

                    Rock.Mobile.Util.Debug.WriteLine("OnCreate - Starting Audio Service");

                    // flag that we want to automatically start the audio.
                    // If this fragment is backgrounded and resumed, this will be false and we won't
                    // attempt to play a second time.
                    PlayerState = MediaPlayerState.WantsAutoplay;

                    // start our audio service
                    Activity.StartService(new Intent(Activity, typeof(AudioService)));

                    // create our connector that manages the interface between us and the service
                    AudioServiceConnection = new AudioServiceConnection(this);
                }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            //Window.SetFlags(WindowManagerFlags.LayoutNoLimits, WindowManagerFlags.LayoutNoLimits);
            global::Xamarin.Forms.Forms.SetFlags("SwipeView_Experimental");
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

            //// AudioService setup
            Instance = this;
            System.Threading.Tasks.Task.Run(() =>
            {
                AudioServiceIntent = new Intent(Droid.Audio.AudioService.ActionStart);
                ComponentName name = StartService(AudioServiceIntent);
                _connection        = new AudioServiceConnection(this);
                bool binded        = BindService(AudioServiceIntent, _connection, Bind.AutoCreate);
            });
            LoadApplication(new App());
        }
                public override void OnCreate( Bundle savedInstanceState )
                {
                    base.OnCreate( savedInstanceState );

                    Rock.Mobile.Util.Debug.WriteLine( "OnCreate - Starting Audio Service" );

                    // flag that we want to automatically start the audio.
                    // If this fragment is backgrounded and resumed, this will be false and we won't
                    // attempt to play a second time.
                    PlayerState = MediaPlayerState.WantsAutoplay;

                    // start our audio service
                    Activity.StartService( new Intent( Activity, typeof( AudioService ) ) );

                    // create our connector that manages the interface between us and the service
                    AudioServiceConnection = new AudioServiceConnection( this );
                }
Beispiel #5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);
            //    Download("Songs", null);
            // Set Status Bar Color
            Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);
            // Window.SetStatusBarColor(Android.Graphics.Color.Black);
            notificationManager = NotificationManagerCompat.From(this);



            mediaSession = new MediaSessionCompat(this, "tag");

            // CarouselViewRenderer.();

            CachedImageRenderer.Init(true);
            //  RegisterReceiver(savedInstanceState, new IntentFilter("com.companyname.IncomingCall"));

            //// FFImageLoading
            //CachedImageRenderer.Init();

            //// AudioService setup
            Instance = this;
            System.Threading.Tasks.Task.Run(() =>
            {
                Intent AudioServiceIntent = new Intent(this, typeof(AudioService));
                this.StartService(AudioServiceIntent);
                _connection = new AudioServiceConnection(this);
                bool binded = BindService(AudioServiceIntent, _connection, Bind.AutoCreate);
            });


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

            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, savedInstanceState);

            //// FlowListView
            FlowListView.Init();

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

            if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.ReadExternalStorage) != Permission.Granted || ContextCompat.CheckSelfPermission(this, Manifest.Permission.ReadPhoneState) != Permission.Granted)
            {
                // We have permission, go ahead and use the camera.
                if (ActivityCompat.ShouldShowRequestPermissionRationale(activity: this, Manifest.Permission.ReadExternalStorage) ||
                    ActivityCompat.ShouldShowRequestPermissionRationale(activity: this, Manifest.Permission.ReadPhoneState))
                {
                    ActivityCompat.RequestPermissions(activity: this, new String[] { Manifest.Permission.ReadExternalStorage, Manifest.Permission.WriteExternalStorage, Manifest.Permission.ReadPhoneState }, STORAGE_PERMISSION_CODE);
                }

                else
                {
                    ActivityCompat.RequestPermissions(activity: this, new String[] { Manifest.Permission.ReadExternalStorage, Manifest.Permission.WriteExternalStorage, Manifest.Permission.ReadPhoneState }, STORAGE_PERMISSION_CODE);
                }
            }
            else
            {
                if (ActivityCompat.ShouldShowRequestPermissionRationale(activity: this, Manifest.Permission.ReadExternalStorage) ||
                    ActivityCompat.ShouldShowRequestPermissionRationale(activity: this, Manifest.Permission.ReadPhoneState))
                {
                    ActivityCompat.RequestPermissions(activity: this, new String[] { Manifest.Permission.ReadExternalStorage, Manifest.Permission.WriteExternalStorage, Manifest.Permission.ReadExternalStorage }, STORAGE_PERMISSION_CODE);
                }
                else
                {
                    ActivityCompat.RequestPermissions(activity: this, new String[] { Manifest.Permission.ReadExternalStorage, Manifest.Permission.ReadPhoneState }, STORAGE_PERMISSION_CODE);
                }
            }
            LoadApplication(new App());
        }