From 9384e4c3a7fb97e786ed72706eff77837bdb51ca Mon Sep 17 00:00:00 2001 From: Dom <108245473+OudomMunint@users.noreply.github.com> Date: Sat, 14 Dec 2024 16:49:18 +1100 Subject: [PATCH 1/5] iOS build fix attempt --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e87dac0..c3e6e6c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: # MAUI iOS Build build-ios: - runs-on: macos-14 + runs-on: macos-15 name: iOS Build steps: - name: Checkout @@ -59,7 +59,7 @@ jobs: dotnet workload install maui --ignore-failed-sources - name: Select Xcode 15.4 - run: sudo xcode-select -s /Applications/Xcode_15.4.app + run: sudo xcode-select -s /Applications/Xcode_16.0.app - name: Build MAUI iOS run: | @@ -74,4 +74,4 @@ jobs: - name: Create Release uses: ncipollo/release-action@v1.14.0 with: - tag: v1.7.7.8 \ No newline at end of file + tag: v1.7.7.8 From b88bd9d0fe3caaff790ff46b4c2db50ef55ae79a Mon Sep 17 00:00:00 2001 From: OudomMunint Date: Sun, 15 Dec 2024 16:41:29 +1100 Subject: [PATCH 2/5] Add loading to list view instead of full page --- Views/TodoListPage.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Views/TodoListPage.xaml b/Views/TodoListPage.xaml index e861692..fb6bd29 100644 --- a/Views/TodoListPage.xaml +++ b/Views/TodoListPage.xaml @@ -273,7 +273,7 @@ - From 55473cb89ee32c3462940f5920efe2081abd5526 Mon Sep 17 00:00:00 2001 From: OudomMunint Date: Sun, 15 Dec 2024 22:11:39 +1100 Subject: [PATCH 3/5] Improved tablet dashboard chart layout --- Views/Dashboard.xaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Views/Dashboard.xaml b/Views/Dashboard.xaml index f53fbf2..e496d55 100644 --- a/Views/Dashboard.xaml +++ b/Views/Dashboard.xaml @@ -48,12 +48,12 @@ + Padding="{OnPlatform iOS=30, Android={OnIdiom Phone=40, Tablet=0}}"> - + From 70dd631a9cdde3f03a1b20f127c26b7cfea5018e Mon Sep 17 00:00:00 2001 From: OudomMunint Date: Sun, 15 Dec 2024 22:11:50 +1100 Subject: [PATCH 4/5] Xaml formatting. --- Views/Dashboard.xaml | 102 ++++++++++++++++++++++--------------------- 1 file changed, 52 insertions(+), 50 deletions(-) diff --git a/Views/Dashboard.xaml b/Views/Dashboard.xaml index e496d55..5e0e7ed 100644 --- a/Views/Dashboard.xaml +++ b/Views/Dashboard.xaml @@ -7,36 +7,36 @@ Title="Dashboard" NavigationPage.HasNavigationBar="False"> - - - - - - - + + + + + + + - - - - - - + + + + + + - - + + - - - - - + + + + + - + - - + - - - - + + + + - + + + + + + + + + + - - - - - - - - + + + + + - - - - - - - - + + - + - - + \ No newline at end of file From 9300bfbcf20785321a547ea361022f283f23c313 Mon Sep 17 00:00:00 2001 From: OudomMunint Date: Sun, 15 Dec 2024 22:13:42 +1100 Subject: [PATCH 5/5] #255 - Remember applied sort option. --- Views/TodoListPage.xaml.cs | 57 ++++++++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 9 deletions(-) diff --git a/Views/TodoListPage.xaml.cs b/Views/TodoListPage.xaml.cs index 815c393..d04984c 100644 --- a/Views/TodoListPage.xaml.cs +++ b/Views/TodoListPage.xaml.cs @@ -70,6 +70,7 @@ protected override async void OnAppearing() await SetPinnedOnlyListSource(); await UpdateListView(); await UpdateCollectionView(); + ApplySavedSorting(); IsPageLoading = false; } @@ -293,6 +294,38 @@ public async void OpenMenu(object sender, EventArgs e) } + private void SaveSortingPreference(string sortingType, bool isAscending) + { + Preferences.Set("SortingKey", sortingType); + Preferences.Set("SortDirectionKey", isAscending); + } + + private void ApplySavedSorting() + { + var sortingType = Preferences.Get("SortingKey", "none"); + var isAscending = Preferences.Get("SortDirectionKey", true); + + IEnumerable items = listView.ItemsSource as IEnumerable; + + switch (sortingType) + { + case "date": + items = isAscending ? items.OrderBy(item => item.Date) : items.OrderByDescending(item => item.Date); + break; + case "priority": + items = items.OrderBy(item => TodoListPage.GetPriorityValue(item.Priority)); + break; + case "pinned": + items = items.OrderByDescending(item => item.IsPinned); + break; + case "none": + default: + return; // No sorting + } + + listView.ItemsSource = items.ToList(); + } + //Sorting private void SortByDateClicked(object sender, EventArgs e) { @@ -302,6 +335,8 @@ private void SortByDateClicked(object sender, EventArgs e) ? ((IEnumerable)listView.ItemsSource).OrderBy(item => item.Date) : ((IEnumerable)listView.ItemsSource).OrderByDescending(item => item.Date); listView.ItemsSource = sortedItems.ToList(); + + SaveSortingPreference("date", sortByDateAscending); } public async void OpenSortMenu(object sender, EventArgs e) @@ -313,26 +348,30 @@ public async void OpenSortMenu(object sender, EventArgs e) var action = await Application.Current.MainPage.DisplayActionSheet("Sorting", "Cancel", null, new[] { sortbydate, sortbypriority, sortbypinned, clearsorting }); - if (action != null && action.Equals(sortbydate)) + if (action == sortbydate) { var sortedItems = ((IEnumerable)listView.ItemsSource).OrderByDescending(item => item.Date); listView.ItemsSource = sortedItems.ToList(); + SaveSortingPreference("date", false); // Descending } - else if (action != null && action.Equals(sortbypriority)) + else if (action == sortbypriority) { var sortedItems = ((IEnumerable)listView.ItemsSource).OrderBy(item => TodoListPage.GetPriorityValue(item.Priority)); listView.ItemsSource = sortedItems.ToList(); + SaveSortingPreference("priority", true); // Ascending } - else if (action != null && action.Equals(clearsorting)) // Handle clear sorting option - { - // Reset ListView - listView.ItemsSource = ((IEnumerable)listView.ItemsSource).ToList(); - await UpdateListView(); - } - else if (action != null && action.Equals(sortbypinned)) + else if (action == sortbypinned) { var sortedItems = ((IEnumerable)listView.ItemsSource).OrderByDescending(item => item.IsPinned); listView.ItemsSource = sortedItems.ToList(); + SaveSortingPreference("pinned", false); // Descending + } + else if (action == clearsorting) + { + listView.ItemsSource = ((IEnumerable)listView.ItemsSource).ToList(); + Preferences.Remove("SortingKey"); + Preferences.Remove("SortDirectionKey"); + await UpdateListView(); } }