public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.bindableProgress = new BindableProgress(View);

            this.SetUpBindings();
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.bindableProgress = new BindableProgress(View);

            this.SetUpBindings();
        }
Exemplo n.º 3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            _bindableProgress = new BindableProgress(this, "Updating");
            var set = this.CreateBindingSet <SessionDetailTabView, SessionDetailTabViewModel>();

            set.Bind(_bindableProgress).For(p => p.Visible).To(vm => ((SessionDetailViewModel)vm.SessionDetailViewModel).IsFavoritingSession);
            set.Apply();
        }
Exemplo n.º 4
0
		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);

			_bindableProgress = new BindableProgress(this, "Updating");
			var set = this.CreateBindingSet<SessionDetailTabView, SessionDetailTabViewModel>();

			set.Bind(_bindableProgress).For(p => p.Visible).To(vm => ((SessionDetailViewModel)vm.SessionDetailViewModel).IsFavoritingSession);
			set.Apply();
		}
Exemplo n.º 5
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            _bindableProgress = new BindableProgress(this);
            this.CreateBindingSet <BaseActivity <TViewModel>, TViewModel>()
            .Bind(_bindableProgress).For(p => p.Visible).To(vm => vm.IsBusy)
            .Apply();

            _toastSubscriptionToken = ViewModel.Messenger.SubscribeOnMainThread <ToastMessage>(OnToastMessage, MvxReference.Strong);
        }
Exemplo n.º 6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            _conferencesLoadingProgress = new BindableProgress(this, "Loading Conferences");

            var set = this.CreateBindingSet <ConferencesTabView, ConferencesTabViewModel>();

            set.Bind(_conferencesLoadingProgress)
            .For(p => p.Visible)
            .To(vm => ((ConferencesViewModel)vm.ConferencesViewModel).AreConferencesLoading);
            //set.Bind(_scheduleLoadingProgress).For(p => p.Visible).To(vm => ((ConferencesScheduleViewModel)vm.ConferencesScheduleViewModel).AreConferencesLoading);
            set.Apply();
        }
Exemplo n.º 7
0
		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);

			_conferencesLoadingProgress = new BindableProgress(this, "Loading Conferences");

			var set = this.CreateBindingSet<ConferencesTabView, ConferencesTabViewModel>();

			set.Bind(_conferencesLoadingProgress)
				.For(p => p.Visible)
				.To(vm => ((ConferencesViewModel)vm.ConferencesViewModel).AreConferencesLoading);
			//set.Bind(_scheduleLoadingProgress).For(p => p.Visible).To(vm => ((ConferencesScheduleViewModel)vm.ConferencesScheduleViewModel).AreConferencesLoading);
			set.Apply();
		}
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.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.º 9
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.º 10
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);

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

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

            var set = this.CreateBindingSet <DownloadView, DownloadViewModel>();

            set.Bind(this.progress).For(p => p.Visible).To(vm => vm.IsBusy);
            set.Apply();
            GAService.GetGASInstance().Track_App_Page("Download Queue");
            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.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.º 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");
        }
Exemplo n.º 13
0
 public BindableBlockTransferItem(long offset)
 {
     Offset   = offset;
     Progress = new BindableProgress();
 }