//
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();

            GAService.GetGASInstance().Initialize_NativeGAS();

            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            GAService.GetGASInstance().Initialize_NativeGAS(this);
            LoadApplication(new App());
        }
Exemplo n.º 3
0
    void Start()
    {
        segmentDetector = gameObject.GetComponent <SegmentDetector>();       // TODO: refactor code.
        GAService       = (GAService)gameObject.GetComponent <GAService>();  // NOTE: GAService component belongs to AIController.
        GAService.setNumSeg(NUM_SEGMENT);
        GAService.setPopulationSize(POPULATION_SIZE);
        GAService.setChromosomesSize(CHROMOSOMES_SIZE);

        initPopulation();
        spawn();
        car.SetActive(false);         // NOTE: hide (deactivate) based individual.
    }
Exemplo n.º 4
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);

            View view  = this.BindingInflate(Resource.Layout.ImportNetease, null);
            var  prefs = Application.Context.GetSharedPreferences("Fildo", FileCreationMode.Private);

            this.cultureInfo = ((MainView)this.Activity).CultureInfo;
            if (!string.IsNullOrEmpty(((BaseViewModel)((MainView)this.Activity).ViewModel).PlayingArtist))
            {
                ((MainView)this.Activity).FindViewById <LinearLayout>(Resource.Id.miniPlayer).Visibility =
                    ViewStates.Visible;
            }
            string hash   = prefs.GetString("UserHash", string.Empty);
            string idUser = prefs.GetString("IdUser", string.Empty);

            ((ImportNeteaseViewModel)this.ViewModel).Hash   = hash;
            ((ImportNeteaseViewModel)this.ViewModel).IdUser = idUser;
            if (!string.IsNullOrEmpty(hash))
            {
                LinearLayout hashash = view.FindViewById <LinearLayout>(Resource.Id.hashash);
                LinearLayout nohash  = view.FindViewById <LinearLayout>(Resource.Id.nohash);
                hashash.Visibility = ViewStates.Visible;
                nohash.Visibility  = ViewStates.Gone;
            }
            //toolbar = view.FindViewById<Toolbar>(Resource.Id.toolbar);

            //textView1
            if (this.ViewModel != null)
            {
                view.FindViewById <TextView>(Resource.Id.textView1).Text =
                    ((BaseViewModel)this.ViewModel).GetString("LoginBeforeImport", this.cultureInfo);
                view.FindViewById <TextView>(Resource.Id.importNetease).Text =
                    ((BaseViewModel)this.ViewModel).GetString("ImportNetease", this.cultureInfo);
            }

            /*view.SetSupportActionBar(toolbar);
             * view.SupportActionBar.SetDisplayHomeAsUpEnabled(true);
             * view.SupportActionBar.SetHomeButtonEnabled(true);
             */
            this.progress = new BindableProgress(view.Context, this.ViewModel);

            var set = this.CreateBindingSet <ImportNeteaseView, ImportNeteaseViewModel>();

            set.Bind(this.progress).For(p => p.Visible).To(vm => vm.IsBusy);
            set.Bind(this.progress).For(p => p.NoInternet).To(vm => vm.NoInternet);
            set.Apply();
            GAService.GetGASInstance().Track_App_Page("Import Netease");
            return(view);
        }
Exemplo n.º 5
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);

            View view = this.BindingInflate(Resource.Layout.LoginLayout, null);

            var prefs = Application.Context.GetSharedPreferences("Fildo", FileCreationMode.Private);

            this.cultureInfo = ((MainView)this.Activity).CultureInfo;
            if (!string.IsNullOrEmpty(((BaseViewModel)((MainView)this.Activity).ViewModel).PlayingArtist))
            {
                ((MainView)this.Activity).FindViewById <Android.Widget.LinearLayout>(Resource.Id.miniPlayer).Visibility = ViewStates.Visible;
            }
            this.progress = new Bindables.BindableProgress(view.Context, this.ViewModel);

            var set = this.CreateBindingSet <LoginView, LoginViewModel>();

            set.Bind(this.progress).For(p => p.Visible).To(vm => vm.IsBusy);
            set.Bind(this.progress).For(p => p.NoInternet).To(vm => vm.NoInternet);
            set.Bind(this).For(p => p.Logged).To(vm => vm.Logged);
            set.Apply();

            this.username = view.FindViewById <Android.Widget.EditText>(Resource.Id.UsernameEditText);
            this.password = view.FindViewById <Android.Widget.EditText>(Resource.Id.PasswordEditText);

            this.username.Text = prefs.GetString("Username", string.Empty);
            this.password.Text = prefs.GetString("Password", string.Empty);

            if (this.ViewModel != null)
            {
                view.FindViewById <Android.Widget.TextView>(Resource.Id.loginText).Text = ((BaseViewModel)this.ViewModel).GetString("LoginText", this.cultureInfo);
            }

            if (!string.IsNullOrEmpty(this.username.Text) && !string.IsNullOrEmpty(this.password.Text))
            {
                ((LoginViewModel)this.ViewModel).DoLogin();
                GAService.GetGASInstance().Track_App_Page("My Playlists");
                return(this.BindingInflate(Resource.Layout.EmptyLayout, null));
            }

            GAService.GetGASInstance().Track_App_Page("Login");

            return(view);
        }
