-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- The splash screen is highly WIP. - It has breaking changes. - The build will pass but the App can't run due to some win32 issue.
- Loading branch information
1 parent
0e842e0
commit 0ec0d32
Showing
19 changed files
with
229 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"$schema": "https://aka.ms/CsWin32.schema.json", | ||
"className": "AniMoeAppNative", | ||
"public": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SetWindowPos | ||
GetSystemMetrics | ||
SetWindowLongPtr | ||
WINDOW_STYLE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using AniMoe.App.Models.MasterModel; | ||
using AniMoe.App.Models.MediaListStatusModel; | ||
using AniMoe.App.Services; | ||
using AniMoe.App.Views; | ||
using CommunityToolkit.Mvvm.ComponentModel; | ||
using Microsoft.UI.Xaml; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace AniMoe.App.ViewModels | ||
{ | ||
public partial class SplashViewModel : ObservableObject | ||
{ | ||
public MediaListStatusModel mediaListStatusModel; | ||
private readonly ILocalSettings _localSettings; | ||
private RootWindow rootWindow = null; | ||
|
||
[ObservableProperty] private MasterModel model; | ||
|
||
[ObservableProperty] string _statusText; | ||
|
||
public SplashViewModel(MasterModel model, ILocalSettings settings) | ||
{ | ||
_localSettings = settings; | ||
StatusText = "Registering Dependencies..."; | ||
model = Model; | ||
} | ||
|
||
public async void Window_Activated(object sender, WindowActivatedEventArgs args) | ||
{ | ||
var ins = Application.Current as App; | ||
var window = ins.m_window; | ||
if (window is SplashView splashView) return; | ||
if (window is RootWindow roowindow) return; | ||
if (_localSettings.IsSettingExists("accessToken")) | ||
await LoadFromApi(); | ||
if (rootWindow == null) | ||
{ | ||
var mwindow = new RootWindow(); | ||
mwindow.ExtendsContentIntoTitleBar = true; | ||
((Window)sender).Close(); | ||
mwindow.Activate(); | ||
ins.m_window = mwindow; | ||
} | ||
} | ||
|
||
public async Task LoadFromApi() | ||
{ | ||
StatusText = "Fetching user data..."; | ||
Model = await Models.MasterModel.Initialize.FetchData(); | ||
|
||
StatusText = "Fetching Anime & Manga lists..."; | ||
mediaListStatusModel | ||
= await Models.MediaListStatusModel.Initialize.FetchData(Model.Data.User.Id); | ||
EnumValue defaultValue = new EnumValue { Name = "Select One" }; | ||
Model.Data.MediaSourceList.EnumValues.Insert(0, defaultValue); | ||
Model.Data.MediaSeasonList.EnumValues.Insert(0, defaultValue); | ||
Model.Data.MediaFormatList.EnumValues.Insert(0, defaultValue); | ||
|
||
StatusText = "Launching AniMoe..."; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.