Skip to content

Commit 1777324

Browse files
committed
So many adjustments that I don't even bother writing proper commit message...
1 parent 4c3257a commit 1777324

27 files changed

+197
-210
lines changed

MALClient.CommTest/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"dependencies": {
3-
"Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0",
3+
"Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2",
44
"xunit": "2.1.0",
55
"xunit.runner.visualstudio": "2.1.0"
66
},

MALClient.Dekstop/App.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ protected override async void OnLaunched(LaunchActivatedEventArgs e)
110110
// When the navigation stack isn't restored navigate to the first page,
111111
// configuring the new page by passing required information as a navigation
112112
// parameter
113-
rootFrame.Navigate(typeof(MainPage), navArgs);
113+
MainViewModel.InitDetails = navArgs;
114+
rootFrame.Navigate(typeof(MainPage));
114115
}
115116
else if (navArgs != null)
116117
{

MALClient.Dekstop/MALClient.Dekstop.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
2121
<AppxSymbolPackageEnabled>True</AppxSymbolPackageEnabled>
2222
<AppxBundle>Auto</AppxBundle>
23-
<AppxBundlePlatforms>x86|x64</AppxBundlePlatforms>
23+
<AppxBundlePlatforms>x64</AppxBundlePlatforms>
2424
<AppxPackageDir>C:\Users\dogie\Documents\VisualStudioBuilds\</AppxPackageDir>
2525
<PackageCertificateThumbprint>87205DEB851A1C5CC6CE7E65C7C282B812C6EE97</PackageCertificateThumbprint>
2626
<HockeyAppResourceId>b79e78858bdf44c4bfc3a1f37c8fd90c</HockeyAppResourceId>

MALClient.Dekstop/MainPage.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:local="using:MALClient"
5-
xmlns:controls="using:MALClient.UserControls"
65
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
76
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
87
xmlns:toolkit="using:WinRTXamlToolkit.Controls"

MALClient.Dekstop/MainPage.xaml.cs

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.ComponentModel;
23
using System.Threading.Tasks;
34
using Windows.Devices.Input;
45
using Windows.UI.ViewManagement;
@@ -11,9 +12,6 @@
1112
using MalClient.Shared.UserControls;
1213
using MalClient.Shared.Utils;
1314
using MalClient.Shared.ViewModels;
14-
using MALClient.UserControls;
15-
using MALClient.Utils;
16-
using MALClient.Utils.Managers;
1715
using MALClient.ViewModels;
1816
using HamburgerControl = MALClient.UserControls.New.HamburgerControl;
1917

@@ -39,23 +37,41 @@ public MainPage()
3937
new Uri(Settings.SelectedTheme == ApplicationTheme.Dark
4038
? "ms-appx:///Assets/upperappbarlogowhite.png"
4139
: "ms-appx:///Assets/upperappbarlogoblue.png"));
42-
40+
var vm = DesktopViewModelLocator.Main;
41+
vm.MainNavigationRequested += Navigate;
42+
vm.OffNavigationRequested += NavigateOff;
43+
vm.PropertyChanged += VmOnPropertyChanged;
4344
DesktopViewModelLocator.Main.View = this;
4445
};
4546
}
4647

48+
private void VmOnPropertyChanged(object sender, PropertyChangedEventArgs args)
49+
{
50+
if(args.PropertyName == "MenuPaneState")
51+
{
52+
var paneState = (sender as MainViewModel).MenuPaneState;
53+
HamburgerControl.Width = paneState ? 250 : 60;
54+
LogoImage.Visibility = paneState ? Visibility.Visible : Visibility.Collapsed;
55+
56+
57+
}
58+
59+
}
60+
4761
public Tuple<int, string> InitDetails { get; private set; }
4862

49-
public void Navigate(Type page, object args = null)
63+
private void Navigate(Type page, object args = null)
5064
{
5165
MainContent.Navigate(page, args);
5266
}
5367

54-
public void NavigateOff(Type page, object args = null)
68+
private void NavigateOff(Type page, object args = null)
5569
{
5670
OffContent.Navigate(page, args);
5771
}
5872

73+
public SplitViewDisplayMode CurrentDisplayMode { get; }
74+
5975
public void SearchInputFocus(FocusState state)
6076
{
6177
SearchInput.Focus(state);
@@ -70,10 +86,6 @@ public void InitSplitter()
7086
OffContent.UpdateLayout();
7187
}
7288