Exemplo n.º 6
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);

            View view = this.BindingInflate(Resource.Layout.ListPlaylists, null);

            if (!string.IsNullOrEmpty(((BaseViewModel)((MainView)this.Activity).ViewModel).PlayingArtist))
            {
                ((MainView)this.Activity).FindViewById <Android.Widget.LinearLayout>(Resource.Id.miniPlayer).Visibility = ViewStates.Visible;
            }
            this.progress = new Bindables.BindableProgress(view.Context, this.ViewModel);

            var set = this.CreateBindingSet <ListView, ListViewModel>();

            set.Bind(this.progress).For(p => p.Visible).To(vm => vm.IsBusy);
            set.Apply();
            GAService.GetGASInstance().Track_App_Page("Playlists");
            return(view);
        }
Exemplo n.º 7
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);

            View view = this.BindingInflate(Resource.Layout.AutoCompleteResultsView, null);

            if (!string.IsNullOrEmpty(((BaseViewModel)((MainView)this.Activity).ViewModel).PlayingArtist))
            {
                ((MainView)this.Activity).FindViewById <Android.Widget.LinearLayout>(Resource.Id.miniPlayer).Visibility = ViewStates.Visible;
            }

            this.ntResults    = view.FindViewById <MvxRecyclerView>(Resource.Id.ntresults);
            this.vkResults    = view.FindViewById <MvxRecyclerView>(Resource.Id.vkresults);
            this.qqResults    = view.FindViewById <MvxRecyclerView>(Resource.Id.qqresults);
            this.xiamiResults = view.FindViewById <MvxRecyclerView>(Resource.Id.xiamiresults);

            this.ntResults.Visibility = ViewStates.Visible;
            this.vkResults.Visibility = ViewStates.Gone;
            this.qqResults.Visibility = ViewStates.Gone;

            TabLayout tabs = view.FindViewById <TabLayout>(Resource.Id.tabs);

            tabs.Visibility = ViewStates.Visible;
            tabs.AddTab(tabs.NewTab().SetText("NETEASE"));
            tabs.AddTab(tabs.NewTab().SetText("HUAWEI"));
            tabs.AddTab(tabs.NewTab().SetText("VK"));
            tabs.AddTab(tabs.NewTab().SetText("QQMUSIC"));
            tabs.TabSelected += this.Tabs_TabSelected;

            this.progress         = new BindableProgress(view.Context, this.ViewModel);
            this.popup            = new BindablePopup(view.Context, this.ViewModel, view, this.Activity);
            this.popup.Dismissed += Popup_Dismissed;
            var set = this.CreateBindingSet <SearchResultView, SearchResultViewModel>();

            set.Bind(this.progress).For(p => p.Visible).To(vm => vm.IsBusy);
            set.Bind(this.popup).For(p => p.Visible).To(vm => vm.ShowCaptcha);
            set.Bind(this.popup).For(p => p.CaptchaUrl).To(vm => vm.CaptchaUrl);

            set.Apply();
            GAService.GetGASInstance().Track_App_Page("Results");
            return(view);
        }
