diff --git a/.gitmodules b/.gitmodules
index 84fa031..e69de29 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +0,0 @@
-[submodule "Prism"]
- path = Prism
- url = https://github.com/SunboX/Prism.git
diff --git a/NextcloudApp.sln b/NextcloudApp.sln
index f59c6cd..df3aff3 100644
--- a/NextcloudApp.sln
+++ b/NextcloudApp.sln
@@ -1,18 +1,12 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
-VisualStudioVersion = 15.0.26730.12
+VisualStudioVersion = 15.0.26730.10
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NextcloudApp", "NextcloudApp\NextcloudApp.csproj", "{99EFB7EA-88A3-4FCF-9289-22734215B5CF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NextcloudClientPortable", "NextcloudClientPortable\NextcloudClientPortable.csproj", "{07797E3B-7077-43EF-8197-F8723E2B0CC4}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Prism.Unity.Windows", "Prism\Source\Windows10\Prism.Unity.Windows\Prism.Unity.Windows.csproj", "{B4060AD6-7A34-479C-B5EB-4C542A681F42}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Prism", "Prism\Source\Prism\Prism.csproj", "{E9D9A366-83B7-4036-89A1-5A09C84081C2}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Prism.Windows", "Prism\Source\Windows10\Prism.Windows\Prism.Windows.csproj", "{3B7C3599-A336-4DB2-8678-710E3B36203B}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -87,78 +81,6 @@ Global
{07797E3B-7077-43EF-8197-F8723E2B0CC4}.Test|x64.Build.0 = Release|x64
{07797E3B-7077-43EF-8197-F8723E2B0CC4}.Test|x86.ActiveCfg = Release|x86
{07797E3B-7077-43EF-8197-F8723E2B0CC4}.Test|x86.Build.0 = Release|x86
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Debug|ARM.ActiveCfg = Debug|ARM
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Debug|ARM.Build.0 = Debug|ARM
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Debug|x64.ActiveCfg = Debug|x64
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Debug|x64.Build.0 = Debug|x64
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Debug|x86.ActiveCfg = Debug|x86
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Debug|x86.Build.0 = Debug|x86
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Release|Any CPU.Build.0 = Release|Any CPU
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Release|ARM.ActiveCfg = Release|ARM
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Release|ARM.Build.0 = Release|ARM
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Release|x64.ActiveCfg = Release|x64
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Release|x64.Build.0 = Release|x64
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Release|x86.ActiveCfg = Release|x86
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Release|x86.Build.0 = Release|x86
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Test|Any CPU.ActiveCfg = Release|Any CPU
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Test|Any CPU.Build.0 = Release|Any CPU
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Test|ARM.ActiveCfg = Release|ARM
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Test|ARM.Build.0 = Release|ARM
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Test|x64.ActiveCfg = Release|x64
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Test|x64.Build.0 = Release|x64
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Test|x86.ActiveCfg = Release|x86
- {B4060AD6-7A34-479C-B5EB-4C542A681F42}.Test|x86.Build.0 = Release|x86
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Debug|ARM.ActiveCfg = Debug|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Debug|ARM.Build.0 = Debug|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Debug|x64.ActiveCfg = Debug|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Debug|x64.Build.0 = Debug|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Debug|x86.ActiveCfg = Debug|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Debug|x86.Build.0 = Debug|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Release|Any CPU.Build.0 = Release|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Release|ARM.ActiveCfg = Release|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Release|ARM.Build.0 = Release|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Release|x64.ActiveCfg = Release|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Release|x64.Build.0 = Release|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Release|x86.ActiveCfg = Release|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Release|x86.Build.0 = Release|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Test|Any CPU.ActiveCfg = Release|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Test|Any CPU.Build.0 = Release|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Test|ARM.ActiveCfg = Release|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Test|ARM.Build.0 = Release|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Test|x64.ActiveCfg = Release|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Test|x64.Build.0 = Release|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Test|x86.ActiveCfg = Release|Any CPU
- {E9D9A366-83B7-4036-89A1-5A09C84081C2}.Test|x86.Build.0 = Release|Any CPU
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Debug|ARM.ActiveCfg = Debug|ARM
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Debug|ARM.Build.0 = Debug|ARM
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Debug|x64.ActiveCfg = Debug|x64
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Debug|x64.Build.0 = Debug|x64
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Debug|x86.ActiveCfg = Debug|x86
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Debug|x86.Build.0 = Debug|x86
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Release|Any CPU.Build.0 = Release|Any CPU
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Release|ARM.ActiveCfg = Release|ARM
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Release|ARM.Build.0 = Release|ARM
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Release|x64.ActiveCfg = Release|x64
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Release|x64.Build.0 = Release|x64
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Release|x86.ActiveCfg = Release|x86
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Release|x86.Build.0 = Release|x86
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Test|Any CPU.ActiveCfg = Release|Any CPU
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Test|Any CPU.Build.0 = Release|Any CPU
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Test|ARM.ActiveCfg = Release|ARM
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Test|ARM.Build.0 = Release|ARM
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Test|x64.ActiveCfg = Release|x64
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Test|x64.Build.0 = Release|x64
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Test|x86.ActiveCfg = Release|x86
- {3B7C3599-A336-4DB2-8678-710E3B36203B}.Test|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/NextcloudApp/App.xaml b/NextcloudApp/App.xaml
index cd367d4..d8864c9 100644
--- a/NextcloudApp/App.xaml
+++ b/NextcloudApp/App.xaml
@@ -39,6 +39,9 @@
+
+
+
diff --git a/NextcloudApp/App.xaml.cs b/NextcloudApp/App.xaml.cs
index d68418e..2090662 100644
--- a/NextcloudApp/App.xaml.cs
+++ b/NextcloudApp/App.xaml.cs
@@ -38,8 +38,9 @@ sealed partial class App
///
public App()
{
- UnhandledException += OnUnhandledException;
+ UnhandledException += OnUnhandledExceptionAsync;
TaskScheduler.UnobservedTaskException += TaskSchedulerOnUnobservedTaskException;
+
InitializeComponent();
}
@@ -57,7 +58,7 @@ private async void TaskSchedulerOnUnobservedTaskException(object sender, Unobser
exceptionStackTrace, args.Exception.InnerException.GetType().ToString(), exceptionHashCode);
}
- private async void OnUnhandledException(object sender, UnhandledExceptionEventArgs args)
+ private async void OnUnhandledExceptionAsync(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs args)
{
var exceptionStackTrace = string.Empty;
try
@@ -148,6 +149,7 @@ private async void OnUnhandledException(object sender, UnhandledExceptionEventAr
protected override UIElement CreateShell(Frame rootFrame)
{
+ ThemeManager.Instance.Initialize();
var shell = Container.Resolve();
shell.SetContentFrame(rootFrame);
return shell;
@@ -353,6 +355,7 @@ protected override Task OnLaunchApplicationAsync(LaunchActivatedEventArgs args)
{
// Ensure the current window is active
Window.Current.Activate();
+
// Remove unnecessary notifications whenever the app is used.
ToastNotificationManager.History.RemoveGroup(ToastNotificationService.SyncAction);
PinStartPageParameters pageParameters = null;
diff --git a/NextcloudApp/AppShell.xaml b/NextcloudApp/AppShell.xaml
index 5ca09f1..ae8199c 100644
--- a/NextcloudApp/AppShell.xaml
+++ b/NextcloudApp/AppShell.xaml
@@ -1,140 +1,57 @@
-
+ mc:Ignorable="d"
+ x:Name="AppShellControl">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
+
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ Visibility="{Binding SettingsHeaderVisible, ElementName=AppShellControl, Converter={StaticResource BooleanToVisibilityConverter}}"
+ Text="Settings"
+ x:Uid="Settings2"
+ Margin="8,0,0,0"
+ VerticalAlignment="Center"
+ Foreground="White"/>
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/NextcloudApp/AppShell.xaml.cs b/NextcloudApp/AppShell.xaml.cs
index a082c05..f664407 100644
--- a/NextcloudApp/AppShell.xaml.cs
+++ b/NextcloudApp/AppShell.xaml.cs
@@ -1,22 +1,52 @@
-using Windows.UI.Xaml;
+using Windows.ApplicationModel;
+using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
+using Microsoft.Practices.Unity;
using NextcloudApp.Services;
+using Prism.Unity.Windows;
+using Prism.Windows.AppModel;
+using System.Collections.Generic;
+using Prism.Windows.Navigation;
+using NextcloudApp.Controls;
+using System.Diagnostics;
+using Windows.UI.Xaml.Media;
+using System.ComponentModel;
+using NextcloudApp.Annotations;
+using System.Runtime.CompilerServices;
namespace NextcloudApp
{
- public sealed partial class AppShell
+ public partial class AppShell : ThemeablePage, INotifyPropertyChanged
{
+ private const string CurrentPageTokenKey = "CurrentPageToken";
+ private readonly Dictionary _canNavigateLookup = new Dictionary();
+ private PageToken _currentPageToken;
+ private bool _pathStackHeaderVisible = true;
+ private bool _settingsHeaderVisible = false;
+ private readonly INavigationService _navigationService;
+ private readonly ISessionStateService _sessionStateService;
+ private readonly IResourceLoader _resourceLoader;
+
public AppShell()
{
InitializeComponent();
+
+ if (DesignMode.DesignModeEnabled) return;
+ if (PrismUnityApplication.Current is App app)
+ {
+ _navigationService = app.Container.Resolve();
+ _sessionStateService = app.Container.Resolve();
+ _resourceLoader = app.Container.Resolve();
+
+ }
ShowUpdateMessage();
}
-
+
private void ShowUpdateMessage()
{
if (SettingsService.Default.Value.LocalSettings.ShowUpdateMessage)
{
- UpdateNotificationService.NotifyUser(UpdateDialogContainer, UpdateDialogTitle, UpdateDialogContent, UpdateDialogButton1, UpdateDialogButton2);
+ //UpdateNotificationService.NotifyUser(UpdateDialogContainer, UpdateDialogTitle, UpdateDialogContent, UpdateDialogButton1, UpdateDialogButton2);
}
else
{
@@ -24,7 +54,7 @@ private void ShowUpdateMessage()
{
if (args.PropertyName.Equals("ShowUpdateMessage") && SettingsService.Default.Value.LocalSettings.ShowUpdateMessage)
{
- UpdateNotificationService.NotifyUser(UpdateDialogContainer, UpdateDialogTitle, UpdateDialogContent, UpdateDialogButton1, UpdateDialogButton2);
+ //UpdateNotificationService.NotifyUser(UpdateDialogContainer, UpdateDialogTitle, UpdateDialogContent, UpdateDialogButton1, UpdateDialogButton2);
}
};
}
@@ -32,17 +62,228 @@ private void ShowUpdateMessage()
public void SetContentFrame(Frame frame)
{
- RootSplitView.Content = frame;
+ frame.Navigated += Frame_Navigated;
+ NavView.Content = frame;
+ }
+
+ private void Frame_Navigated(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e)
+ {
+
}
public void SetMenuPaneContent(UIElement content)
{
- RootSplitView.Pane = content;
+ // RootSplitView.Pane = content;
}
public UIElement GetContentFrame()
{
- return RootSplitView.Content;
+ return (UIElement) NavView.Content;
+ }
+
+ private void NavView_Loaded(object sender, RoutedEventArgs e)
+ {
+ foreach (PageToken pageToken in System.Enum.GetValues(typeof(PageToken)))
+ {
+ _canNavigateLookup.Add(pageToken, true);
+ }
+
+
+ //NavView.MenuItems.Add(new NavigationViewItemSeparator());
+ //< NavigationViewItemHeader Content = "Main pages" />
+
+
+ NavView.MenuItems.Add(new NavigationViewItem
+ {
+ Content = new Models.MenuItem
+ {
+ DisplayName = _resourceLoader.GetString("AllFiles"),
+ PageToken = PageToken.DirectoryList
+ },
+ Icon = new FontIcon { Glyph = "\uE8B7" }
+ });
+
+ NavView.MenuItems.Add(new NavigationViewItem
+ {
+ Content = new Models.MenuItem
+ {
+ DisplayName = _resourceLoader.GetString("Favorites"),
+ PageToken = PageToken.Favorites
+ },
+ Icon = new FontIcon { Glyph = "\uE734" }
+ });
+
+ NavView.MenuItems.Add(new NavigationViewItem
+ {
+ Content = new Models.MenuItem
+ {
+ DisplayName = _resourceLoader.GetString("SharingIn"),
+ PageToken = PageToken.SharesIn
+ },
+ Icon = new FontIcon { Glyph = "\uF003" }
+ });
+
+ NavView.MenuItems.Add(new NavigationViewItem
+ {
+ Content = new Models.MenuItem
+ {
+ DisplayName = _resourceLoader.GetString("SharingOut"),
+ PageToken = PageToken.SharesOut
+ },
+ Icon = new FontIcon { Glyph = "\uF003" }
+ });
+
+ NavView.MenuItems.Add(new NavigationViewItem
+ {
+ Content = new Models.MenuItem
+ {
+ DisplayName = _resourceLoader.GetString("SharingLink"),
+ PageToken = PageToken.SharesLink
+ },
+ Icon = new FontIcon { Glyph = "\uE167" }
+ });
+
+ foreach (var item in NavView.MenuItems)
+ {
+ var navViewItem = item as NavigationViewItem;
+ if (
+ navViewItem == null ||
+ (navViewItem.Content as Models.MenuItem).PageToken != PageToken.DirectoryList
+ )
+ {
+ continue;
+ }
+ NavView.SelectedItem = item;
+ break;
+ }
+ }
+
+ private void NavView_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
+ {
+ }
+
+ public bool PathStackHeaderVisible {
+ get => _pathStackHeaderVisible;
+ internal set
+ {
+ _pathStackHeaderVisible = value;
+ OnPropertyChanged();
+ }
+ }
+ public bool SettingsHeaderVisible {
+ get => _settingsHeaderVisible;
+ internal set
+ {
+ _settingsHeaderVisible = value;
+ OnPropertyChanged();
+ }
+ }
+
+ private void NavView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
+ {
+ if (args.IsSettingsInvoked == true)
+ {
+ PathStackHeaderVisible = false;
+ SettingsHeaderVisible = true;
+ NavigateToPage(PageToken.Settings);
+ }
+ else
+ {
+ PathStackHeaderVisible = true;
+ SettingsHeaderVisible = false;
+ NavigateToPage((args.InvokedItem as Models.MenuItem).PageToken);
+ }
+ }
+
+ ///
+ /// Extension method for a FrameworkElement that searches for a child element by type and name.
+ ///
+ /// The type of the child element to search for.
+ /// The parent framework element.
+ /// The name of the child element to search for.
+ /// The matching child element, or null if none found.
+ public static T FindElementByName(FrameworkElement element, string sChildName) where T : FrameworkElement
+ {
+ Debug.WriteLine("[FindElementByName] ==> element [{0}] sChildName [{1}] T [{2}]", element, sChildName, typeof(T).ToString());
+
+ T childElement = null;
+
+ //
+ // Spin through immediate children of the starting element.
+ //
+ var nChildCount = VisualTreeHelper.GetChildrenCount(element);
+ for (int i = 0; i < nChildCount; i++)
+ {
+ // Get next child element.
+ FrameworkElement child = VisualTreeHelper.GetChild(element, i) as FrameworkElement;
+ Debug.WriteLine("Found child [{0}]", child);
+
+ // Do we have a child?
+ if (child == null)
+ continue;
+
+ // Is child of desired type and name?
+ if (child is T && child.Name.Equals(sChildName))
+ {
+ // Bingo! We found a match.
+ childElement = (T)child;
+ Debug.WriteLine("Found matching element [{0}]", childElement);
+ break;
+ } // if
+
+ // Recurse and search through this child's descendants.
+ childElement = FindElementByName(child, sChildName);
+
+ // Did we find a matching child?
+ if (childElement != null)
+ break;
+ } // for
+
+ Debug.WriteLine("[FindElementByName] <== childElement [{0}]", childElement);
+ return childElement;
+ }
+
+ private void NavigateToPage(PageToken pageToken)
+ {
+ if (!CanNavigateToPage(pageToken))
+ {
+ return;
+ }
+ if (!_navigationService.Navigate(pageToken.ToString(), null))
+ {
+ return;
+ }
+ UpdateCanNavigateLookup(pageToken);
+ //RaiseCanExecuteChanged();
+ }
+
+ private bool CanNavigateToPage(PageToken pageToken)
+ {
+ return _canNavigateLookup[pageToken];
+ }
+
+ private void UpdateCanNavigateLookup(PageToken navigatedTo)
+ {
+ if (navigatedTo == _currentPageToken)
+ {
+ return;
+ }
+ _canNavigateLookup[_currentPageToken] = true;
+ _canNavigateLookup[navigatedTo] = false;
+ _currentPageToken = navigatedTo;
+ //ShowMenuButton =
+ // _currentPageToken != PageToken.Login &&
+ // _currentPageToken != PageToken.FileDownload &&
+ // _currentPageToken != PageToken.FileUpload;
+ //IsMenuOpen = false;
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ [NotifyPropertyChangedInvocator]
+ protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
+ {
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}
diff --git a/NextcloudApp/Controls/FileOrFolderListZoomedOutView.xaml b/NextcloudApp/Controls/FileOrFolderListZoomedOutView.xaml
new file mode 100644
index 0000000..62ec3aa
--- /dev/null
+++ b/NextcloudApp/Controls/FileOrFolderListZoomedOutView.xaml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/NextcloudApp/Controls/FileOrFolderListZoomedOutView.xaml.cs b/NextcloudApp/Controls/FileOrFolderListZoomedOutView.xaml.cs
new file mode 100644
index 0000000..ea2c5b9
--- /dev/null
+++ b/NextcloudApp/Controls/FileOrFolderListZoomedOutView.xaml.cs
@@ -0,0 +1,16 @@
+using NextcloudApp.Models;
+using NextcloudApp.Services;
+
+namespace NextcloudApp.Controls
+{
+ public sealed partial class FileOrFolderListZoomedOutView
+ {
+ public FileOrFolderListZoomedOutView()
+ {
+ InitializeComponent();
+ }
+ public DirectoryService Directory => DirectoryService.Instance;
+
+ public LocalSettings Settings => SettingsService.Default.Value.LocalSettings;
+ }
+}
diff --git a/NextcloudApp/Controls/FilesAndFoldersStatusBar.xaml b/NextcloudApp/Controls/FilesAndFoldersStatusBar.xaml
new file mode 100644
index 0000000..2d13420
--- /dev/null
+++ b/NextcloudApp/Controls/FilesAndFoldersStatusBar.xaml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/NextcloudApp/Controls/FilesAndFoldersStatusBar.xaml.cs b/NextcloudApp/Controls/FilesAndFoldersStatusBar.xaml.cs
new file mode 100644
index 0000000..a97f169
--- /dev/null
+++ b/NextcloudApp/Controls/FilesAndFoldersStatusBar.xaml.cs
@@ -0,0 +1,40 @@
+using System.ComponentModel;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using NextcloudApp.Annotations;
+using NextcloudApp.Services;
+
+namespace NextcloudApp.Controls
+{
+ public sealed partial class FilesAndFoldersStatusBar : INotifyPropertyChanged
+ {
+ public FilesAndFoldersStatusBar()
+ {
+ InitializeComponent();
+ DirectoryService.Instance.PropertyChanged += InstanceOnPropertyChanged;
+ }
+
+ private void InstanceOnPropertyChanged(object sender, PropertyChangedEventArgs propertyChangedEventArgs)
+ {
+ OnPropertyChanged(nameof(StatusBarText));
+ }
+
+ public string StatusBarText
+ {
+ get
+ {
+ var folderCount = DirectoryService.Instance?.FilesAndFolders.Count(x => x.IsDirectory);
+ var fileCount = DirectoryService.Instance?.FilesAndFolders.Count(x => !x.IsDirectory);
+ return string.Format(LocalizationService.Instance?.GetString("DirectoryListStatusBarText"), fileCount + folderCount, folderCount, fileCount);
+ }
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ [NotifyPropertyChangedInvocator]
+ private void OnPropertyChanged([CallerMemberName] string propertyName = null)
+ {
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+}
diff --git a/NextcloudApp/Controls/PathStackHeader.xaml b/NextcloudApp/Controls/PathStackHeader.xaml
new file mode 100644
index 0000000..ae1ff5a
--- /dev/null
+++ b/NextcloudApp/Controls/PathStackHeader.xaml
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/NextcloudApp/Controls/PathStackHeader.xaml.cs b/NextcloudApp/Controls/PathStackHeader.xaml.cs
new file mode 100644
index 0000000..0e21005
--- /dev/null
+++ b/NextcloudApp/Controls/PathStackHeader.xaml.cs
@@ -0,0 +1,49 @@
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
+using NextcloudApp.Annotations;
+using NextcloudApp.Services;
+
+namespace NextcloudApp.Controls
+{
+ public sealed partial class PathStackHeader : INotifyPropertyChanged
+ {
+ public PathStackHeader()
+ {
+ InitializeComponent();
+ }
+
+ public DirectoryService Directory => DirectoryService.Instance;
+
+ public int SelectedPathIndex
+ {
+ get => -1;
+ set
+ {
+ if (value == -1)
+ {
+ return;
+ }
+
+ if (Directory?.PathStack == null)
+ {
+ return;
+ }
+
+ while (Directory.PathStack.Count > 0 && Directory.PathStack.Count > value + 1)
+ {
+ Directory.PathStack.RemoveAt(Directory.PathStack.Count - 1);
+ }
+
+ OnPropertyChanged();
+ }
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ [NotifyPropertyChangedInvocator]
+ private void OnPropertyChanged([CallerMemberName] string propertyName = null)
+ {
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+}
diff --git a/NextcloudApp/Controls/UserInfo.xaml b/NextcloudApp/Controls/UserInfo.xaml
new file mode 100644
index 0000000..da72c97
--- /dev/null
+++ b/NextcloudApp/Controls/UserInfo.xaml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/NextcloudApp/Controls/UserInfo.xaml.cs b/NextcloudApp/Controls/UserInfo.xaml.cs
new file mode 100644
index 0000000..bcc5b25
--- /dev/null
+++ b/NextcloudApp/Controls/UserInfo.xaml.cs
@@ -0,0 +1,128 @@
+using System;
+using Windows.UI.Xaml.Controls;
+using Windows.Networking.Connectivity;
+using NextcloudApp.Converter;
+using NextcloudApp.Services;
+using NextcloudApp.Utils;
+using NextcloudClient.Exceptions;
+using NextcloudClient.Types;
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
+using NextcloudApp.Annotations;
+using System.Globalization;
+
+namespace NextcloudApp.Controls
+{
+ public partial class UserInfo : UserControl, INotifyPropertyChanged
+ {
+ private User _user;
+ private Uri _userAvatarUrl;
+ private string _quotaUsedOfTotalString;
+
+ public UserInfo()
+ {
+ InitializeComponent();
+
+ SettingsService.Default.Value.LocalSettings.PropertyChanged += (sender, args) =>
+ {
+ GetUserInformation();
+ };
+ GetUserInformation();
+ }
+
+ private async void GetUserInformation()
+ {
+ var client = await ClientService.GetClient();
+ if (client == null)
+ {
+ return;
+ }
+
+ var username = SettingsService.Default.Value.LocalSettings.Username;
+
+ if (string.IsNullOrEmpty(username))
+ return;
+
+ try
+ {
+ User = await client.GetUserAttributes(username);
+
+ var converter = new BytesToHumanReadableConverter();
+ QuotaUsedOfTotalString = LocalizationService.Instance.GetString(
+ "QuotaUsedOfTotal",
+ converter.Convert(User.Quota.Used, typeof(string), null, CultureInfo.CurrentCulture.ToString()),
+ converter.Convert(User.Quota.Total, typeof(string), null, CultureInfo.CurrentCulture.ToString())
+ );
+
+ switch (SettingsService.Default.Value.LocalSettings.PreviewImageDownloadMode)
+ {
+ case PreviewImageDownloadMode.Always:
+ UserAvatarUrl = await client.GetUserAvatarUrl(username, 120);
+ break;
+ case PreviewImageDownloadMode.WiFiOnly:
+ var connectionProfile = NetworkInformation.GetInternetConnectionProfile();
+ // connectionProfile can be null (e.g. airplane mode)
+ if (connectionProfile != null && connectionProfile.IsWlanConnectionProfile)
+ {
+ UserAvatarUrl = await client.GetUserAvatarUrl(username, 120);
+ }
+ break;
+ case PreviewImageDownloadMode.Never:
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+ catch (ResponseError e)
+ {
+ ResponseErrorHandlerService.HandleException(e);
+ }
+ }
+
+ public string QuotaUsedOfTotalString
+ {
+ get => _quotaUsedOfTotalString;
+ set {
+ if (_quotaUsedOfTotalString == value)
+ {
+ return;
+ }
+ _quotaUsedOfTotalString = value;
+ OnPropertyChanged();
+ }
+ }
+
+ public User User
+ {
+ get => _user;
+ set {
+ if (_user == value)
+ {
+ return;
+ }
+ _user = value;
+ OnPropertyChanged();
+ }
+ }
+
+ public Uri UserAvatarUrl
+ {
+ get => _userAvatarUrl;
+ set {
+ if (_userAvatarUrl == value)
+ {
+ return;
+ }
+ _userAvatarUrl = value;
+ OnPropertyChanged();
+ }
+ }
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ [NotifyPropertyChangedInvocator]
+ protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
+ {
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+}
diff --git a/NextcloudApp/Models/MenuItem.cs b/NextcloudApp/Models/MenuItem.cs
index c82ebaf..70ecce8 100644
--- a/NextcloudApp/Models/MenuItem.cs
+++ b/NextcloudApp/Models/MenuItem.cs
@@ -11,6 +11,8 @@ public class MenuItem : ViewModel
public ICommand Command { get; set; }
+ public PageToken PageToken { get; internal set; }
+
public override string ToString()
{
return DisplayName;
diff --git a/NextcloudApp/Models/RoamingSettings.cs b/NextcloudApp/Models/RoamingSettings.cs
index cdc2ad5..7a54f25 100644
--- a/NextcloudApp/Models/RoamingSettings.cs
+++ b/NextcloudApp/Models/RoamingSettings.cs
@@ -19,14 +19,31 @@ public RoamingSettings()
}
// As only serializable objects can be stored in the LocalSettings, we use a string internally.
- [DefaultSettingValue(Value = Theme.System)]
+ [DefaultSettingValue(Value = Theme.Light)]
public Theme Theme
{
get
{
var strVal = Get();
- return string.IsNullOrEmpty(strVal) ? Theme.System : JsonConvert.DeserializeObject(strVal);
+ return string.IsNullOrEmpty(strVal) ? Theme.Light : JsonConvert.DeserializeObject(strVal);
+ }
+ set
+ {
+ var strVal = JsonConvert.SerializeObject(value);
+ Set(strVal);
+ }
+ }
+
+ // As only serializable objects can be stored in the LocalSettings, we use a string internally.
+ [DefaultSettingValue(Value = ThemeColor.Nextcloud)]
+ public ThemeColor ThemeColor
+ {
+ get
+ {
+ var strVal = Get();
+
+ return string.IsNullOrEmpty(strVal) ? ThemeColor.Nextcloud : JsonConvert.DeserializeObject(strVal);
}
set
{
diff --git a/NextcloudApp/NextcloudApp.csproj b/NextcloudApp/NextcloudApp.csproj
index 15df3ff..a2a8b11 100644
--- a/NextcloudApp/NextcloudApp.csproj
+++ b/NextcloudApp/NextcloudApp.csproj
@@ -1,495 +1,537 @@
-
-
-
-
- Debug
- x86
- {99EFB7EA-88A3-4FCF-9289-22734215B5CF}
- AppContainerExe
- Properties
- NextcloudApp
- NextcloudApp
- en
- UAP
- 10.0.15063.0
- 10.0.15063.0
- 14
- 512
- {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- NextcloudApp_StoreKey.pfx
- FF3446F276329AC954729FBEA0FCDCB5FBBCB7A3
- False
- Always
- x86|x64|arm
- win10-arm;win10-arm-aot;win10-x86;win10-x86-aot;win10-x64;win10-x64-aot
-
-
- true
- bin\x86\Debug\
- TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;CODE_ANALYSIS;DISABLE_XAML_GENERATED_BINDING_DEBUG_OUTPUT;DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
- ;2008
- full
- x86
- false
- prompt
- true
-
-
- bin\x86\Release\
- TRACE;NETFX_CORE;WINDOWS_UWP
- true
- ;2008
- pdbonly
- x86
- false
- prompt
- true
- true
-
-
- true
- bin\ARM\Debug\
- TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
- ;2008
- full
- ARM
- false
- prompt
- true
-
-
- bin\ARM\Release\
- TRACE;NETFX_CORE;WINDOWS_UWP
- true
- ;2008
- pdbonly
- ARM
- false
- prompt
- true
- true
-
-
- true
- bin\x64\Debug\
- DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
- ;2008
- full
- x64
- false
- prompt
- true
-
-
- bin\x64\Release\
- TRACE;NETFX_CORE;WINDOWS_UWP
- true
- ;2008
- pdbonly
- x64
- false
- prompt
- true
- true
-
-
-
-
- PreserveNewest
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- App.xaml
-
-
- AppShell.xaml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ShareTarget.xaml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- SharesLinkPage.xaml
-
-
- SharesInPage.xaml
-
-
- SharesOutPage.xaml
-
-
- FavoritesPage.xaml
-
-
- FileSavePickerPage.xaml
-
-
- FileUploadPage.xaml
-
-
- MoveFileOrFolder.xaml
-
-
- FileDownloadPage.xaml
-
-
- FileInfoPage.xaml
-
-
- SettingsPage.xaml
-
-
- DirectoryListPage.xaml
-
-
-
-
-
- LoginPage.xaml
-
-
-
- MenuView.xaml
-
-
- ShareTargetPage.xaml
-
-
- SyncStatusPage.xaml
-
-
- VerificationPage.xaml
-
-
-
-
- Designer
-
-
-
-
-
- PreserveNewest
-
-
-
-
-
-
-
-
-
-
-
-
-
- MSBuild:Compile
- Designer
-
-
- Designer
- MSBuild:Compile
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
- MSBuild:Compile
- Designer
- PreserveNewest
-
-
- Designer
- MSBuild:Compile
- PreserveNewest
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
- Designer
- MSBuild:Compile
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
- Designer
- MSBuild:Compile
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
- Designer
- MSBuild:Compile
-
-
-
-
- {07797e3b-7077-43ef-8197-f8723e2b0cc4}
- NextcloudClientPortable
-
-
- {e9d9a366-83b7-4036-89a1-5a09c84081c2}
- Prism
-
-
- {b4060ad6-7a34-479c-b5eb-4c542a681f42}
- Prism.Unity.Windows
-
-
- {3b7c3599-a336-4db2-8678-710e3b36203b}
- Prism.Windows
-
-
-
-
-
-
-
-
- Visual C++ 2015 Runtime for Universal Windows Platform Apps
-
-
- SQLite for Universal Windows Platform %28SQLite.UWP.2015, Version=3.21.0%29
-
-
- Windows Mobile Extensions for the UWP
-
-
-
-
-
-
-
- 1.0.21
-
-
- 5.3.4
-
-
- 1.5.1
-
-
- 2.0.0
-
-
- 10.0.3
-
-
- 1.1.6
-
-
- 1.0.0
-
-
- 3.1.1
-
-
-
- 14.0
-
-
+
+
+
+
+ Debug
+ x86
+ {99EFB7EA-88A3-4FCF-9289-22734215B5CF}
+ AppContainerExe
+ Properties
+ NextcloudApp
+ NextcloudApp
+ en
+ UAP
+ 10.0.16299.0
+ 10.0.16299.0
+ 14
+ 512
+ {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ NextcloudApp_StoreKey.pfx
+ FF3446F276329AC954729FBEA0FCDCB5FBBCB7A3
+ False
+ Always
+ x86|x64|arm
+ win10-arm;win10-arm-aot;win10-x86;win10-x86-aot;win10-x64;win10-x64-aot
+
+
+ true
+ bin\x86\Debug\
+ TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;CODE_ANALYSIS;DISABLE_XAML_GENERATED_BINDING_DEBUG_OUTPUT;DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
+ ;2008
+ full
+ x86
+ false
+ prompt
+ true
+
+
+ bin\x86\Release\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ x86
+ false
+ prompt
+ true
+ true
+
+
+ true
+ bin\ARM\Debug\
+ TRACE;DEBUG;NETFX_CORE;WINDOWS_UWP;DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
+ ;2008
+ full
+ ARM
+ false
+ prompt
+ true
+
+
+ bin\ARM\Release\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ ARM
+ false
+ prompt
+ true
+ true
+
+
+ true
+ bin\x64\Debug\
+ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
+ ;2008
+ full
+ x64
+ false
+ prompt
+ true
+
+
+ bin\x64\Release\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ x64
+ false
+ prompt
+ true
+ true
+
+
+
+
+ PreserveNewest
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ App.xaml
+
+
+ AppShell.xaml
+
+
+
+
+
+ FileOrFolderListZoomedOutView.xaml
+
+
+ FilesAndFoldersStatusBar.xaml
+
+
+ PathStackHeader.xaml
+
+
+
+ UserInfo.xaml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ShareTarget.xaml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ SharesLinkPage.xaml
+
+
+ SharesInPage.xaml
+
+
+ SharesOutPage.xaml
+
+
+ FavoritesPage.xaml
+
+
+ FileSavePickerPage.xaml
+
+
+ FileUploadPage.xaml
+
+
+ MoveFileOrFolder.xaml
+
+
+ FileDownloadPage.xaml
+
+
+ FileInfoPage.xaml
+
+
+ SettingsPage.xaml
+
+
+ DirectoryListPage.xaml
+
+
+
+
+
+ LoginPage.xaml
+
+
+
+ MenuView.xaml
+
+
+ ShareTargetPage.xaml
+
+
+ SyncStatusPage.xaml
+
+
+ VerificationPage.xaml
+
+
+
+
+ Designer
+
+
+
+
+
+ PreserveNewest
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ Designer
+ MSBuild:Compile
+ PreserveNewest
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+ PreserveNewest
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+ PreserveNewest
+ true
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+ PreserveNewest
+
+
+ Designer
+ MSBuild:Compile
+ PreserveNewest
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
+
+
+
+ {07797e3b-7077-43ef-8197-f8723e2b0cc4}
+ NextcloudClientPortable
+
+
+
+
+
+
+
+
+ Visual C++ 2015 Runtime for Universal Windows Platform Apps
+
+
+ SQLite for Universal Windows Platform
+
+
+ Windows Mobile Extensions for the UWP
+
+
+
+
+
+
+
+ 1.0.21
+
+
+ 6.0.1
+
+
+ 2.0.0
+
+
+ 2.0.0
+
+
+ 10.0.3
+
+
+ 1.1.6
+
+
+ 6.3.0
+
+
+ 1.0.0
+
+
+ 3.1.1
+
+
+
+ 14.0
+
+
-
- true
-
+ -->
+
+ true
+
\ No newline at end of file
diff --git a/NextcloudApp/Properties/DesignTimeResources.xaml b/NextcloudApp/Properties/DesignTimeResources.xaml
new file mode 100644
index 0000000..8fff7d6
--- /dev/null
+++ b/NextcloudApp/Properties/DesignTimeResources.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
diff --git a/NextcloudApp/Services/DirectoryService.cs b/NextcloudApp/Services/DirectoryService.cs
index 1428287..133c0cd 100644
--- a/NextcloudApp/Services/DirectoryService.cs
+++ b/NextcloudApp/Services/DirectoryService.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+using System.Collections.Specialized;
using System.ComponentModel;
using System.Globalization;
using System.IO;
@@ -14,6 +15,7 @@
using NextcloudApp.Utils;
using NextcloudClient.Exceptions;
using NextcloudClient.Types;
+using System.Threading;
namespace NextcloudApp.Services
{
@@ -26,7 +28,7 @@ public class DirectoryService : INotifyPropertyChanged
private bool _continueListing;
private bool _isSelecting;
private string _selectionMode;
- private Task> _listingTask;
+ private CancellationTokenSource _listingTaskCancellationTokenSource;
private DirectoryService()
{
@@ -36,6 +38,8 @@ private DirectoryService()
// Arrange for the first time, so that the collections get filled.
_groupedFilesAndFolders.ArrangeItems(new NameSorter(SortSequence.Asc), x => x.Name.First().ToString().ToUpper());
_groupedFolders.ArrangeItems(new NameSorter(SortSequence.Asc), x => x.Name.First().ToString().ToUpper());
+
+ PathStack.CollectionChanged += PathStackOnCollectionChanged;
}
public static DirectoryService Instance => _instance ?? (_instance = new DirectoryService());
@@ -53,6 +57,15 @@ private DirectoryService()
}
};
+ private async void PathStackOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs notifyCollectionChangedEventArgs)
+ {
+ StatusBarService.Instance.ShowProgressIndicator();
+
+ await StartDirectoryListing();
+
+ StatusBarService.Instance.HideProgressIndicator();
+ }
+
public ObservableCollection FilesAndFolders { get; } = new ObservableCollection();
public ObservableCollection Folders { get; } = new ObservableCollection();
public ObservableCollection> GroupedFilesAndFolders => _groupedFilesAndFolders.Items;
@@ -216,116 +229,120 @@ public async Task StartDirectoryListing()
public async Task StartDirectoryListing(ResourceInfo resourceInfoToExclude, string viewName = null)
{
- // cancel a current running listing
- if (_listingTask != null)
+ try
{
- _listingTask.AsAsyncAction().Cancel();
- _listingTask = null;
- }
+ // cancel a current running listing
+ if (_listingTaskCancellationTokenSource != null)
+ {
+ _listingTaskCancellationTokenSource.Cancel();
+ }
+ _listingTaskCancellationTokenSource = new CancellationTokenSource();
- // clear instantly, so the user will not see invalid listings
- FilesAndFolders.Clear();
- Folders.Clear();
+ // clear instantly, so the user will not see invalid listings
+ FilesAndFolders.Clear();
+ Folders.Clear();
- var client = await ClientService.GetClient();
+ var client = await ClientService.GetClient();
- if (client == null || IsSelecting)
- {
- return;
- }
-
- _continueListing = true;
+ if (client == null || IsSelecting)
+ {
+ return;
+ }
- if (PathStack.Count == 0)
- {
- PathStack.Add(new PathInfo
+ _continueListing = true;
+
+ var path = PathStack.Count > 0 ? PathStack[PathStack.Count - 1].ResourceInfo.Path : "/";
+ List list = null;
+
+ try
{
- ResourceInfo = new ResourceInfo()
+ Task> listingTask;
+ if (viewName == "sharesIn" | viewName == "sharesOut" | viewName == "sharesLink")
{
- Name = "Nextcloud",
- Path = "/"
- },
- IsRoot = true
- });
- }
+ for (int i = PathStack.Count - 1; i > 0; i--)
+ {
+ PathStack.RemoveAt(i);
+ }
- var path = PathStack.Count > 0 ? PathStack[PathStack.Count - 1].ResourceInfo.Path : "/";
- List list = null;
+ listingTask = client.GetSharesView(viewName);
+ }
+ else if (viewName == "favorites")
+ {
+ for (int i = PathStack.Count - 1; i > 0; i--)
+ {
+ PathStack.RemoveAt(i);
+ }
- try
- {
- if (viewName == "sharesIn" | viewName == "sharesOut" | viewName == "sharesLink")
- {
- PathStack.Clear();
- _listingTask = client.GetSharesView(viewName);
- }
- else if (viewName == "favorites")
- {
- PathStack.Clear();
- _listingTask = client.GetFavorites();
+ listingTask = client.GetFavorites();
+ }
+ else
+ {
+ listingTask = client.List(path);
+ }
+ list = await listingTask.ContinueWith(t => t.GetAwaiter().GetResult(), _listingTaskCancellationTokenSource.Token);
+ _listingTaskCancellationTokenSource = null;
}
- else
+ catch (ResponseError e)
{
- _listingTask = client.List(path);
+ ResponseErrorHandlerService.HandleException(e);
}
- list = await _listingTask;
- }
- catch (ResponseError e)
- {
- ResponseErrorHandlerService.HandleException(e);
- }
-
- if (list != null)
- {
- foreach (var item in list)
+
+ if (list != null)
{
- if (resourceInfoToExclude != null && item == resourceInfoToExclude)
+ foreach (var item in list)
{
- continue;
- }
+ if (resourceInfoToExclude != null && item == resourceInfoToExclude)
+ {
+ continue;
+ }
- FilesAndFolders.Add(new FileOrFolder(item));
+ FilesAndFolders.Add(new FileOrFolder(item));
- if (!item.IsDirectory)
- {
- continue;
- }
- if (RemoveResourceInfos != null)
- {
- var index = RemoveResourceInfos.FindIndex(
- res => res.Path.Equals(item.Path, StringComparison.Ordinal));
- if (index == -1)
+ if (!item.IsDirectory)
+ {
+ continue;
+ }
+ if (RemoveResourceInfos != null)
+ {
+ var index = RemoveResourceInfos.FindIndex(
+ res => res.Path.Equals(item.Path, StringComparison.Ordinal));
+ if (index == -1)
+ {
+ Folders.Add(new FileOrFolder(item));
+ }
+ }
+ else
{
Folders.Add(new FileOrFolder(item));
}
}
- else
- {
- Folders.Add(new FileOrFolder(item));
- }
}
- }
- switch (SettingsService.Default.Value.LocalSettings.PreviewImageDownloadMode)
- {
- case PreviewImageDownloadMode.Always:
- DownloadPreviewImages();
- break;
- case PreviewImageDownloadMode.WiFiOnly:
- var connectionProfile = NetworkInformation.GetInternetConnectionProfile();
- // connectionProfile can be null (e.g. airplane mode)
- if (connectionProfile != null && connectionProfile.IsWlanConnectionProfile)
- {
+ switch (SettingsService.Default.Value.LocalSettings.PreviewImageDownloadMode)
+ {
+ case PreviewImageDownloadMode.Always:
DownloadPreviewImages();
- }
- break;
- case PreviewImageDownloadMode.Never:
- break;
- default:
- throw new ArgumentOutOfRangeException();
- }
+ break;
+ case PreviewImageDownloadMode.WiFiOnly:
+ var connectionProfile = NetworkInformation.GetInternetConnectionProfile();
+ // connectionProfile can be null (e.g. airplane mode)
+ if (connectionProfile != null && connectionProfile.IsWlanConnectionProfile)
+ {
+ DownloadPreviewImages();
+ }
+ break;
+ case PreviewImageDownloadMode.Never:
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
- SortList();
+ SortList();
+ }
+ catch (OperationCanceledException)
+ {
+ // Handle the cancelled Task
+ }
}
private async void DownloadPreviewImages()
diff --git a/NextcloudApp/Services/StatusBarService.cs b/NextcloudApp/Services/StatusBarService.cs
index e3e077e..2b7bafe 100644
--- a/NextcloudApp/Services/StatusBarService.cs
+++ b/NextcloudApp/Services/StatusBarService.cs
@@ -1,9 +1,6 @@
using System;
-using System.ComponentModel;
using Windows.Foundation.Metadata;
-using Windows.UI;
using Windows.UI.ViewManagement;
-using NextcloudApp.Utils;
namespace NextcloudApp.Services
{
@@ -12,52 +9,6 @@ public class StatusBarService
private static StatusBarService _instance;
private int _waitCounter;
- private StatusBarService()
- {
- if (!ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
- {
- return;
- }
- var statusBar = StatusBar.GetForCurrentView();
- statusBar.BackgroundOpacity = 1;
- var theme = SettingsService.Default.Value.RoamingSettings.Theme;
- switch (theme)
- {
- case Theme.Dark:
- statusBar.BackgroundColor = Colors.Black;
- statusBar.ForegroundColor = Colors.White;
- break;
- case Theme.Light:
- statusBar.BackgroundColor = Colors.White;
- statusBar.ForegroundColor = Colors.Black;
- break;
- }
-
- SettingsService.Default.Value.RoamingSettings.PropertyChanged += RoamingSettingsOnPropertyChanged;
- }
-
- private void RoamingSettingsOnPropertyChanged(object sender, PropertyChangedEventArgs e)
- {
- if (!e.PropertyName.Equals("Theme"))
- {
- return;
- }
- var statusBar = StatusBar.GetForCurrentView();
- statusBar.BackgroundOpacity = 1;
- var theme = SettingsService.Default.Value.RoamingSettings.Theme;
- switch (theme)
- {
- case Theme.Dark:
- statusBar.BackgroundColor = Colors.Black;
- statusBar.ForegroundColor = Colors.White;
- break;
- case Theme.Light:
- statusBar.BackgroundColor = Colors.White;
- statusBar.ForegroundColor = Colors.Black;
- break;
- }
- }
-
public static StatusBarService Instance => _instance ?? (_instance = new StatusBarService());
public async void ShowProgressIndicator()
diff --git a/NextcloudApp/Services/ThemeManager.cs b/NextcloudApp/Services/ThemeManager.cs
new file mode 100644
index 0000000..81a2054
--- /dev/null
+++ b/NextcloudApp/Services/ThemeManager.cs
@@ -0,0 +1,147 @@
+using System.ComponentModel;
+using Windows.Foundation.Metadata;
+using Windows.UI;
+using Windows.UI.ViewManagement;
+using Windows.UI.Xaml;
+using NextcloudApp.Utils;
+
+namespace NextcloudApp.Services
+{
+ class ThemeManager
+ {
+ private static ThemeManager _instance;
+
+ public static ThemeManager Instance => _instance ?? (_instance = new ThemeManager());
+
+ public void Initialize()
+ {
+ if (!new AccessibilitySettings().HighContrast)
+ {
+ var color = (Color)Application.Current.Resources["SystemAccentColor"];
+
+ if (SettingsService.Default.Value.RoamingSettings.ThemeColor == ThemeColor.Nextcloud)
+ {
+ color = Color.FromArgb(255, 0, 130, 201);
+
+ Application.Current.Resources["SystemAccentColorLight3"] = ChangeColorBrightness(color, 0.3f);
+ Application.Current.Resources["SystemAccentColorLight2"] = ChangeColorBrightness(color, 0.2f);
+ Application.Current.Resources["SystemAccentColorLight1"] = ChangeColorBrightness(color, 0.1f);
+ Application.Current.Resources["SystemAccentColor"] = color;
+ Application.Current.Resources["SystemAccentColorDark1"] = ChangeColorBrightness(color, -0.1f);
+ Application.Current.Resources["SystemAccentColorDark2"] = ChangeColorBrightness(color, -0.2f);
+ Application.Current.Resources["SystemAccentColorDark3"] = ChangeColorBrightness(color, -0.3f);
+ }
+
+ Application.Current.Resources["HyperlinkButtonForeground"] = color;
+
+ // Get the instance of the Title Bar
+ var titleBar = ApplicationView.GetForCurrentView().TitleBar;
+
+ if (titleBar != null)
+ {
+ // Set the color of the Title Bar content
+ titleBar.BackgroundColor = (Color) Application.Current.Resources["SystemAccentColorDark1"];
+ titleBar.ForegroundColor = Colors.White;
+
+ titleBar.InactiveBackgroundColor = (Color) Application.Current.Resources["SystemAccentColorDark1"];
+ titleBar.InactiveForegroundColor = ChangeColorBrightness(color, 0.5f);
+
+ // Set the color of the Title Bar buttons
+ titleBar.ButtonBackgroundColor = (Color) Application.Current.Resources["SystemAccentColorDark1"];
+ titleBar.ButtonForegroundColor = Colors.White;
+
+ titleBar.ButtonInactiveBackgroundColor =
+ (Color) Application.Current.Resources["SystemAccentColorDark1"];
+ titleBar.ButtonInactiveForegroundColor = ChangeColorBrightness(color, 0.7f);
+
+ titleBar.ButtonHoverBackgroundColor = color;
+ titleBar.ButtonHoverForegroundColor = Colors.White;
+
+ titleBar.ButtonPressedBackgroundColor =
+ (Color) Application.Current.Resources["SystemAccentColorLight1"];
+ titleBar.ButtonPressedForegroundColor = Colors.White;
+ }
+
+ if (!ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
+ {
+ return;
+ }
+
+ var statusBar = StatusBar.GetForCurrentView();
+ statusBar.BackgroundOpacity = 1;
+
+ statusBar.BackgroundColor = (Color)Application.Current.Resources["SystemAccentColorDark1"];
+ statusBar.ForegroundColor = Colors.White;
+
+ //var theme = SettingsService.Default.Value.RoamingSettings.Theme;
+ //switch (theme)
+ //{
+ // case Theme.Dark:
+ // statusBar.BackgroundColor = Colors.Black;
+ // statusBar.ForegroundColor = Colors.White;
+ // break;
+ // case Theme.Light:
+ // statusBar.BackgroundColor = Colors.White;
+ // statusBar.ForegroundColor = Colors.Black;
+ // break;
+ //}
+
+ //SettingsService.Default.Value.RoamingSettings.PropertyChanged += RoamingSettingsOnPropertyChanged;
+ }
+ }
+
+ //private void RoamingSettingsOnPropertyChanged(object sender, PropertyChangedEventArgs e)
+ //{
+ // if (!e.PropertyName.Equals("Theme"))
+ // {
+ // return;
+ // }
+ // var statusBar = StatusBar.GetForCurrentView();
+ // statusBar.BackgroundOpacity = 1;
+ // var theme = SettingsService.Default.Value.RoamingSettings.Theme;
+ // switch (theme)
+ // {
+ // case Theme.Dark:
+ // statusBar.BackgroundColor = Colors.Black;
+ // statusBar.ForegroundColor = Colors.White;
+ // break;
+ // case Theme.Light:
+ // statusBar.BackgroundColor = Colors.White;
+ // statusBar.ForegroundColor = Colors.Black;
+ // break;
+ // }
+ //}
+
+ ///
+ /// Creates color with corrected brightness.
+ ///
+ /// Color to correct.
+ /// The brightness correction factor. Must be between -1 and 1.
+ /// Negative values produce darker colors.
+ ///
+ /// Corrected structure.
+ ///
+ public static Color ChangeColorBrightness(Color color, float correctionFactor)
+ {
+ var red = (float)color.R;
+ var green = (float)color.G;
+ var blue = (float)color.B;
+
+ if (correctionFactor < 0)
+ {
+ correctionFactor = 1 + correctionFactor;
+ red *= correctionFactor;
+ green *= correctionFactor;
+ blue *= correctionFactor;
+ }
+ else
+ {
+ red = (255 - red) * correctionFactor + red;
+ green = (255 - green) * correctionFactor + green;
+ blue = (255 - blue) * correctionFactor + blue;
+ }
+
+ return Color.FromArgb(color.A, (byte)red, (byte)green, (byte)blue);
+ }
+ }
+}
diff --git a/NextcloudApp/Strings/en/Resources.resw b/NextcloudApp/Strings/en/Resources.resw
index 3eae430..d7bc290 100644
--- a/NextcloudApp/Strings/en/Resources.resw
+++ b/NextcloudApp/Strings/en/Resources.resw
@@ -688,4 +688,13 @@ Please try again later.
Are you sure, you want to delete the selected files?
+
+ Nextcloud theme color
+
+
+ Use the system settings
+
+
+ Accent color
+
\ No newline at end of file
diff --git a/NextcloudApp/Themes/AppBarButtonStyle.xaml b/NextcloudApp/Themes/AppBarButtonStyle.xaml
new file mode 100644
index 0000000..a485b87
--- /dev/null
+++ b/NextcloudApp/Themes/AppBarButtonStyle.xaml
@@ -0,0 +1,141 @@
+
+
+
+
diff --git a/NextcloudApp/Themes/CommandBarStyle.xaml b/NextcloudApp/Themes/CommandBarStyle.xaml
new file mode 100644
index 0000000..72a4207
--- /dev/null
+++ b/NextcloudApp/Themes/CommandBarStyle.xaml
@@ -0,0 +1,840 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/NextcloudApp/Themes/ListViewStyle.xaml b/NextcloudApp/Themes/ListViewStyle.xaml
new file mode 100644
index 0000000..1f425a8
--- /dev/null
+++ b/NextcloudApp/Themes/ListViewStyle.xaml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
diff --git a/NextcloudApp/Themes/MenuFlyoutIconItemStyle.xaml b/NextcloudApp/Themes/MenuFlyoutIconItemStyle.xaml
index 84ec644..47f82dc 100644
--- a/NextcloudApp/Themes/MenuFlyoutIconItemStyle.xaml
+++ b/NextcloudApp/Themes/MenuFlyoutIconItemStyle.xaml
@@ -102,4 +102,213 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/NextcloudApp/Themes/SplitViewStyles.xaml b/NextcloudApp/Themes/SplitViewStyles.xaml
index 1f02733..7f60448 100644
--- a/NextcloudApp/Themes/SplitViewStyles.xaml
+++ b/NextcloudApp/Themes/SplitViewStyles.xaml
@@ -1,8 +1,6 @@
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
-
-
-
-
-
-
-
+ Grid.Row="0"
+ Background="{ThemeResource SystemControlAcrylicWindowBrush}">
-
-
-
-
-
-
-
+ Padding="0,4"
+ ItemContainerStyle="{StaticResource FileOrFolderItemContainerStyle}">
+
-
-
-
-
-
-
-
+ Grid.Row="0"
+ Background="{ThemeResource SystemControlAcrylicWindowBrush}">
+ Padding="0,2,0,2">
-
-
-
-
-
-
-
-
+
@@ -89,23 +54,30 @@
-
-
-
-
+ Margin="6,6,10,6">
+
+
+
+
+
+
+
@@ -270,7 +242,7 @@
-
+
@@ -19,79 +16,19 @@
IsSourceGrouped="{Binding Settings.ShowFileAndFolderGroupingHeader}" />
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -279,7 +214,8 @@
-
+
+
+
@@ -28,33 +29,61 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
@@ -86,13 +115,14 @@
Width="52"
Margin="0,0,8,0"
Visibility="{Binding UserAvatarUrl, Converter={StaticResource NullToVisibilityConverter}, ConverterParameter=true}">
-
+
+ LineHeight="47"
+ Foreground="White"/>
@@ -21,79 +17,14 @@
IsSourceGrouped="{Binding Settings.ShowFileAndFolderGroupingHeader}" />
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -282,7 +212,8 @@
-
+
+
@@ -24,15 +22,32 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -21,78 +17,14 @@
IsSourceGrouped="{Binding Settings.ShowFileAndFolderGroupingHeader}" />
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -282,7 +213,7 @@
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ Grid.Row="0"
+ Background="{ThemeResource SystemControlAcrylicWindowBrush}">
+ Padding="0,2,0,2">
-
-
-
-
-
-
-
+ Grid.Row="0"
+ Background="{ThemeResource SystemControlAcrylicWindowBrush}">
+ Padding="0,2,0,2">
-
-
-
-
-
-
-
+ Grid.Row="0"
+ Background="{ThemeResource SystemControlAcrylicWindowBrush}">
+ Padding="0,2,0,2">