Skip to content

Commit

Permalink
Remind offline
Browse files Browse the repository at this point in the history
  • Loading branch information
ProJend committed Jun 30, 2023
1 parent 31cdd72 commit 7276f53
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 6 deletions.
2 changes: 1 addition & 1 deletion TrueLove.UWP/Spider/ReviewHttp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ public async Task<string> GetSource(string path, bool isLoadedDown = true)
}
private string strHTML;
internal string StrHTML => strHTML;
bool isNetkWorkAvilable;
public bool isNetkWorkAvilable;
}
}
2 changes: 1 addition & 1 deletion TrueLove.UWP/Template/Colors.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
BackgroundSource="Backdrop"
FallbackColor="DimGray"
TintColor="DimGray"
TintOpacity=".5" />
TintOpacity=".4" />
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<Color x:Key="PageBackgroundColor">Black</Color>
Expand Down
4 changes: 2 additions & 2 deletions TrueLove.UWP/True Love - UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
</PackageCertificateThumbprint>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppxBundle>Always</AppxBundle>
<AppxBundle>Auto</AppxBundle>
<AppxBundlePlatforms>x86|x64|arm</AppxBundlePlatforms>
<AppInstallerUri>\\c</AppInstallerUri>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
<PackageCertificateKeyFile>TrueLove.UWP_TemporaryKey.pfx</PackageCertificateKeyFile>
<PackageCertificateKeyFile>True Love - UWP_TemporaryKey.pfx</PackageCertificateKeyFile>
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
<AppInstallerUpdateFrequency>0</AppInstallerUpdateFrequency>
<AppInstallerCheckForUpdateFrequency>OnApplicationRun</AppInstallerCheckForUpdateFrequency>
Expand Down
19 changes: 18 additions & 1 deletion TrueLove.UWP/Views/CommentsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,32 @@
</GridView>
</StackPanel>
</ScrollViewer>
<ProgressRing
x:Name="progressRing"
Width="50"
Height="50"
IsActive="True" />
<Grid
Name="toolBar"
MaxWidth="600"
MaxWidth="650"
Margin="0,20"
VerticalAlignment="Bottom">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<StackPanel
x:Name="NetworkStatus"
Grid.ColumnSpan="2"
HorizontalAlignment="Center"
Visibility="Collapsed">
<FontIcon
Margin="0,15"
FontFamily="Segoe MDL2 Assets"
FontSize="40"
Glyph="&#xF384;" />
<TextBlock Style="{ThemeResource SubtitleTextBlockStyle}">Offline</TextBlock>
</StackPanel>
<Button
Grid.Column="0"
HorizontalAlignment="Center"
Expand Down
5 changes: 5 additions & 0 deletions TrueLove.UWP/Views/CommentsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ private async void DataLoad()
var refineData = new RefineData();
Comments = refineData.UpdateComment(src);
CommentView.ItemsSource = Comments;
progressRing.IsActive = false;
if (!reviewHTML.isNetkWorkAvilable)
{
NetworkStatus.Visibility = Visibility.Visible;
}
}
}
}
17 changes: 17 additions & 0 deletions TrueLove.UWP/Views/ImagesPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@
</GridView>
</StackPanel>
</ScrollViewer>
<ProgressRing
x:Name="progressRing"
Width="50"
Height="50"
IsActive="True" />
<Grid
Height="85"
Padding="0,40,0,0"
Expand Down Expand Up @@ -102,6 +107,18 @@
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<StackPanel
x:Name="NetworkStatus"
Grid.ColumnSpan="2"
HorizontalAlignment="Center"
Visibility="Collapsed">
<FontIcon
Margin="0,15"
FontFamily="Segoe MDL2 Assets"
FontSize="40"
Glyph="&#xF384;" />
<TextBlock Style="{ThemeResource SubtitleTextBlockStyle}">Offline</TextBlock>
</StackPanel>
<Button
Grid.Column="0"
HorizontalAlignment="Center"
Expand Down
8 changes: 7 additions & 1 deletion TrueLove.UWP/Views/ImagesPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Xml.Linq;
using Microsoft.UI.Xaml.Controls;
using System.Xml.Linq;
using TrueLove.UWP.Spider;
using Windows.ApplicationModel;
using Windows.UI.Core;
Expand Down Expand Up @@ -68,6 +69,11 @@ private async void DataLoad()
var src = await reviewHTML.GetSource("https://avicii.com/images", false);
var refineData = new RefineData();
ImageView.ItemsSource = refineData.UpdateImage(src);
progressRing.IsActive = false;
if (!reviewHTML.isNetkWorkAvilable)
{
NetworkStatus.Visibility = Visibility.Visible;
}
}
}
}

0 comments on commit 7276f53

Please sign in to comment.