diff --git a/README.md b/README.md index 609796c..87b191f 100644 --- a/README.md +++ b/README.md @@ -38,3 +38,4 @@ For sideloaded packages, more info [here](https://docs.microsoft.com/en-us/windo - [制作汉堡菜单及添加滑动手势](https://blog.csdn.net/github_36704374/article/details/59580697) - C_Li_ - [Live Tile](https://github.com/LittleFish33/UWPSample) - LittleFish33 - [唤起应用商城,邮件](https://www.cnblogs.com/MzwCat/p/7667702.html) - 5只猫 +- [占领标题栏](https://blog.csdn.net/cjh623/article/details/100532431) - dino.c diff --git a/True Love/App.xaml b/True Love/App.xaml index 64f24a1..2198f16 100644 --- a/True Love/App.xaml +++ b/True Love/App.xaml @@ -13,7 +13,6 @@ - diff --git a/True Love/App.xaml.cs b/True Love/App.xaml.cs index 868d5d7..267f10f 100644 --- a/True Love/App.xaml.cs +++ b/True Love/App.xaml.cs @@ -78,7 +78,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e) } if (!Generic.DeviceFamilyMatch(DeviceFamilyList.Mobile)) HideTitleBar(); - else HideStatusBarAsync(); + else HideStatusBar(); } } @@ -131,44 +131,57 @@ private void HideTitleBar() CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true; var titleBar = ApplicationView.GetForCurrentView().TitleBar; titleBar.ButtonBackgroundColor = Colors.Transparent; + titleBar.ButtonForegroundColor = Colors.White; + titleBar.ButtonInactiveBackgroundColor = Colors.Transparent; + titleBar.ButtonInactiveForegroundColor = Colors.Gray; + titleBar.ButtonHoverBackgroundColor = Colors.PaleTurquoise; - titleBar.ButtonPressedBackgroundColor = Colors.PaleTurquoise; titleBar.ButtonHoverForegroundColor = Colors.Black; + + titleBar.ButtonPressedBackgroundColor = Colors.PaleTurquoise; + titleBar.ButtonPressedForegroundColor = Colors.White; } /// /// 沉淀状态栏 for Phone /// - private async void HideStatusBarAsync() + private void HideStatusBar() { var applicationView = ApplicationView.GetForCurrentView(); applicationView.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow); //applicationView.TryEnterFullScreenMode(); - var statusbar = StatusBar.GetForCurrentView(); - await statusbar.ShowAsync(); + //var statusbar = StatusBar.GetForCurrentView(); + //await statusbar.ShowAsync(); //await statusbar.ProgressIndicator.HideAsync(); - ApplicationView.GetForCurrentView().VisibleBoundsChanged += (s, e) => - { - var currentHeight = s.VisibleBounds.Height; - - switch (applicationView.Orientation) - { // 横向 + ApplicationView.GetForCurrentView().VisibleBoundsChanged += (s, e) => + { + var currentHeight = s.VisibleBounds.Height; + + switch (applicationView.Orientation) + { // 横向 case ApplicationViewOrientation.Landscape: - MainPage.Current.LayoutRoot.Margin = new Thickness(0); - - break; + MainPage.Current.LayoutRoot.Margin = new Thickness(0); + if (Window.Current.Bounds.Width < 1002) + { + MainPage.Current.NavViewRoot.Margin = new Thickness(48, 0, 48, 0); + MainPage.Current.CommandBar.Margin = new Thickness(0, 0, 48, 0); + } + + break; // 纵向 case ApplicationViewOrientation.Portrait: - if (currentHeight < GenericVariableConverter.oldHeight) MainPage.Current.LayoutRoot.Margin = new Thickness(0, 0, 0, 50); - else if (currentHeight > GenericVariableConverter.oldHeight) MainPage.Current.LayoutRoot.Margin = new Thickness(0); - break; - } - GenericVariableConverter.oldHeight = s.VisibleBounds.Height; - }; + if (currentHeight < GenericVariableConverter.oldHeight) MainPage.Current.LayoutRoot.Margin = new Thickness(0, 0, 0, 48); + else if (currentHeight > GenericVariableConverter.oldHeight) MainPage.Current.LayoutRoot.Margin = new Thickness(0); + MainPage.Current.NavViewRoot.Margin = new Thickness(0); + MainPage.Current.CommandBar.Margin = new Thickness(0); + break; + } + GenericVariableConverter.oldHeight = s.VisibleBounds.Height; + }; } } } diff --git a/True Love/Package.appxmanifest b/True Love/Package.appxmanifest index 023dce1..7784f5c 100644 --- a/True Love/Package.appxmanifest +++ b/True Love/Package.appxmanifest @@ -1,6 +1,6 @@  - + True Love - Tim Bergling Foundtion diff --git a/True Love/Pages/DeviceFamily-Mobile/MainPage.xaml b/True Love/Pages/DeviceFamily-Mobile/MainPage.xaml index a1fae6a..b4a3879 100644 --- a/True Love/Pages/DeviceFamily-Mobile/MainPage.xaml +++ b/True Love/Pages/DeviceFamily-Mobile/MainPage.xaml @@ -3,8 +3,6 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:upOS1709="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 5)" - xmlns:upOS1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:muxc="using:Microsoft.UI.Xaml.Controls" mc:Ignorable="d" x:Name="Main" RequestedTheme="Dark" @@ -41,65 +39,42 @@ - - - - + Background="{ThemeResource NavigationViewTopPaneBackground}"> - - - - - - + + + - - - - - - - - - + > - - - + IsEnabled="{Binding ElementName=CommentPage,Path=IsSelected}"> - - - + Visibility="Collapsed"> + + + @@ -147,7 +124,6 @@ - @@ -159,12 +135,11 @@ + MinWindowWidth="{StaticResource MediumWindowBreakpoint}"/> - diff --git a/True Love/Pages/DeviceFamily-Mobile/SettingsPage.xaml b/True Love/Pages/DeviceFamily-Mobile/SettingsPage.xaml index 8878a5a..15cafc6 100644 --- a/True Love/Pages/DeviceFamily-Mobile/SettingsPage.xaml +++ b/True Love/Pages/DeviceFamily-Mobile/SettingsPage.xaml @@ -20,7 +20,7 @@ - + @@ -54,7 +54,7 @@ - + @@ -66,7 +66,7 @@ Refresh F5 - Back To Top + Back to Top F6 Back ESC or Win + Backspace @@ -81,8 +81,8 @@ - Why don't upload at Microsoft Store? - Sorry, Ain't Developer ID right now. + Why don't upload at Microsoft Store? + Sorry, I'm not a Microsoft Developer. 为什么不能购买 Tim 的商品以及发表评论? @@ -99,11 +99,9 @@ - 🔧 解决物理内存使用翻倍问题 - 🔧 解决界面处于宽屏下右滑滑出空白汉堡菜单问题 - 🔧 解决工具栏走位问题 - 🔧 解决打开应用围绕一圈白线问题 - 🔧 删除不能正确工作的快捷键 + 🛠 移动端沉淀状态栏 + 🔧 修复移动端闪退问题 + 🔧 修复系统处于浅色色彩状态下三大金刚键显示不完整问题 @@ -123,7 +121,7 @@ 2021 © ProJend Tim Bergling Foundation - + Dear my love. - @@ -96,7 +99,7 @@ + upOS1709:Style="{StaticResource AppBarButtonRevealStyle}" Visibility="Collapsed"> @@ -107,34 +110,39 @@ - + + + + - - - - - - - - - - - - - - - + + + @@ -180,6 +188,25 @@ + + + + + + + + + + + + + + + diff --git a/True Love/Pages/MainPage.xaml.cs b/True Love/Pages/MainPage.xaml.cs index dab054c..f5afdec 100644 --- a/True Love/Pages/MainPage.xaml.cs +++ b/True Love/Pages/MainPage.xaml.cs @@ -39,6 +39,8 @@ public MainPage() private void Main_Loaded(object sender, RoutedEventArgs e) { this.ManipulationCompleted += The_ManipulationCompleted; // 订阅手势滑动结束后的事件 + SystemNavigationManager.GetForCurrentView().BackRequested += MainPage_BackRequested; + #region 兼容低版本号系统 if (Generic.DeviceFamilyMatch(DeviceFamilyList.Mobile)) // = WP { @@ -50,6 +52,7 @@ private void Main_Loaded(object sender, RoutedEventArgs e) { // Listen to the window directly so we will respond to hotkeys regardless // of which element has focus. Window.Current.CoreWindow.PointerPressed += this.CoreWindow_PointerPressed; + Window.Current.Activated += OnWindowActivated; Window.Current.SetTitleBar(AppTitleBar); if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 5))// > OS15063 @@ -67,7 +70,6 @@ private void Main_Loaded(object sender, RoutedEventArgs e) } } #endregion - SystemNavigationManager.GetForCurrentView().BackRequested += MainPage_BackRequested; #if !DEBUG ImagesPage.Visibility = Visibility.Collapsed; CreatComment.Visibility = Visibility.Collapsed; @@ -309,9 +311,16 @@ private void Sv_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e) /// /// 新建评论按钮。 /// - private void CreatComment_Click(object sender, RoutedEventArgs e) => DialogSetup.SetupDialog(GetDialogInfo.CommentCreate); + private void CreatComment_Click(object sender, RoutedEventArgs e) => DialogSetup.SetupDialog(GetDialogInfo.CommentCreate); #endregion + + private void OnWindowActivated(Object sender, WindowActivatedEventArgs e) + { + VisualStateManager.GoToState( + this, e.WindowActivationState == CoreWindowActivationState.Deactivated ? WindowNotFocused.Name : WindowFocused.Name, false); + } + /// /// 更改主题颜色 /// 方法 @@ -339,7 +348,7 @@ public void PageBackgroundChange() public double scrlocation = 0; // 导航栏当前显示状态(这个是为了减少不必要的开销,因为我做的是动画隐藏显示效果如果不用一个变量来记录当前导航栏状态的会重复执行隐藏或显示) bool IsShowBar = true; - public double OpaqueIfEnabled(bool IsEnabled) => IsEnabled ? 1.0 : 0.6; + public double OpaqueIfEnabled(bool IsEnabled) => IsEnabled ? 1.0 : 0.7; public static MainPage Current; } } diff --git a/True Love/Pages/SettingsPage.xaml b/True Love/Pages/SettingsPage.xaml index 90b5094..8744976 100644 --- a/True Love/Pages/SettingsPage.xaml +++ b/True Love/Pages/SettingsPage.xaml @@ -20,7 +20,7 @@ - + @@ -64,7 +64,7 @@ - + @@ -76,7 +76,7 @@ Refresh F5 - Back To Top + Back to Top F6 Back ESC or Win + Backspace @@ -92,7 +92,7 @@ Why don't upload at Microsoft Store? - Sorry, Ain't Developer ID right now. + Sorry, I'm not a Microsoft Developer. 为什么不能购买 Tim 的商品以及发表评论? @@ -109,11 +109,9 @@ - 🔧 解决物理内存使用翻倍问题 - 🔧 解决界面处于宽屏下右滑滑出空白汉堡菜单问题 - 🔧 解决工具栏走位问题 - 🔧 解决打开应用围绕一圈白线问题 - 🔧 删除不能正确工作的快捷键 + 🛠 移动端沉淀状态栏 + 🔧 修复移动端闪退问题 + 🔧 修复系统处于浅色色彩状态下三大金刚键显示不完整问题 @@ -133,7 +131,7 @@ 2021 © ProJend Tim Bergling Foundation - + Dear my love. - diff --git a/True Love/True Love - UWP.csproj b/True Love/True Love - UWP.csproj index 056e522..443525c 100644 --- a/True Love/True Love - UWP.csproj +++ b/True Love/True Love - UWP.csproj @@ -284,10 +284,6 @@ Designer MSBuild:Compile - - Designer - MSBuild:Compile - @@ -335,9 +331,7 @@ True Love - Lib - - - + Windows Mobile Extensions for the UWP diff --git a/True Love/Dates/Comment.cs b/TrueLove.Lib/Datebase/Comment.cs similarity index 94% rename from True Love/Dates/Comment.cs rename to TrueLove.Lib/Datebase/Comment.cs index b9a9023..71ee620 100644 --- a/True Love/Dates/Comment.cs +++ b/TrueLove.Lib/Datebase/Comment.cs @@ -1,4 +1,4 @@ -namespace True_Love.Dates +namespace TrueLove.Lib.Datebase { class Comment { diff --git a/True Love/Dates/Comments.cs b/TrueLove.Lib/Datebase/Comments.cs similarity index 78% rename from True Love/Dates/Comments.cs rename to TrueLove.Lib/Datebase/Comments.cs index b909b40..3c3455a 100644 --- a/True Love/Dates/Comments.cs +++ b/TrueLove.Lib/Datebase/Comments.cs @@ -1,6 +1,6 @@ using System.Collections; -namespace True_Love.Dates +namespace TrueLove.Lib.Datebase { class Comments : DictionaryBase { @@ -12,7 +12,7 @@ public Comment this[string name] get => (Comment)Dictionary[name]; set => Dictionary[name] = value; } - public override string ToString() => $"form {(Dictionary.Values as Comment).name.ToUpper()}\n{(Dictionary.Values as Comment).commentary}"; + public override string ToString() => $"form {(IDictionary.Values as Comment).name.ToUpper()}\n{(Dictionary.Values as Comment).commentary}"; public IEnumerable Name { get diff --git a/TrueLove.Lib/Helpers/Register.cs b/TrueLove.Lib/Helpers/Register.cs index 733ae19..cec4db7 100644 --- a/TrueLove.Lib/Helpers/Register.cs +++ b/TrueLove.Lib/Helpers/Register.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using Windows.ApplicationModel.Background; -namespace TrueLove.Lib +namespace TrueLove.Lib.Helpers { public class Register { diff --git a/TrueLove.Lib/Notification/ContentDialog/DialogTemplate/ReleaseNotes.xaml b/TrueLove.Lib/Notification/ContentDialog/DialogTemplate/ReleaseNotes.xaml index aaac1d8..e96c3a2 100644 --- a/TrueLove.Lib/Notification/ContentDialog/DialogTemplate/ReleaseNotes.xaml +++ b/TrueLove.Lib/Notification/ContentDialog/DialogTemplate/ReleaseNotes.xaml @@ -16,6 +16,15 @@ --> + + + 🔧 解决物理内存使用翻倍问题 + 🔧 解决界面处于宽屏下右滑滑出空白汉堡菜单问题 + 🔧 解决工具栏走位问题 + 🔧 解决打开应用围绕一圈白线问题 + 🔧 删除不能正确工作的快捷键 + + 🛠 提示网络错误 @@ -23,6 +32,7 @@ 🛠 响应鼠标返回键 🔨 New Logo + 🔨 增加了底部工具栏,带有刷新网页,回到顶部的功能,并具备出色的动画 @@ -30,6 +40,7 @@ 🛠 重写了主页、设置 UI 🔨 支援 WP + 🔨 更换 FontIcon 矢量图标 diff --git a/TrueLove.Lib/True Love - Lib.csproj b/TrueLove.Lib/True Love - Lib.csproj index 538a89b..b597cd3 100644 --- a/TrueLove.Lib/True Love - Lib.csproj +++ b/TrueLove.Lib/True Love - Lib.csproj @@ -120,6 +120,8 @@ PackageReference + + @@ -153,7 +155,6 @@ -