|
|
@ -10,6 +10,7 @@ using Android.Widget;
|
|
|
|
//using Google.Android.Material.Snackbar;
|
|
|
|
//using Google.Android.Material.Snackbar;
|
|
|
|
using Android.Support.V7.App;
|
|
|
|
using Android.Support.V7.App;
|
|
|
|
using Toolbar = Android.Support.V7.Widget.Toolbar;
|
|
|
|
using Toolbar = Android.Support.V7.Widget.Toolbar;
|
|
|
|
|
|
|
|
using GridLayoutManager = Android.Support.V7.Widget.GridLayoutManager;
|
|
|
|
|
|
|
|
|
|
|
|
using System.Net;
|
|
|
|
using System.Net;
|
|
|
|
//using MpcNET;
|
|
|
|
//using MpcNET;
|
|
|
@ -25,7 +26,8 @@ namespace QuickPlay
|
|
|
|
public class MainActivity : AppCompatActivity
|
|
|
|
public class MainActivity : AppCompatActivity
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private AppConfiguration appConfig;
|
|
|
|
private AppConfiguration appConfig;
|
|
|
|
private List<PlayerConfiguration> playerConfigs;
|
|
|
|
private Android.Support.V7.Widget.RecyclerView recyclerView;
|
|
|
|
|
|
|
|
private IPlayer currentPlayer;
|
|
|
|
|
|
|
|
|
|
|
|
protected override void OnCreate(Bundle savedInstanceState)
|
|
|
|
protected override void OnCreate(Bundle savedInstanceState)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -33,8 +35,8 @@ namespace QuickPlay
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// App initialization
|
|
|
|
// App initialization
|
|
|
|
//appConfig = AppConfiguration.loadSavedConfiguration();
|
|
|
|
appConfig = AppConfiguration.loadSavedConfiguration();
|
|
|
|
//playerConfigs = acquirePlayerConfigs();
|
|
|
|
currentPlayer = appConfig.GetPlayerConfig().GetPlayer();
|
|
|
|
|
|
|
|
|
|
|
|
// UI initialization
|
|
|
|
// UI initialization
|
|
|
|
SetContentView(Resource.Layout.activity_main);
|
|
|
|
SetContentView(Resource.Layout.activity_main);
|
|
|
@ -47,6 +49,19 @@ namespace QuickPlay
|
|
|
|
// Hide the play bar by default
|
|
|
|
// Hide the play bar by default
|
|
|
|
var bar = FindViewById(Resource.Id.currentSongBar);
|
|
|
|
var bar = FindViewById(Resource.Id.currentSongBar);
|
|
|
|
bar.Visibility = ViewStates.Invisible;
|
|
|
|
bar.Visibility = ViewStates.Invisible;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Initialize the RecyclerView
|
|
|
|
|
|
|
|
// Since this is rather complicated, it is in a separate method
|
|
|
|
|
|
|
|
InitializeRecyclerView();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void InitializeRecyclerView()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
recyclerView = FindViewById<Android.Support.V7.Widget.RecyclerView>(Resource.Id.recyclerView1);
|
|
|
|
|
|
|
|
var adapter = new SongRecyclerAdapter(currentPlayer);
|
|
|
|
|
|
|
|
recyclerView.SetAdapter(adapter);
|
|
|
|
|
|
|
|
var layoutManager = new GridLayoutManager(this, 2, GridLayoutManager.Vertical, false);
|
|
|
|
|
|
|
|
recyclerView.SetLayoutManager(layoutManager);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override bool OnCreateOptionsMenu(IMenu menu)
|
|
|
|
public override bool OnCreateOptionsMenu(IMenu menu)
|
|
|
@ -72,16 +87,5 @@ namespace QuickPlay
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return base.OnOptionsItemSelected(item);
|
|
|
|
return base.OnOptionsItemSelected(item);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<PlayerConfiguration> acquirePlayerConfigs()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// FIXME: Bad! We have IPlayerConfigurationProviders
|
|
|
|
|
|
|
|
///var url = appConfig.playerConfigUrl;
|
|
|
|
|
|
|
|
// TODO: Learn cURL and get configs :-)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|