|
|
|
@ -10,6 +10,7 @@ using Android.Widget;
|
|
|
|
|
//using Google.Android.Material.Snackbar;
|
|
|
|
|
using Android.Support.V7.App;
|
|
|
|
|
using Toolbar = Android.Support.V7.Widget.Toolbar;
|
|
|
|
|
using GridLayoutManager = Android.Support.V7.Widget.GridLayoutManager;
|
|
|
|
|
|
|
|
|
|
using System.Net;
|
|
|
|
|
//using MpcNET;
|
|
|
|
@ -25,7 +26,8 @@ namespace QuickPlay
|
|
|
|
|
public class MainActivity : AppCompatActivity
|
|
|
|
|
{
|
|
|
|
|
private AppConfiguration appConfig;
|
|
|
|
|
private List<PlayerConfiguration> playerConfigs;
|
|
|
|
|
private Android.Support.V7.Widget.RecyclerView recyclerView;
|
|
|
|
|
private IPlayer currentPlayer;
|
|
|
|
|
|
|
|
|
|
protected override void OnCreate(Bundle savedInstanceState)
|
|
|
|
|
{
|
|
|
|
@ -33,8 +35,8 @@ namespace QuickPlay
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// App initialization
|
|
|
|
|
//appConfig = AppConfiguration.loadSavedConfiguration();
|
|
|
|
|
//playerConfigs = acquirePlayerConfigs();
|
|
|
|
|
appConfig = AppConfiguration.loadSavedConfiguration();
|
|
|
|
|
currentPlayer = appConfig.GetPlayerConfig().GetPlayer();
|
|
|
|
|
|
|
|
|
|
// UI initialization
|
|
|
|
|
SetContentView(Resource.Layout.activity_main);
|
|
|
|
@ -47,6 +49,19 @@ namespace QuickPlay
|
|
|
|
|
// Hide the play bar by default
|
|
|
|
|
var bar = FindViewById(Resource.Id.currentSongBar);
|
|
|
|
|
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)
|
|
|
|
@ -72,16 +87,5 @@ namespace QuickPlay
|
|
|
|
|
}
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|