Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Android: Added SyncDownloadActivity (empty for now). SyncMenuActivity…
… is now fully working except for item selection and missing glyphs for artists/albums/songs/checkmarks. Related to issue #406.
- Loading branch information
1 parent
e261e1d
commit 6baad04
Showing
14 changed files
with
355 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
134 changes: 134 additions & 0 deletions
134
MPfm/MPfm.Android/Classes/Activities/SyncDownloadActivity.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
// 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 <http://www.gnu.org/licenses/>. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Android.App; | ||
using Android.Content; | ||
using Android.Content.PM; | ||
using Android.Views; | ||
using Android.OS; | ||
using Android.Widget; | ||
using MPfm.Android.Classes.Adapters; | ||
using MPfm.Android.Classes.Navigation; | ||
using MPfm.Library.Objects; | ||
using MPfm.MVP.Bootstrap; | ||
using MPfm.MVP.Navigation; | ||
using MPfm.MVP.Views; | ||
using MPfm.Player.Objects; | ||
|
||
namespace MPfm.Android | ||
{ | ||
[Activity(Label = "Sync Download", ScreenOrientation = ScreenOrientation.Sensor, Theme = "@style/MyAppTheme", ConfigurationChanges = ConfigChanges.KeyboardHidden | ConfigChanges.Orientation | ConfigChanges.ScreenSize)] | ||
public class SyncDownloadActivity : BaseActivity, ISyncDownloadView | ||
{ | ||
private MobileNavigationManager _navigationManager; | ||
|
||
protected override void OnCreate(Bundle bundle) | ||
{ | ||
Console.WriteLine("SyncDownloadActivity - OnCreate"); | ||
base.OnCreate(bundle); | ||
|
||
_navigationManager = Bootstrapper.GetContainer().Resolve<MobileNavigationManager>(); | ||
SetContentView(Resource.Layout.Sync); | ||
ActionBar.SetDisplayHomeAsUpEnabled(true); | ||
ActionBar.SetHomeButtonEnabled(true); | ||
|
||
// Since the onViewReady action could not be added to an intent, tell the NavMgr the view is ready | ||
((AndroidNavigationManager)_navigationManager).SetSyncDownloadActivityInstance(this); | ||
} | ||
|
||
protected override void OnStart() | ||
{ | ||
Console.WriteLine("SyncDownloadActivity - OnStart"); | ||
base.OnStart(); | ||
} | ||
|
||
protected override void OnRestart() | ||
{ | ||
Console.WriteLine("SyncDownloadActivity - OnRestart"); | ||
base.OnRestart(); | ||
} | ||
|
||
protected override void OnPause() | ||
{ | ||
Console.WriteLine("SyncDownloadActivity - OnPause"); | ||
base.OnPause(); | ||
} | ||
|
||
protected override void OnResume() | ||
{ | ||
Console.WriteLine("SyncDownloadActivity - OnResume"); | ||
base.OnResume(); | ||
} | ||
|
||
protected override void OnStop() | ||
{ | ||
Console.WriteLine("SyncDownloadActivity - OnStop"); | ||
base.OnStop(); | ||
} | ||
|
||
protected override void OnDestroy() | ||
{ | ||
Console.WriteLine("SyncDownloadActivity - OnDestroy"); | ||
base.OnDestroy(); | ||
} | ||
|
||
public override bool OnOptionsItemSelected(IMenuItem item) | ||
{ | ||
switch (item.ItemId) | ||
{ | ||
case global::Android.Resource.Id.Home: | ||
var intent = new Intent(this, typeof (MainActivity)); | ||
intent.AddFlags(ActivityFlags.ClearTop | ActivityFlags.SingleTop); | ||
this.StartActivity(intent); | ||
this.Finish(); | ||
return true; | ||
break; | ||
default: | ||
return base.OnOptionsItemSelected(item); | ||
break; | ||
} | ||
} | ||
|
||
#region ISyncDownloadView implementation | ||
|
||
public Action OnButtonPressed { get; set; } | ||
|
||
public void SyncDownloadError(Exception ex) | ||
{ | ||
RunOnUiThread(() => { | ||
AlertDialog ad = new AlertDialog.Builder(this).Create(); | ||
ad.SetCancelable(false); | ||
ad.SetMessage(string.Format("An error has occured in SyncDownload: {0}", ex)); | ||
ad.SetButton("OK", (sender, args) => ad.Dismiss()); | ||
ad.Show(); | ||
}); | ||
} | ||
|
||
public void RefreshStatus(SyncClientDownloadAudioFileProgressEntity entity) | ||
{ | ||
} | ||
|
||
public void SyncCompleted() | ||
{ | ||
} | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 0 additions & 72 deletions
72
MPfm/MPfm.Android/Classes/Fragments/SyncDownloadFragment.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.