From 60e5b328df1b6ce88c5f5c91004f8fb870bcde4a Mon Sep 17 00:00:00 2001 From: ycastonguay Date: Thu, 26 Sep 2013 20:41:42 -0400 Subject: [PATCH] Android: Added AddMarker presenter/view/fragment. Fixed crash bug with notification bar for Android 4.0.3. Related to issue #406. --- MPfm/MPfm.Android/Classes/Application.cs | 5 +- .../Classes/Fragments/AddMarkerFragment.cs | 109 ++ ...listFragment.cs => AddPlaylistFragment.cs} | 22 +- .../Classes/Fragments/MarkersFragment.cs | 6 +- .../Classes/Services/NotificationService.cs | 29 +- MPfm/MPfm.Android/MPfm.Android.csproj | 8 +- .../Resources/Layout/AddMarker.axml | 76 ++ .../{AddNewPlaylist.axml => AddPlaylist.axml} | 6 +- .../Resources/Resource.Designer.cs | 1127 +++++++++-------- MPfm/MPfm.MVP/Bootstrap/Bootstrapper.cs | 5 +- MPfm/MPfm.MVP/MPfm.MVP.Android.csproj | 9 +- .../Navigation/MobileNavigationManager.cs | 44 +- ...stPresenter.cs => AddPlaylistPresenter.cs} | 12 +- ...istPresenter.cs => IAddMarkerPresenter.cs} | 6 +- .../Interfaces/IAddPlaylistPresenter.cs | 28 + MPfm/MPfm.MVP/Presenters/MarkersPresenter.cs | 19 +- .../Presenters/SelectPlaylistPresenter.cs | 4 +- MPfm/MPfm.MVP/Views/IAddMarkerView.cs | 35 + ...NewPlaylistView.cs => IAddPlaylistView.cs} | 6 +- MPfm/MPfm.MVP/Views/IMarkersView.cs | 3 +- 20 files changed, 942 insertions(+), 617 deletions(-) create mode 100644 MPfm/MPfm.Android/Classes/Fragments/AddMarkerFragment.cs rename MPfm/MPfm.Android/Classes/Fragments/{AddNewPlaylistFragment.cs => AddPlaylistFragment.cs} (82%) create mode 100644 MPfm/MPfm.Android/Resources/Layout/AddMarker.axml rename MPfm/MPfm.Android/Resources/Layout/{AddNewPlaylist.axml => AddPlaylist.axml} (92%) rename MPfm/MPfm.MVP/Presenters/{AddNewPlaylistPresenter.cs => AddPlaylistPresenter.cs} (81%) rename MPfm/MPfm.MVP/Presenters/Interfaces/{IAddNewPlaylistPresenter.cs => IAddMarkerPresenter.cs} (81%) create mode 100644 MPfm/MPfm.MVP/Presenters/Interfaces/IAddPlaylistPresenter.cs create mode 100644 MPfm/MPfm.MVP/Views/IAddMarkerView.cs rename MPfm/MPfm.MVP/Views/{IAddNewPlaylistView.cs => IAddPlaylistView.cs} (87%) diff --git a/MPfm/MPfm.Android/Classes/Application.cs b/MPfm/MPfm.Android/Classes/Application.cs index 0c965c80..e21d65f7 100644 --- a/MPfm/MPfm.Android/Classes/Application.cs +++ b/MPfm/MPfm.Android/Classes/Application.cs @@ -1,4 +1,4 @@ -// Copyright © 2011-2013 Yanick Castonguay +// Copyright © 2011-2013 Yanick Castonguay // // This file is part of MPfm. // @@ -174,7 +174,8 @@ private void BootstrapApp() container.Register().AsMultiInstance(); container.Register().AsMultiInstance(); container.Register().AsMultiInstance(); - container.Register().AsMultiInstance(); + container.Register().AsMultiInstance(); + container.Register().AsMultiInstance(); } } } diff --git a/MPfm/MPfm.Android/Classes/Fragments/AddMarkerFragment.cs b/MPfm/MPfm.Android/Classes/Fragments/AddMarkerFragment.cs new file mode 100644 index 00000000..258413f7 --- /dev/null +++ b/MPfm/MPfm.Android/Classes/Fragments/AddMarkerFragment.cs @@ -0,0 +1,109 @@ +// Copyright © 2011-2013 Yanick Castonguay +// +// This file is part of MPfm. +// +// MPfm is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// MPfm is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with MPfm. If not, see . + +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Android.App; +using Android.Content; +using Android.OS; +using Android.Views; +using Android.Widget; +using MPfm.Android.Classes.Adapters; +using MPfm.Android.Classes.Fragments.Base; +using MPfm.MVP.Presenters; +using MPfm.MVP.Views; + +namespace MPfm.Android.Classes.Fragments +{ + public class AddMarkerFragment : BaseDialogFragment, IAddMarkerView + { + private View _view; + private RadioButton _radioVerse; + private RadioButton _radioChorus; + private RadioButton _radioBridge; + private RadioButton _radioSolo; + private Button _btnCancel; + private Button _btnCreate; + + public AddMarkerFragment() : base(null) + { + } + + public AddMarkerFragment(Action onViewReady) + : base(onViewReady) + { + } + + public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) + { + Dialog.SetTitle("Select marker template"); + _view = inflater.Inflate(Resource.Layout.AddMarker, container, false); + + _btnCancel = _view.FindViewById