Exemplo n.º 8
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);

            View view = this.BindingInflate(Resource.Layout.RegisterLayout, null);

            var prefs = Application.Context.GetSharedPreferences("Fildo", FileCreationMode.Private);

            this.cultureInfo = ((MainView)this.Activity).CultureInfo;

            if (!string.IsNullOrEmpty(((BaseViewModel)((MainView)this.Activity).ViewModel).PlayingArtist))
            {
                ((MainView)this.Activity).FindViewById <Android.Widget.LinearLayout>(Resource.Id.miniPlayer).Visibility = ViewStates.Visible;
            }
            this.progress = new Bindables.BindableProgress(view.Context, this.ViewModel);

            var set = this.CreateBindingSet <RegisterView, RegisterViewModel>();

            set.Bind(this.progress).For(p => p.Visible).To(vm => vm.IsBusy);
            set.Bind(this.progress).For(p => p.NoInternet).To(vm => vm.NoInternet);
            set.Apply();
            GAService.GetGASInstance().Track_App_Page("Register");
            return(view);
        }
Exemplo n.º 9
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);

            View view = this.BindingInflate(Resource.Layout.PlayerQueue, null);

            var prefs = Application.Context.GetSharedPreferences("Fildo", FileCreationMode.Private);

            this.cultureInfo = ((MainView)this.Activity).CultureInfo;

            this.Lyrics = new Dictionary <double, string>();

            this.playpause      = view.FindViewById <ToggleButton>(Resource.Id.btnPlayPause);
            this.btnNext        = view.FindViewById <AppCompatImageButton>(Resource.Id.btnNext);
            this.btnPrev        = view.FindViewById <AppCompatImageButton>(Resource.Id.btnPrevious);
            this.shuffle        = view.FindViewById <ToggleButton>(Resource.Id.btnShuffle);
            this.repeat         = view.FindViewById <ToggleButton>(Resource.Id.btnRepeat);
            this.playingSong    = view.FindViewById <TextView>(Resource.Id.playingSong);
            this.lyricScroll    = view.FindViewById <NestedScrollView>(Resource.Id.lyricScroll);
            this.lyricContainer = view.FindViewById <TextView>(Resource.Id.lyricContainer);
            this.listQueue      = view.FindViewById <MvxRecyclerView>(Resource.Id.listQueue);

            ((MainView)this.Activity).FindViewById <LinearLayout>(Resource.Id.miniPlayer).Visibility = ViewStates.Gone;
            this.lyricScroll.Visibility = ViewStates.Gone;

            BackgroundStreamingService.posChanged     -= this.BackgroundStreamingService_posChanged;
            BackgroundStreamingService.percentChanged -= this.BackgroundStreamingService_percentChanged;
            BackgroundStreamingService.posChanged     += this.BackgroundStreamingService_posChanged;
            BackgroundStreamingService.percentChanged += this.BackgroundStreamingService_percentChanged;
            if (BackgroundStreamingService.Player == null)
            {
                this.playpause.Checked = false;
                this.shuffle.Checked   = false;
                this.repeat.Checked    = false;
            }
            else
            {
                try
                {
                    BackgroundStreamingService.SongNameChanged -= this.BackgroundStreamingService_SongName;
                    BackgroundStreamingService.SongNameChanged += this.BackgroundStreamingService_SongName;
                }
                catch (Exception)
                {
                }
                this.playingSong.Text = BackgroundStreamingService.SongName;
                this.SetLyric();
                if (BackgroundStreamingService.Player.PlayWhenReady)
                {
                    this.playpause.Checked = true;
                }
                if (BackgroundStreamingService.IsRepeat)
                {
                    this.repeat.Checked = true;
                }
                if (BackgroundStreamingService.IsShuffle)
                {
                    this.shuffle.Checked = true;
                }
            }

            this.playpause.CheckedChange += this.Playpause_CheckedChange;
            this.btnNext.Click           += this.BtnNext_Click;
            this.btnPrev.Click           += this.BtnPrev_Click;
            this.shuffle.CheckedChange   += this.Shuffle_CheckedChange;
            this.repeat.CheckedChange    += this.Repeat_CheckedChange;

            TabLayout tabs = view.FindViewById <TabLayout>(Resource.Id.tabs);

            tabs.Visibility = ViewStates.Visible;
            tabs.AddTab(tabs.NewTab().SetText("QUEUE"));
            tabs.AddTab(tabs.NewTab().SetText("LYRICS"));
            tabs.TabSelected += this.Tabs_TabSelected;

            if (this.ViewModel != null)
            {
            }
            else
            {
            }

            this.progress = new BindableProgress(view.Context, this.ViewModel);

            var set = this.CreateBindingSet <PlayerView, PlayerViewModel>();

            set.Bind(this.progress).For(p => p.Visible).To(vm => vm.IsBusy);
            set.Apply();
            this.SetHasOptionsMenu(true);
            AppCompatSeekBar seekbar = view.FindViewById <AppCompatSeekBar>(Resource.Id.seekBar);

            seekbar.ProgressChanged += this.Seekbar_ProgressChanged;

            GAService.GetGASInstance().Track_App_Page("Player");

            return(view);
        }
