diff --git a/Aurora.gtk/Program.cs b/Aurora.gtk/Program.cs index db78a8b..b3ef8c5 100644 --- a/Aurora.gtk/Program.cs +++ b/Aurora.gtk/Program.cs @@ -11,6 +11,8 @@ namespace Aurora.gtk { Gtk.Application.Init(); LibVLCSharpFormsRenderer.Init(); + DLToolkit.Forms.Controls.FlowListView.Init(); + // For some reason, Xamarin does not pick the LibVLCSharp.Form.Platforms.Gtk assembly as a renderer assembly. // Add it manually. diff --git a/Aurora/App.css b/Aurora/App.css new file mode 100644 index 0000000..277a308 --- /dev/null +++ b/Aurora/App.css @@ -0,0 +1,7 @@ +.primaryColor { + background-color: #232323; +} + +.accentColor { + background-color: #3a3a3a; +} \ No newline at end of file diff --git a/Aurora/App.xaml b/Aurora/App.xaml index f995cb5..ffbf554 100644 --- a/Aurora/App.xaml +++ b/Aurora/App.xaml @@ -24,6 +24,8 @@ x:Key="InverseBoolConverter"/> + \ No newline at end of file diff --git a/Aurora/Design/Components/MemberList/MemberList.css b/Aurora/Design/Components/MemberList/MemberList.css new file mode 100644 index 0000000..cbb6fa2 --- /dev/null +++ b/Aurora/Design/Components/MemberList/MemberList.css @@ -0,0 +1,12 @@ +Frame { + margin-left: 20; + margin-right: 20; + margin-top: 20; + margin-bottom: 20; + width: 80; +} + +Frame Label { + color: black; + background-color: white; +} \ No newline at end of file diff --git a/Aurora/Design/Components/MemberList/MemberList.xaml b/Aurora/Design/Components/MemberList/MemberList.xaml index c000d99..df906ce 100644 --- a/Aurora/Design/Components/MemberList/MemberList.xaml +++ b/Aurora/Design/Components/MemberList/MemberList.xaml @@ -3,23 +3,30 @@ xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:hl="clr-namespace:Aurora.Design.Components.HorizontalList" + xmlns:flv="clr-namespace:DLToolkit.Forms.Controls;assembly=DLToolkit.Forms.Controls.FlowListView" x:Class="Aurora.Design.Components.MemberList.MemberList"> + + + - - - - - - - - - + + + + + + + \ No newline at end of file diff --git a/Aurora/Design/Components/MemberList/MemberList.xaml.cs b/Aurora/Design/Components/MemberList/MemberList.xaml.cs index f676404..7a61fe4 100644 --- a/Aurora/Design/Components/MemberList/MemberList.xaml.cs +++ b/Aurora/Design/Components/MemberList/MemberList.xaml.cs @@ -1,16 +1,16 @@ using System; using System.Collections.ObjectModel; using System.Collections.Specialized; +using System.Collections; using System.Linq; using Xamarin.Forms; using Aurora.Proto.Party; +using DLToolkit.Forms.Controls; namespace Aurora.Design.Components.MemberList { public partial class MemberList : ContentView { - private static ObservableCollection _newSource; - // private static NotifyCollectionChangedEventHandler _collectionChangedHandler; public MemberList() { InitializeComponent(); @@ -55,60 +55,11 @@ namespace Aurora.Design.Components.MemberList private static void OnMembersChanged(BindableObject bindable, object oldValue, object newValue) { var control = (MemberList)bindable; - var membersList = control.FindByName("MembersHorizontalList") as HorizontalList.HorizontalList; - if (membersList != null) + var membersList = control.FindByName("MembersList") as FlowListView; + + if (newValue is ICollection source) { - _newSource = newValue as ObservableCollection; - membersList.ItemsSource = new ObservableCollection(_newSource); - - //Setup collection changed listeners - //TODO evaluate for memory leak - _newSource.CollectionChanged += (sender, e) => HandleCollectionChanged(sender, e, bindable); - } - } - - private static void HandleCollectionChanged(object sender, NotifyCollectionChangedEventArgs e, BindableObject bindable) - { - MemberList self = bindable as MemberList; - var membersList = self.FindByName("MembersHorizontalList") as HorizontalList.HorizontalList; - - switch (e.Action) - { - case NotifyCollectionChangedAction.Add: - { - foreach (PartyMember member in e.NewItems) - { - membersList.ItemsSource.Add(member); - } - - break; - } - case NotifyCollectionChangedAction.Remove: - { - foreach (PartyMember member in e.NewItems) - { - //Find all matches - var sourceMembers = membersList.ItemsSource.Where((object obj) => - { - bool match = false; - if (obj is PartyMember) - { - PartyMember tmp = obj as PartyMember; - match = tmp.Id == member.Id; - } - - return match; - }); - - //Remove found matches - foreach (object obj in sourceMembers) - { - membersList.ItemsSource.Remove(obj); - } - } - - break; - } + membersList.FlowItemsSource = source; } } } diff --git a/Aurora/Design/Views/MainView/MainView.css b/Aurora/Design/Views/MainView/MainView.css index e1a2e99..76c0ca5 100644 --- a/Aurora/Design/Views/MainView/MainView.css +++ b/Aurora/Design/Views/MainView/MainView.css @@ -1,8 +1,4 @@ -^ContentPage { - background-color: #232323; -} - -#Header { +#Header { background-color: transparent; margin-top: 10; } diff --git a/Aurora/Design/Views/MainView/MainView.xaml b/Aurora/Design/Views/MainView/MainView.xaml index ef68530..bb029d5 100644 --- a/Aurora/Design/Views/MainView/MainView.xaml +++ b/Aurora/Design/Views/MainView/MainView.xaml @@ -6,7 +6,8 @@ xmlns:navigation="clr-namespace:Aurora.Design.Components.NavigationMenu" xmlns:mp="clr-namespace:Aurora.Design.Components.MediaPlayer" xmlns:dialog="clr-namespace:Aurora.Design.Components.Dialogs" - x:Class="Aurora.Design.Views.Main.MainView"> + x:Class="Aurora.Design.Views.Main.MainView" + StyleClass="primaryColor"> diff --git a/Aurora/Design/Views/Party/PartyView.xaml b/Aurora/Design/Views/Party/PartyView.xaml index 818fb62..1422ee1 100644 --- a/Aurora/Design/Views/Party/PartyView.xaml +++ b/Aurora/Design/Views/Party/PartyView.xaml @@ -3,6 +3,7 @@ xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:tabView="clr-namespace:Aurora.Design.Components.TabView" + xmlns:ml="clr-namespace:Aurora.Design.Components.MemberList" xmlns:library="clr-namespace:Aurora.Design.Components.Library" xmlns:flv="clr-namespace:DLToolkit.Forms.Controls;assembly=DLToolkit.Forms.Controls.FlowListView" x:Class="Aurora.Design.Views.Party.PartyView"> @@ -20,8 +21,10 @@ -