73-
74-
public HamburgerControl Hamburger => HamburgerControl;
75-
public Grid GridRootContent => RootContentGrid;
76-
public Image Logo => LogoImage;
7789
public Storyboard PinDialogStoryboard => FadeInPinDialogStoryboard;
7890
public Storyboard CurrentStatusStoryboard => FadeInCurrentStatus;
7991
public Storyboard CurrentOffStatusStoryboard => FadeInCurrentOffStatus;
@@ -150,8 +162,8 @@ private void MainContent_OnPointerPressed(object sender, PointerRoutedEventArgs
150162
/// <param name="e"></param>
151163
private void PinPivotItem_OnPointerWheelChanged(object sender, PointerRoutedEventArgs e)
152164
{
153-
ScrollView.ScrollToVerticalOffset(ScrollView.VerticalOffset -
154-
e.GetCurrentPoint(ScrollView).Properties.MouseWheelDelta);
165+
ScrollView.ChangeView(null, ScrollView.VerticalOffset -
166+
e.GetCurrentPoint(ScrollView).Properties.MouseWheelDelta, null);
155167
}
156168

157169
private void PinDialog_OnTapped(object sender, TappedRoutedEventArgs e)

MALClient.Dekstop/Package.StoreAssociation.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,5 +366,5 @@
366366
<AccountPackageIdentityNames>
367367
<MainPackageIdentityName>6252Drutol.Wingur</MainPackageIdentityName>
368368
</AccountPackageIdentityNames>
369-
<PackageInfoList LandingUrl="https://dev.windows.com/dashboard/Application?appId=9NBLGGH5F3BL" />
369+
<PackageInfoList LandingUrl="https://developer.microsoft.com/dashboard/Application?appId=9NBLGGH5F3BL" />
370370
</StoreAssociation>

MALClient.Dekstop/Package.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
3-
<Identity Name="6252Drutol.MALClient" Publisher="CN=15F8BDF5-C01B-487E-8F46-C655AF2C3DD2" Version="4.3.127.0" />
3+
<Identity Name="6252Drutol.MALClient" Publisher="CN=15F8BDF5-C01B-487E-8F46-C655AF2C3DD2" Version="4.4.1.0" />
44
<mp:PhoneIdentity PhoneProductId="41406299-daa6-49b9-b9f3-cae9f0fc041e" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
55
<Properties>
66
<DisplayName>MALClient</DisplayName>

MALClient.Dekstop/Pages/Main/AnimeListPage.xaml.cs

Lines changed: 37 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,42 @@ private get
4444
public Flyout FlyoutFilters => FiltersFlyout;
4545
public MenuFlyout FlyoutSorting => SortingFlyout;
4646

47+
private double _prevWidth;
48+
private double _prevHeight;
49+
private bool _loaded;
50+
private AnimeListPageNavigationArgs _navArgs;
51+
52+
public AnimeListPage()
53+
{
54+
InitializeComponent();
55+
Loaded += (sender, args) =>
56+
{
57+
ViewModel.View = this;
58+
_loaded = true;
59+
ViewModel.CanAddScrollHandler = true;
60+
ViewModel.ScrollIntoViewRequested += ViewModelOnScrollRequest;
61+
ViewModel.SortingSettingChanged += OnSortingSettingChanged;
62+
ViewModel.SelectionResetRequested += ResetSelectionForMode;
63+
ViewModel.Init(_navArgs);
64+
SizeChanged += (s, a) => { ViewModel.UpdateGridItemWidth(a); };
65+
};
66+
67+
68+
ViewModelLocator.GeneralMain.OffContentPaneStateChanged += MainOnOffContentPaneStateChanged;
69+
}
70+
71+
private void MainOnOffContentPaneStateChanged()
72+
{
73+
if (Settings.AnimeListEnsureSelectedItemVisibleAfterOffContentCollapse &&
74+
AnimesGridIndefinite.SelectedItem != null)
75+
AnimesGridIndefinite.ScrollIntoView(AnimesGridIndefinite.SelectedItem);
76+
}
77+
78+
protected override void OnNavigatedTo(NavigationEventArgs e)
79+
{
80+
_navArgs = e.Parameter as AnimeListPageNavigationArgs;
81+
}
82+
4783
public async Task<ScrollViewer> GetIndefiniteScrollViewer()
4884
{
4985
if (!_loaded)
@@ -107,7 +143,7 @@ private void AnimeCompactItemsIndefinite_OnRightTapped(object sender, RightTappe
107143
e.Handled = true;
108144
}
109145

110-
public void ResetSelectionForMode(AnimeListDisplayModes currMode)
146+
private void ResetSelectionForMode(AnimeListDisplayModes currMode)
111147
{
112148
try
113149
{
@@ -244,48 +280,7 @@ private void UpperNavBarPivotOnSelectionChanged(object sender,
244280
ViewModel.StatusSelectorSelectedIndex = UpperNavBarPivot.SelectedIndex;
245281
}
246282

247-
public void SetUpperPivotIndex(int index)
248-
{
249-
UpperNavBarPivot.SelectedIndex = index;
250-
}
251-
252-
#region Init
253-
254-
private double _prevWidth;
255-
private double _prevHeight;
256-
private bool _loaded;
257-
private AnimeListPageNavigationArgs navArgs;
258-
259-
public AnimeListPage()
260-
{
261-
InitializeComponent();
262-
Loaded += (sender, args) =>
263-
{
264-
ViewModel.View = this;
265-
_loaded = true;
266-
ViewModel.CanAddScrollHandler = true;
267-
ViewModel.ScrollIntoViewRequested += ViewModelOnScrollRequest;
268-
ViewModel.SortingSettingChanged += OnSortingSettingChanged;
269-
ViewModel.SelectionResetRequested += ResetSelectionForMode;
270-
ViewModel.Init(navArgs);
271-
};
272-
273-
SizeChanged += (sender, args) => { ViewModel.UpdateGridItemWidth(); };
274-
ViewModelLocator.GeneralMain.OffContentPaneStateChanged += MainOnOffContentPaneStateChanged;
275-
}
276-
277-
private void MainOnOffContentPaneStateChanged()
278-
{
279-
if (Settings.AnimeListEnsureSelectedItemVisibleAfterOffContentCollapse &&
280-
AnimesGridIndefinite.SelectedItem != null)
281-
AnimesGridIndefinite.ScrollIntoView(AnimesGridIndefinite.SelectedItem);
282-
}
283283

284-
protected override void OnNavigatedTo(NavigationEventArgs e)
285-
{
286-
navArgs = e.Parameter as AnimeListPageNavigationArgs;
287-
}
288284

289-
#endregion
290285
}
291286
}

MALClient.Dekstop/UserControls/New/HamburgerControl.xaml.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,15 @@ public HamburgerControl()
4242
private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
4343
{
4444
ViewModel.UpdateProfileImg();
45-
if (Settings.HamburgerAnimeFiltersExpanded)
46-
ButtonExpandAnimeFiltersOnClick(null, null);
47-
if (Settings.HamburgerMangaFiltersExpanded)
48-
ButtonExpandMangaFiltersOnClick(null, null);
49-
if (Settings.HamburgerTopCategoriesExpanded)
50-
ButtonExpandTopCategoriesOnClick(null, null);
45+
if (DesktopViewModelLocator.Main.MenuPaneState)
46+
{
47+
if (Settings.HamburgerAnimeFiltersExpanded)
48+
ButtonExpandAnimeFiltersOnClick(null, null);
49+
if (Settings.HamburgerMangaFiltersExpanded)
50+
ButtonExpandMangaFiltersOnClick(null, null);
51+
if (Settings.HamburgerTopCategoriesExpanded)
52+
ButtonExpandTopCategoriesOnClick(null, null);
53+
}
5154

5255
FeedbackImage.Source = Settings.SelectedTheme == ApplicationTheme.Dark
5356
? new BitmapImage(new Uri("ms-appx:///Assets/GitHub-Mark-Light-120px-plus.png"))

MALClient.Dekstop/Utils/Managers/NavMgr.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void CurrentViewOnBackRequested()
5757

5858
public void DeregisterBackNav()
5959
{
60-
throw new System.NotImplementedException();
60+
6161
}
6262

6363
public void ResetBackNav()

0 commit comments

Comments
 (0)