Exemplo n.º 10
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);

            View view = this.BindingInflate(Resource.Layout.ListSong, null);

            var prefs = Application.Context.GetSharedPreferences("Fildo", FileCreationMode.Private);

            this.cultureInfo = ((MainView)this.Activity).CultureInfo;

            if (!string.IsNullOrEmpty(((BaseViewModel)((MainView)this.Activity).ViewModel).PlayingArtist))
            {
                ((MainView)this.Activity).FindViewById <Android.Widget.LinearLayout>(Resource.Id.miniPlayer).Visibility = ViewStates.Visible;
            }
            //AndroidEnvironment.UnhandledExceptionRaiser -= HandleAndroidException;
            //AndroidEnvironment.UnhandledExceptionRaiser += HandleAndroidException;
            TabLayout tabs = view.FindViewById <TabLayout>(Resource.Id.tabs);

            if (this.ViewModel != null)
            {
                ((BaseViewModel)((MainView)this.Activity).ViewModel).PicUrl = ((ListSongViewModel)this.ViewModel).PicUrl;
                string image = ((ListSongViewModel)this.ViewModel).PicUrl;
                ((MainView)this.Activity).FindViewById <MvxImageView>(Resource.Id.artistImageTest).ImageUrl = image;
                ListSongViewModel listSongViewModel = (ListSongViewModel)this.ViewModel;
                if (listSongViewModel.IsArtist)
                {
                    tabs.Visibility = ViewStates.Visible;
                    tabs.AddTab(tabs.NewTab().SetText("SONGS"));
                    tabs.AddTab(tabs.NewTab().SetText("ALBUMS"));
                    tabs.AddTab(tabs.NewTab().SetText("SIMILAR"));
                    tabs.TabSelected += this.Tabs_TabSelected;
                }
                else
                {
                    tabs.Visibility = ViewStates.Gone;
                }
            }

            AppBarLayout            appBarLayout            = ((MainView)this.Activity).FindViewById <AppBarLayout>(Resource.Id.appbar);
            CollapsingToolbarLayout collapsingToolbarLayout = ((MainView)this.Activity).FindViewById <CollapsingToolbarLayout>(Resource.Id.collapsing_toolbar);
            float density = this.Resources.DisplayMetrics.Density;

            float heightDp = 200 * density;

            CoordinatorLayout.LayoutParams lp = (CoordinatorLayout.LayoutParams)appBarLayout.LayoutParameters;
            lp.Height = (int)heightDp;
            appBarLayout.SetExpanded(true);


            //this.fab = FindViewById<FloatingActionButton>(Resource.Id.fab);

            //var collapsibleToolbar = FindViewById<CollapsingToolbarLayout>(Resource.Id.collapsing_toolbar);
            this.SetHasOptionsMenu(true);
            this.progress = new Bindables.BindableProgress(view.Context, this.ViewModel);
            var set = this.CreateBindingSet <ListSongView, ListSongViewModel>();

            set.Bind(this.progress).For(p => p.Visible).To(vm => vm.IsBusy);
            set.Bind(collapsingToolbarLayout).For(p => p.Title).To(vm => vm.TitleView);

            //set.Bind(collapsibleToolbar).For(p => p.Title).To(vm => vm.TitleView);
            set.Apply();

            this.songList               = view.FindViewById <MvxRecyclerView>(Resource.Id.SongList);
            this.albumList              = view.FindViewById <MvxRecyclerView>(Resource.Id.AlbumList);
            this.similarList            = view.FindViewById <MvxRecyclerView>(Resource.Id.SimilarList);
            this.similarList.Visibility = ViewStates.Gone;
            this.albumList.Visibility   = ViewStates.Gone;

            DisplayMetrics    displayMetrics = this.Resources.DisplayMetrics;
            float             dpWidth        = displayMetrics.WidthPixels / displayMetrics.Density;
            var               columnFloat    = dpWidth / 160;
            GridLayoutManager lLayout        = new GridLayoutManager(view.Context, (int)Math.Truncate(columnFloat));
            GridLayoutManager lLayout2       = new GridLayoutManager(view.Context, (int)Math.Truncate(columnFloat));

            this.albumList.HasFixedSize = true;
            this.albumList.SetLayoutManager(lLayout);
            this.similarList.HasFixedSize = true;
            this.similarList.SetLayoutManager(lLayout2);

            GAService.GetGASInstance().Track_App_Page("List Songs");
            return(view);
        }
