eea3b11e23
- Added ability to delete comments. Fixes Related Work Items: #228, #234 - Refactored Video page Related Work Items: #183, #186 - Player refactoring - Chat Related Work Items: #183, #185 - New Logo draft - Improving thumbnails quality - Seek slider fixes Related Work Items: #235, #237 - Regions and languagaes improved. Video cards duration display fixed. Added settings updating system Related Work Items: #236 - Items cards' context menu. Fixed duplicating authors' name on comments replies. Another version of logo Related Work Items: #226 - Context menu for cards done Related Work Items: #226 - Live stats update done Related Work Items: #183, #186 - Settings recovery system improvements - Missync fixed. New logo. Supporting all existing qualities Related Work Items: #207 - Added support of livestreams. Chat messages avatars added. Formatting live chat messages added. Few player fixes Related Work Items: #183, #184 - Refactored player. Refactored changelog system. Players isn't localized Related Work Items: #161, #211, #238 - Player fixes. Localization updates. Tiles updated Related Work Items: #161 - Menu render fix Related Work Items: #239 - Fullscreen mode fixes Related Work Items: #240 - Manifest changes - Ads development - Video cards fixes. Localization fixes. CardAdvert created Related Work Items: #244, #245 - Localization fixed. Player fixes. Menu fixes Related Work Items: #243, #245 - Menu displaying fixes - Fixes Related Work Items: #241, #242, #249, #250 - SafeSearch filter fixed - Video page fixes Related Work Items: #249 - Patchnote updated - Version updated
102 lines
3.1 KiB
C#
102 lines
3.1 KiB
C#
using System;
|
|
using Windows.ApplicationModel.Resources;
|
|
using Windows.UI.Xaml;
|
|
using Windows.UI.Xaml.Controls;
|
|
|
|
namespace FoxTube
|
|
{
|
|
public enum LoadingState { Loadnig, Loaded, Error, Blocked }
|
|
|
|
/// <summary>
|
|
/// Loading sreen. Represents loading ring or error
|
|
/// </summary>
|
|
public sealed partial class LoadingPage : Page
|
|
{
|
|
ResourceLoader resources = ResourceLoader.GetForCurrentView("LoadingPage");
|
|
|
|
public event RoutedEventHandler RefreshPage;
|
|
public LoadingState State { get; private set; } = LoadingState.Loadnig;
|
|
|
|
public LoadingPage()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void Error(string exceptionId = "Unknown", string details = "N/A", bool isWifiTrouble = false)
|
|
{
|
|
ring.IsActive = false;
|
|
trouble.Visibility = Visibility.Collapsed;
|
|
wifiTrouble.Visibility = Visibility.Collapsed;
|
|
blockIcon.Visibility = Visibility.Collapsed;
|
|
|
|
if (isWifiTrouble)
|
|
{
|
|
wifiException.Text = $"{resources.GetString("/LoadingPage/ex")}: {exceptionId}";
|
|
wifiMessage.Text = $"{resources.GetString("/LoadingPage/details")}: {details}";
|
|
|
|
wifiTrouble.Visibility = Visibility.Visible;
|
|
}
|
|
else
|
|
{
|
|
exception.Text = $"{resources.GetString("/LoadingPage/ex")}: {exceptionId}";
|
|
message.Text = $"{resources.GetString("/LoadingPage/details")}: {details}";
|
|
|
|
trouble.Visibility = Visibility.Visible;
|
|
}
|
|
|
|
State = LoadingState.Error;
|
|
}
|
|
|
|
public void Block()
|
|
{
|
|
Visibility = Visibility.Visible;
|
|
ring.IsActive = false;
|
|
trouble.Visibility = Visibility.Collapsed;
|
|
wifiTrouble.Visibility = Visibility.Collapsed;
|
|
|
|
blockIcon.Visibility = Visibility.Visible;
|
|
|
|
State = LoadingState.Blocked;
|
|
}
|
|
|
|
private async void openWifi_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings:network"));
|
|
}
|
|
|
|
private async void openTroubleshoot_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings:troubleshoot"));
|
|
}
|
|
|
|
private async void feedback_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
await Windows.System.Launcher.LaunchUriAsync(new Uri("feedback-hub:"));
|
|
}
|
|
|
|
private void wifiRefresh_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
Refresh();
|
|
RefreshPage.Invoke(this, null);
|
|
}
|
|
|
|
public void Refresh()
|
|
{
|
|
Visibility = Visibility.Visible;
|
|
ring.IsActive = true;
|
|
trouble.Visibility = Visibility.Collapsed;
|
|
wifiTrouble.Visibility = Visibility.Collapsed;
|
|
blockIcon.Visibility = Visibility.Collapsed;
|
|
|
|
State = LoadingState.Loadnig;
|
|
}
|
|
|
|
public void Close()
|
|
{
|
|
Visibility = Visibility.Collapsed;
|
|
|
|
State = LoadingState.Loaded;
|
|
}
|
|
}
|
|
}
|