|
|
@ -7,6 +7,7 @@ using Android.Content;
|
|
|
|
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 GridLayoutManager = Android.Support.V7.Widget.GridLayoutManager;
|
|
|
|
|
|
|
|
using Android.Runtime;
|
|
|
|
|
|
|
|
|
|
|
|
namespace QuickPlay
|
|
|
|
namespace QuickPlay
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -84,7 +85,13 @@ namespace QuickPlay
|
|
|
|
StartActivity(i);
|
|
|
|
StartActivity(i);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
b.SetNegativeButton("Scan QR", delegate {
|
|
|
|
b.SetNegativeButton("Scan QR", delegate {
|
|
|
|
Toast.MakeText(this, "Not implemented :-(", ToastLength.Long).Show();
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var i = new Intent("com.google.zxing.client.android.SCAN");
|
|
|
|
|
|
|
|
StartActivityForResult(i, 0);
|
|
|
|
|
|
|
|
} catch (ActivityNotFoundException e) {
|
|
|
|
|
|
|
|
Toast.MakeText(this, "You need ZXing Barcode scanner for this", ToastLength.Long).Show();
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
b.SetCancelable(true);
|
|
|
|
b.SetCancelable(true);
|
|
|
|
|
|
|
|
|
|
|
@ -169,5 +176,26 @@ namespace QuickPlay
|
|
|
|
|
|
|
|
|
|
|
|
this.appConfig.saveConfiguration();
|
|
|
|
this.appConfig.saveConfiguration();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected override void OnActivityResult(int requestCode, [GeneratedEnum] Result resultCode, Intent data)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
base.OnActivityResult(requestCode, resultCode, data);
|
|
|
|
|
|
|
|
if (requestCode == 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (resultCode == Result.Ok)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
string url = data.GetStringExtra("SCAN_RESULT");
|
|
|
|
|
|
|
|
var cfg = new AppConfiguration { playerConfigUrl = url };
|
|
|
|
|
|
|
|
cfg.saveConfiguration();
|
|
|
|
|
|
|
|
Toast.MakeText(this, "Configuration saved, reloading", ToastLength.Short).Show();
|
|
|
|
|
|
|
|
var i = new Intent(this, typeof(MainActivity));
|
|
|
|
|
|
|
|
StartActivity(i);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (resultCode == Result.Canceled)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Toast.MakeText(this, "Could not load QR code", ToastLength.Short).Show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|