Exemplo n.º 11
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);
            View view = this.BindingInflate(Resource.Layout.Configuration, null);

            var prefs = Application.Context.GetSharedPreferences("Fildo", FileCreationMode.Private);

            this.cultureInfo = ((MainView)this.Activity).CultureInfo;

            string cultureForced = prefs.GetString("CultureForced", this.culture);
            string proxyForced   = prefs.GetString("ProxyConf", string.Empty);

            if (!string.IsNullOrEmpty(((BaseViewModel)((MainView)this.Activity).ViewModel).PlayingArtist))
            {
                ((MainView)this.Activity).FindViewById <Android.Widget.LinearLayout>(Resource.Id.miniPlayer).Visibility = ViewStates.Visible;
            }

            if (this.ViewModel != null)
            {
                view.FindViewById <Android.Widget.CheckBox>(Resource.Id.checkboxsavealbum).Text  = ((BaseViewModel)this.ViewModel).GetString("SaveUnderFolder", this.cultureInfo);
                view.FindViewById <Android.Widget.CheckBox>(Resource.Id.checkboxexternal).Text   = ((BaseViewModel)this.ViewModel).GetString("SaveExternalSD", this.cultureInfo);
                view.FindViewById <Android.Widget.Button>(Resource.Id.BtnSave).Text              = ((BaseViewModel)this.ViewModel).GetString("Save", this.cultureInfo);
                view.FindViewById <Android.Widget.TextView>(Resource.Id.spinnerCultureText).Text = ((BaseViewModel)this.ViewModel).GetString("SpinnerCultureText", this.cultureInfo);
                view.FindViewById <Android.Widget.TextView>(Resource.Id.spinnerProxyText).Text   = ((BaseViewModel)this.ViewModel).GetString("SpinnerProxyText", this.cultureInfo);
            }

            var spinnerCulture = view.FindViewById <MvxSpinner>(Resource.Id.spinnerCulture);

            spinnerCulture.ItemSelected      += this.SpinnerCulture_ItemSelected;
            this.spinnerProxies               = view.FindViewById <MvxSpinner>(Resource.Id.spinnerProxy);
            this.spinnerProxies.ItemSelected += this.SpinnerProxies_ItemSelected;

            int cfTemp = ((List <string>)spinnerCulture.ItemsSource).IndexOf(cultureForced);

            if (cfTemp > -1)
            {
                spinnerCulture.SetSelection(cfTemp);
            }

            if (!string.IsNullOrEmpty(proxyForced))
            {
                int pxTemp = ((List <string>) this.spinnerProxies.ItemsSource).IndexOf(proxyForced);
                if (pxTemp > -1)
                {
                    this.spinnerProxies.SetSelection(pxTemp);
                }
                else
                {
                    this.spinnerProxies.SetSelection(0);
                }
            }
            else
            {
                this.spinnerProxies.SetSelection(0);
            }


            this.progress = new Bindables.BindableProgress(view.Context, this.ViewModel);

            var set = this.CreateBindingSet <ConfigurationView, ConfigurationViewModel>();

            set.Bind(this.progress).For(p => p.Visible).To(vm => vm.IsBusy);
            set.Bind(this.progress).For(p => p.NoInternet).To(vm => vm.NoInternet);
            set.Bind(this).For(p => p.Saved).To(vm => vm.Saved);
            set.Apply();

            this.saveUnderArtistFolder = view.FindViewById <Android.Widget.CheckBox>(Resource.Id.checkboxsavealbum);
            this.saveUnderExternalSd   = view.FindViewById <Android.Widget.CheckBox>(Resource.Id.checkboxexternal);

            this.saveUnderArtistFolder.Checked = prefs.GetBoolean("SaveUnderArtistFolder", false);
            this.saveUnderExternalSd.Checked   = prefs.GetBoolean("SaveExternalSD", false);
            GAService.GetGASInstance().Track_App_Page("Configuration");
            return(view);
        }
