Skip to content

Commit

Permalink
Bump v0.2.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ProJend committed Feb 6, 2021
1 parent 8445d7b commit 88271fb
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 34 deletions.
4 changes: 2 additions & 2 deletions True Love/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using Windows.UI.Xaml.Navigation;
using Windows.Storage;
using Microsoft.QueryStringDotNET;
using Windows.System.Profile;
using static True_Love.Helpers.Generic;

namespace True_Love
{
Expand Down Expand Up @@ -88,7 +88,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
localSettings.Values["IsToastPush"] = false;
}

if (AnalyticsInfo.VersionInfo.DeviceFamily != "Windows.Mobile") HideTitleBar();
if (!IdentifyDeviceFamily("mobile")) HideTitleBar();
//else HideStatusBar();
}
}
Expand Down
34 changes: 31 additions & 3 deletions True Love/Helpers/Generic.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Windows.ApplicationModel.Resources;
using System;
using Windows.ApplicationModel.Resources;
using Windows.System.Profile;

namespace True_Love.Helpers
{
Expand All @@ -8,10 +10,36 @@ public static class Generic
/// 获取字符串资源。
/// </summary>
/// <param name="UID">唯一识别码</param>
/// <returns><returns>
public static string GetResourceString(string UID)
{
var resourceLoader = ResourceLoader.GetForCurrentView();
return resourceLoader.GetString(UID);
var resourceLoader = ResourceLoader.GetForCurrentView().GetString(UID);
if (!string.IsNullOrEmpty(resourceLoader)) return resourceLoader;
else throw new ArgumentException($"There're blank output on this uid : {UID}.\nTap Ctrl + F to search and find it out in current project.");
}

/// <summary>
/// 识别设备。
/// </summary>
/// <param name="DeviceOS">Desktop, Mobile, Team, IoT, Holographic or Xbox</param>
/// <returns></returns>
public static bool IdentifyDeviceFamily(string DeviceOS)
{
var DeviceFamily = AnalyticsInfo.VersionInfo.DeviceFamily;
var CurrentDevice = "Windows." + DeviceOS.Substring(0, 1).ToUpper() + DeviceOS.Substring(1).ToLower(); // 首字母大写
switch (CurrentDevice)
{ // 确认设备输入正确
case "Windows.Desktop":
case "Windows.Mobile":
case "Windows.Team":
case "Windows.IoT":
case "Windows.Holographic":
case "Windows.Xbox":
if (DeviceFamily == CurrentDevice) return true;
else return false;
default:
throw new ArgumentException($"The parameter is incorrect : {DeviceOS}.\nTap Ctrl + F to search and find it out in current project.");
}
}
}
}
2 changes: 1 addition & 1 deletion True Love/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<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">
<Identity Name="Tim" Publisher="CN=True Love, O=Ben, C=CN" Version="0.2.3.0" />
<Identity Name="Tim" Publisher="CN=True Love, O=Ben, C=CN" Version="0.2.7.0" />
<mp:PhoneIdentity PhoneProductId="cf0148d5-01bb-4b60-b53b-da3346bf8e5e" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>True Love - Tim Bergling Foundtion</DisplayName>
Expand Down
4 changes: 2 additions & 2 deletions True Love/Pages/HomePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@
<TextBlock Text="Avicii Memory boaid" FontFamily="{StaticResource freeland}" HorizontalAlignment="Center" VerticalAlignment="Center" Style="{StaticResource SubheaderTextBlockStyle}"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="16 0 0 0">
<TextBlock Text="C O M M E N T S" Style="{StaticResource FlyoutPickerTitleTextBlockStyle}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<Button Background="Transparent" Width="40" Height="40" Click="Button_Click" Tag="Shop" HorizontalAlignment="Center" VerticalAlignment="Center" v1809:CornerRadius="2 2 2 0">
<Button Background="Transparent" Width="40" Height="40" Click="Button_Click" Tag="Shop" HorizontalAlignment="Center" VerticalAlignment="Center">
<FontIcon Foreground="{ThemeResource SystemAccentColor}" FontFamily="Segoe MDL2 Assets" Glyph="&#xE761;"/>
</Button>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="16 0 0 0">
<TextBlock Text="I M A G E S" Style="{StaticResource FlyoutPickerTitleTextBlockStyle}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<Button Background="Transparent" Width="40" Height="40" Click="Button_Click" Tag="Shop" HorizontalAlignment="Center" VerticalAlignment="Center" v1809:CornerRadius="2 0 2 2">
<Button Background="Transparent" Width="40" Height="40" Click="Button_Click" Tag="Shop" HorizontalAlignment="Center" VerticalAlignment="Center">
<FontIcon Foreground="{ThemeResource SystemAccentColor}" FontFamily="Segoe MDL2 Assets" Glyph="&#xE761;"/>
</Button>
</StackPanel>
Expand Down
2 changes: 1 addition & 1 deletion True Love/Pages/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
<muxc:NavigationViewItemHeader Content="True" x:Name="MainPagesHeader"/>
<muxc:NavigationViewItem Content="Memory" x:Name="MemoryPage" Icon="Home" Tag="home"/>
<muxc:NavigationViewItem Content="Comments" x:Name="HomePage" Icon="World" Tag="comment"/>
<muxc:NavigationViewItem Content="Images" x:Name="ImagesPage" Tag="image" Visibility="Visible">
<muxc:NavigationViewItem Content="Images" x:Name="ImagesPage" Tag="image" Visibility="Collapsed">
<muxc:NavigationViewItem.Icon>
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph="&#xEB9F;"/>
</muxc:NavigationViewItem.Icon>
Expand Down
14 changes: 7 additions & 7 deletions True Love/Pages/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
using Windows.UI.Notifications;
using Microsoft.QueryStringDotNET;
using True_Love.Pages.XAML_ContentDialog;
using Windows.System.Profile;
using static True_Love.Helpers.Generic;

