diff --git a/MPfm/MPfm.Android/Classes/Activities/EqualizerPresetDetailsActivity.cs b/MPfm/MPfm.Android/Classes/Activities/EqualizerPresetDetailsActivity.cs index 28910eab..9ad7bf75 100644 --- a/MPfm/MPfm.Android/Classes/Activities/EqualizerPresetDetailsActivity.cs +++ b/MPfm/MPfm.Android/Classes/Activities/EqualizerPresetDetailsActivity.cs @@ -36,7 +36,7 @@ namespace MPfm.Android [Activity(Label = "Equalizer Preset Details", ScreenOrientation = ScreenOrientation.Sensor, Theme = "@style/MyAppTheme", ConfigurationChanges = ConfigChanges.KeyboardHidden | ConfigChanges.Orientation | ConfigChanges.ScreenSize, WindowSoftInputMode = SoftInput.StateHidden)] public class EqualizerPresetDetailsActivity : BaseActivity, IEqualizerPresetDetailsView, EditText.IOnEditorActionListener { - private MobileNavigationManager _navigationManager; + private string _presetId; private string _sourceActivityType; private EqualizerPresetFadersListAdapter _listAdapter; private ListView _listView; @@ -51,7 +51,6 @@ protected override void OnCreate(Bundle bundle) Console.WriteLine("EqualizerPresetDetailsActivity - OnCreate"); base.OnCreate(bundle); - _navigationManager = Bootstrapper.GetContainer().Resolve(); SetContentView(Resource.Layout.EqualizerPresetDetails); ActionBar.SetDisplayHomeAsUpEnabled(true); ActionBar.SetHomeButtonEnabled(true); @@ -71,9 +70,10 @@ protected override void OnCreate(Bundle bundle) // Save the source activity type for later (for providing Up navigation) _sourceActivityType = Intent.GetStringExtra("sourceActivity"); + _presetId = Intent.GetStringExtra("presetId"); - // Since the onViewReady action could not be added to an intent, tell the NavMgr the view is ready - //((AndroidNavigationManager)_navigationManager).SetEqualizerPresetDetailsActivityInstance(this); + var navigationManager = Bootstrapper.GetContainer().Resolve(); + navigationManager.BindEqualizerPresetDetailsView(null, this, new Guid(_presetId)); } protected override void OnStart() diff --git a/MPfm/MPfm.Android/Classes/Activities/SyncMenuActivity.cs b/MPfm/MPfm.Android/Classes/Activities/SyncMenuActivity.cs index 7955d6bd..394c90b1 100644 --- a/MPfm/MPfm.Android/Classes/Activities/SyncMenuActivity.cs +++ b/MPfm/MPfm.Android/Classes/Activities/SyncMenuActivity.cs @@ -34,29 +34,29 @@ using MPfm.MVP.Views; using MPfm.Player.Objects; using MPfm.Sound.AudioFiles; +using Newtonsoft.Json; namespace MPfm.Android { [Activity(Label = "Sync Menu", ScreenOrientation = ScreenOrientation.Sensor, Theme = "@style/MyAppTheme", ConfigurationChanges = ConfigChanges.KeyboardHidden | ConfigChanges.Orientation | ConfigChanges.ScreenSize)] public class SyncMenuActivity : BaseActivity, ISyncMenuView { - private MobileNavigationManager _navigationManager; - LinearLayout _loadingLayout; - LinearLayout _mainLayout; - TextView _lblStatus; - TextView _lblTotal; - TextView _lblFreeSpace; - Button _btnSelectAll; - ListView _listView; - SyncMenuListAdapter _listAdapter; - List _items; + private SyncDevice _device; + private LinearLayout _loadingLayout; + private LinearLayout _mainLayout; + private TextView _lblStatus; + private TextView _lblTotal; + private TextView _lblFreeSpace; + private Button _btnSelectAll; + private ListView _listView; + private SyncMenuListAdapter _listAdapter; + private List _items; protected override void OnCreate(Bundle bundle) { Console.WriteLine("SyncMenuActivity - OnCreate"); base.OnCreate(bundle); - _navigationManager = Bootstrapper.GetContainer().Resolve(); SetContentView(Resource.Layout.SyncMenu); ActionBar.SetDisplayHomeAsUpEnabled(true); ActionBar.SetHomeButtonEnabled(true); @@ -75,9 +75,11 @@ protected override void OnCreate(Bundle bundle) _listView.ItemClick += ListViewOnItemClick; _listView.ItemLongClick += ListViewOnItemLongClick; - // Since the onViewReady action could not be added to an intent, tell the NavMgr the view is ready - //((AndroidNavigationManager)_navigationManager).SetSyncMenuActivityInstance(this); - //_navigationManager.BindSyncMenuView(this, null); + string json = Intent.GetStringExtra("device"); + _device = JsonConvert.DeserializeObject(json); + + var navigationManager = Bootstrapper.GetContainer().Resolve(); + navigationManager.BindSyncMenuView(this, _device); } private void ListViewOnItemClick(object sender, AdapterView.ItemClickEventArgs itemClickEventArgs) diff --git a/MPfm/MPfm.Android/Classes/Navigation/AndroidNavigationManager.cs b/MPfm/MPfm.Android/Classes/Navigation/AndroidNavigationManager.cs index 004f95c2..6e9ea2ff 100644 --- a/MPfm/MPfm.Android/Classes/Navigation/AndroidNavigationManager.cs +++ b/MPfm/MPfm.Android/Classes/Navigation/AndroidNavigationManager.cs @@ -28,6 +28,7 @@ using MPfm.MVP.Presenters.Interfaces; using MPfm.MVP.Views; using MPfm.Sound.AudioFiles; +using Newtonsoft.Json; using TinyMessenger; namespace MPfm.Android.Classes.Navigation @@ -59,6 +60,11 @@ public AndroidNavigationManager(ITinyMessengerHub messageHub) }); } + public override void PushTabView(MobileNavigationTabType type, IBaseView view) + { + // Not used on Android + } + public override void PushDialogView(MobileDialogPresentationType presentationType, string viewTitle, IBaseView sourceView, IBaseView view) { MainActivity.PushDialogView(viewTitle, sourceView, view); @@ -153,6 +159,8 @@ public override void CreateSyncView() public override void CreateSyncMenuView(SyncDevice device) { var intent = new Intent(MainActivity, typeof(SyncMenuActivity)); + string json = JsonConvert.SerializeObject(device); + intent.PutExtra("device", json); MainActivity.StartActivity(intent); } diff --git a/MPfm/MPfm.MVP/Navigation/MobileNavigationManager.cs b/MPfm/MPfm.MVP/Navigation/MobileNavigationManager.cs index 88fdc23a..9168ffc4 100644 --- a/MPfm/MPfm.MVP/Navigation/MobileNavigationManager.cs +++ b/MPfm/MPfm.MVP/Navigation/MobileNavigationManager.cs @@ -400,15 +400,15 @@ public virtual void BindPreferencesView(IPreferencesView view) _preferencesPresenter = Bootstrapper.GetContainer().Resolve(); _preferencesPresenter.BindView(view); -#if ANDROID - // On Android, push subviews for preferences since there's generally more space on screen and swiping horizontally is more natural. - var general = CreateGeneralPreferencesView(); - var audio = CreateAudioPreferencesView(); - var library = CreateLibraryPreferencesView(); - _preferencesView.PushSubView(general); - _preferencesView.PushSubView(audio); - _preferencesView.PushSubView(library); -#endif +//#if ANDROID +// // On Android, push subviews for preferences since there's generally more space on screen and swiping horizontally is more natural. +// var general = CreateGeneralPreferencesView(); +// var audio = CreateAudioPreferencesView(); +// var library = CreateLibraryPreferencesView(); +// _preferencesView.PushSubView(general); +// _preferencesView.PushSubView(audio); +// _preferencesView.PushSubView(library); +//#endif } public virtual void CreateAudioPreferencesView()