Exemplo n.º 12
0
        protected override void OnCreate(Bundle bundle)
        {
            AndroidEnvironment.UnhandledExceptionRaiser += this.AndroidEnvironment_UnhandledExceptionRaiser;
            AppDomain currentDomain = AppDomain.CurrentDomain;

            currentDomain.UnhandledException += this.HandleExceptions;

            TaskScheduler.UnobservedTaskException += this.TaskScheduler_UnobservedTaskException;

            UserDialogs.Init(this);
            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");
            // ensure the initialization is done
            var setup = MvxAndroidSetupSingleton.EnsureSingletonAvailable(this.ApplicationContext);

            setup.EnsureInitialized();

            if (this.Intent.Extras.ContainsKey("notificationPlayList"))
            {
                if (this.ViewModel != null)
                {
                    ((BaseViewModel)this.ViewModel).ShowPlayer();
                }
                else
                {
                    var loaderService = Mvx.Resolve <IMvxViewModelLoader>();
                    this.ViewModel = loaderService.LoadViewModel(new MvxViewModelRequest(typeof(MainViewModel), null, null, null), null) as MainViewModel;
                    ((BaseViewModel)this.ViewModel).ShowPlayer();
                }
            }

            base.OnCreate(bundle);
            this.SetContentView(Resource.Layout.Main);

            var presenter       = (DroidPresenter)Mvx.Resolve <IMvxAndroidViewPresenter>();
            var initialFragment = new MainContentView {
                ViewModel = this.ViewModel
            };

            presenter.RegisterFragmentManager(this.FragmentManager, initialFragment);

            baseViewModel = (BaseViewModel)this.ViewModel;

            var prefs = Application.Context.GetSharedPreferences("Fildo", FileCreationMode.Private);

            this.CultureInfo = new CultureInfo(prefs.GetString("CultureForced", Thread.CurrentThread.CurrentUICulture.Name));

            ((BaseViewModel)this.ViewModel).SetCulture(this.CultureInfo);

            this.toolbar          = this.FindViewById <Toolbar>(Resource.Id.toolbar);
            this.menuDrawerLayout = this.FindViewById <DrawerLayout>(Resource.Id.mainContainer);
            this.menuDrawerToggle = new MvxActionBarDrawerToggle(
                this,
                // host Activity
                this.menuDrawerLayout,
                // DrawerLayout object

                Resource.String.Login,
                // "open drawer" description
                Resource.String.Login // "close drawer" description
                );
            this.menuDrawerLayout.SetDrawerListener(this.menuDrawerToggle);

            this.SetSupportActionBar(this.toolbar);
            this.SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            this.SupportActionBar.SetHomeButtonEnabled(true);

            this.progress = new BindableProgress(this, this.ViewModel);

            var set = this.CreateBindingSet <MainView, MainViewModel>();

            set.Bind(this.progress).For(p => p.Visible).To(vm => vm.IsBusy);
            set.Bind(this.progress).For(p => p.NoInternet).To(vm => vm.NoInternet);
            set.Bind(this.progress).For(p => p.NewVersion).To(vm => vm.NewVersion);
            set.Bind(this).For(p => p.ShowMenu).To(vm => vm.ShowMenu);
            set.Apply();

            if (prefs.GetBoolean("FirstTime", true))
            {
                this.menuDrawerLayout.OpenDrawer((int)GravityFlags.Start);
                var prefEditor = prefs.Edit();
                prefEditor.PutBoolean("FirstTime", false);
                prefEditor.Commit();
            }
            BackgroundStreamingService.Main = this;

            BackgroundStreamingService.SongNameChanged -= this.BackgroundStreamingService_SongNameChanged;
            BackgroundStreamingService.percentChanged  -= this.BackgroundStreamingService_posChanged;
            BackgroundStreamingService.SongNameChanged += this.BackgroundStreamingService_SongNameChanged;
            BackgroundStreamingService.percentChanged  += this.BackgroundStreamingService_posChanged;

            GAService.GetGASInstance().Initialize(this);
            GAService.GetGASInstance().Track_App_Page("Fildo Main Activity");
        }