// https://go.microsoft.com/fwlink/?LinkId=234238 上介绍了“空白页”项模板

Expand All @@ -41,7 +41,7 @@ private void Main_Loaded(object sender, RoutedEventArgs e)
{
this.ManipulationCompleted += The_ManipulationCompleted; // 订阅手势滑动结束后的事件
#region 兼容低版本号系统
if (AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Mobile") // = WP
if (IdentifyDeviceFamily("mobile")) // = WP
{
if ((bool)localSettings.Values["SetBackgroundColor"]) BackgroundOfBar.Background = new SolidColorBrush(Colors.Black);
else BackgroundOfBar.Background = new SolidColorBrush((Color)Resources["SystemChromeMediumColor"]);
Expand Down Expand Up @@ -293,7 +293,7 @@ private async void AddButton_Click(object sender, RoutedEventArgs e)
Content = newComment,
Background = new SolidColorBrush(Colors.Black),
};
if (AnalyticsInfo.VersionInfo.DeviceFamily != "Windows.Mobile")
if (!IdentifyDeviceFamily("mobile"))
{
Comment.CloseButtonStyle = (Style)Resources["ButtonRevealStyle"];
Comment.SecondaryButtonStyle = (Style)Resources["ButtonRevealStyle"];
Expand Down Expand Up @@ -381,7 +381,7 @@ private void ControlsChanged(string tag)
}
void CommandBarCollapsed()
{
if (AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Mobile") CommandBar.Visibility = Visibility.Collapsed;
if (IdentifyDeviceFamily("mobile")) CommandBar.Visibility = Visibility.Collapsed;
else
{
bar.Opacity = 0;
Expand All @@ -390,7 +390,7 @@ void CommandBarCollapsed()
}
void CommandBarVisible()
{
if (AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Mobile") CommandBar.Visibility = Visibility.Visible;
if (IdentifyDeviceFamily("mobile")) CommandBar.Visibility = Visibility.Visible;
else
{
bar.Opacity = 1;
Expand All @@ -415,8 +415,8 @@ public void PageBackgroundChange()
{
if ((bool)localSettings.Values["SetBackgroundColor"]) Main.Background = new SolidColorBrush(Colors.Black);
else Main.Background = new SolidColorBrush((Color)Resources["SystemChromeMediumColor"]);
if (AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Mobile" && (bool)localSettings.Values["SetBackgroundColor"]) BackgroundOfBar.Background = new SolidColorBrush(Colors.Black);
else if (AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Mobile") BackgroundOfBar.Background = new SolidColorBrush((Color)Resources["SystemChromeMediumColor"]);
if (IdentifyDeviceFamily("mobile") && (bool)localSettings.Values["SetBackgroundColor"]) BackgroundOfBar.Background = new SolidColorBrush(Colors.Black);
else if (IdentifyDeviceFamily("mobile")) BackgroundOfBar.Background = new SolidColorBrush((Color)Resources["SystemChromeMediumColor"]);
}

/// <summary>
Expand Down
23 changes: 11 additions & 12 deletions True Love/Pages/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,8 @@
<Run>Sorry, Ain't Developer ID right now.</Run>
</TextBlock>
<TextBlock x:Name="FAQ_CN" Style="{ThemeResource BodyTextBlockStyle}">
<LineBreak/>
<Run Foreground="DarkGray">为什么不能购买 Tim 的商品以及发表评论?</Run><LineBreak/>
<Hyperlink NavigateUri="https://www.google.com">Google</Hyperlink><Run Text=" 一下,你就知道。"/>
<LineBreak/><Run Foreground="DarkGray">为什么不能购买 Tim 的商品以及发表评论?</Run><LineBreak/>
<Hyperlink NavigateUri="https://www.google.com">Google</Hyperlink><Run Text=" 一下,你就知道。"/>
</TextBlock>
<!--<HyperlinkButton Content="GitHub Wiki"/>-->

Expand All @@ -117,10 +116,10 @@
<Run x:Name="releasedDate"></Run>
</TextBlock>
<TextBlock Foreground="DarkGray" Style="{ThemeResource BodyTextBlockStyle}">
<Run>新增:提示网络错误</Run><LineBreak/>
<Run>新增:深灰色夜间主题</Run><LineBreak/>
<Run>改进:响应鼠标返回键</Run><LineBreak/>
<Run>改进:New Logo</Run><LineBreak/>
<Run>解决物理内存使用翻倍问题</Run><LineBreak/>
<Run>解决界面处于宽屏下右滑滑出空白汉堡菜单问题</Run><LineBreak/>
<Run>解决工具栏走位问题</Run><LineBreak/>
<Run>解决打开应用围绕一圈白线问题</Run><LineBreak/> <Run>解决界面处于宽屏下右滑滑出空白汉堡菜单问题</Run><LineBreak/>
</TextBlock>
<HyperlinkButton Content="Learn More" Click="Release_Click"/>

Expand All @@ -138,9 +137,9 @@
</TextBlock>
<TextBlock Style="{ThemeResource BodyTextBlockStyle}">
<Run x:Name="VersionInfo" Foreground="DarkGray"></Run><LineBreak/>
<Run Foreground="DarkGray">2020 @ ProJend</Run><LineBreak/>
<Run Foreground="DarkGray">Power By Tim Bergling</Run><LineBreak/>
<Run>This App will help you easy to browse all about Tim Bergling.</Run>
<Run Foreground="DarkGray">2021 © ProJend</Run><LineBreak/>
<Run Foreground="DarkGray">Tim Bergling Foundation</Run><LineBreak/>
<Run>we will comprehend Tim Bergling more and more and more...</Run>
</TextBlock>

<!--链接 : 🔗
Expand All @@ -151,7 +150,7 @@
<Run Foreground="{ThemeResource SystemAccentColor}">Links</Run><LineBreak/>
<Run>ProJend</Run>
</TextBlock>
<TextBlock Text="This is my first try to do UWP, wish this app will make you luck!" Foreground="DarkGray" Style="{ThemeResource BodyTextBlockStyle}"/>
<TextBlock Text="A new UWP!" Foreground="DarkGray" Style="{ThemeResource BodyTextBlockStyle}"/>
<TextBlock Text="Report To Author"/>
<StackPanel Orientation="Horizontal">
<Button Background="Transparent" Width="42" Height="42" Click="Links_Click" Tag="GitHub" v1709:Style="{StaticResource ButtonRevealStyle}" v1809:CornerRadius="2 0 0 2">
Expand Down Expand Up @@ -228,7 +227,7 @@
<TextBlock Text="Missing You ❤" Foreground="DarkGray"/>
<TextBlock/>
<TextBlock Text="Fans" Style="{ThemeResource FlyoutPickerTitleTextBlockStyle}"/>
<TextBlock Text="Made Of Love"/>
<TextBlock Text="Made For Love"/>
<StackPanel Orientation="Horizontal">
<Button ToolTipService.ToolTip="#projectOne" Background="Transparent" Width="42" Height="42" Click="Links_Click" Tag="One" v1709:Style="{StaticResource ButtonRevealStyle}">
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph="&#xE7F6;"/>
Expand Down
7 changes: 3 additions & 4 deletions True Love/Pages/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
using Windows.UI.Xaml.Media;
using Windows.ApplicationModel;
using True_Love.Pages.XAML_ContentDialog;
using Windows.System.Profile;
using Windows.ApplicationModel.Resources;
using static True_Love.Helpers.Generic;

// https://go.microsoft.com/fwlink/?LinkId=234238 上介绍了“空白页”项模板

Expand Down Expand Up @@ -41,7 +40,7 @@ private void Settings_Loaded(object sender, RoutedEventArgs e)
HideCommandbar.IsOn = (bool)localSettings.Values["SetHideCommandBar"];
BackgroundColor.IsOn = (bool)localSettings.Values["SetBackgroundColor"];
var version = Package.Current.Id.Version;
VersionInfo.Text = $"Version : {version.Major}.{version.Minor}.{version.Build}.{version.Revision}" + ResourceLoader.GetForCurrentView().GetString("pDisplayName");
VersionInfo.Text = $"Version : {version.Major}.{version.Minor}.{version.Build}.{version.Revision}";
releasedDate.Text = $"Installation Date : {Package.Current.InstalledDate.ToLocalTime().DateTime}";
}

Expand Down Expand Up @@ -127,7 +126,7 @@ private async void Release_Click(object sender, RoutedEventArgs e)
Content = new ReleaseNotes(),
Background = new SolidColorBrush(Colors.Black),
};
if (AnalyticsInfo.VersionInfo.DeviceFamily != "Windows.Mobile")
if (!IdentifyDeviceFamily("mobile"))
{
release.CloseButtonStyle = (Style)Resources["ButtonRevealStyle"];
release.BorderBrush = (Brush)Resources["SystemControlBackgroundListMediumRevealBorderBrush"];
Expand Down
3 changes: 1 addition & 2 deletions True Love/True Love.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="Dates\Comment.cs" />
<Compile Include="Dates\Comments.cs" />
<Compile Include="Helpers\Generic.cs" />
<Compile Include="Helpers\LiveTileService.cs" />
<Compile Include="Pages\CommentsPage.xaml.cs">
<DependentUpon>CommentsPage.xaml</DependentUpon>
Expand Down

0 comments on commit 88271fb

Please sign in to comment.