Skip to content

Commit a9fc303

Browse files
authored
Merge pull request #36 from ixian-platform/jaka/onboarding
Ref: onboarding
2 parents d04df3c + 9c527d5 commit a9fc303

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+4213
-2011
lines changed

Spixi/Pages/Home/OnboardPage.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ private void onNavigating(object sender, WebNavigatingEventArgs e)
3636
else if (current_url.Contains("ixian:joinbot"))
3737
{
3838
joinBot = true;
39+
finishOnboarding();
3940
}
4041
else if (current_url.Equals("ixian:error", StringComparison.Ordinal))
4142
{

Spixi/Pages/Launch/LaunchCreatePage.xaml.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ public LaunchCreatePage ()
2323
loadPage(webView, "intro_new.html");
2424
}
2525

26+
private void onLoad()
27+
{
28+
Utils.sendUiCommand(this, "setVersion", Config.version);
29+
}
30+
2631
private void onNavigated(object sender, WebNavigatedEventArgs e)
2732
{
2833

@@ -32,6 +37,10 @@ private void onNavigating(object sender, WebNavigatingEventArgs e)
3237
{
3338
string current_url = HttpUtility.UrlDecode(e.Url);
3439

40+
if (current_url.Equals("ixian:onload", StringComparison.Ordinal))
41+
{
42+
onLoad();
43+
}
3544
if (current_url.Equals("ixian:back", StringComparison.Ordinal))
3645
{
3746
popPageAsync();
@@ -57,6 +66,10 @@ private void onNavigating(object sender, WebNavigatingEventArgs e)
5766
{
5867
_ = onChangeAvatarAsync(sender, e);
5968
}
69+
else if (current_url.Equals("ixian:restore", StringComparison.Ordinal))
70+
{
71+
Navigation.PushAsync(new LaunchRestorePage(), Config.defaultXamarinAnimations);
72+
}
6073
else
6174
{
6275
// Otherwise it's just normal navigation

Spixi/Pages/Launch/LaunchPage.xaml.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace SPIXI
1111
[XamlCompilation(XamlCompilationOptions.Compile)]
1212
public partial class LaunchPage : SpixiContentPage
1313
{
14+
ThemeAppearance selectedAppearance = ThemeAppearance.automatic;
1415
private bool acceptedTerms = false;
1516
public LaunchPage ()
1617
{
@@ -22,6 +23,9 @@ public LaunchPage ()
2223

2324
private void onLoad()
2425
{
26+
selectedAppearance = ThemeManager.getActiveAppearance();
27+
int activeAppearanceIdx = (int)selectedAppearance;
28+
Utils.sendUiCommand(this, "initialAppearance", activeAppearanceIdx.ToString());
2529
Utils.sendUiCommand(this, "setVersion", Config.version);
2630
if(!acceptedTerms)
2731
{
@@ -62,7 +66,18 @@ private void onNavigating(object sender, WebNavigatingEventArgs e)
6266
Preferences.Default.Set("language", lang);
6367
}
6468
loadPage(webView, "intro.html");
69+
Utils.sendUiCommand(this, "showOnboardingSection");
6570
}
71+
else if (current_url.StartsWith("ixian:appearance:", StringComparison.Ordinal))
72+
{
73+
string appearanceString = current_url.Substring("ixian:appearance:".Length);
74+
selectedAppearance = (ThemeAppearance)Convert.ToInt32(appearanceString);
75+
76+
if (ThemeManager.changeAppearance(selectedAppearance))
77+
{
78+
loadPage(webView, "intro.html");
79+
}
80+
}
6681
else
6782
{
6883
// Otherwise it's just normal navigation

Spixi/Pages/Launch/LaunchRestorePage.xaml.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private void onNavigating(object sender, WebNavigatingEventArgs e)
4444
{
4545
e.Cancel = true;
4646
Utils.sendUiCommand(this, "removeLoadingOverlay");
47-
displaySpixiAlert(SpixiLocalization._SL("intro-restore-file-invalidpassword-title"), SpixiLocalization._SL("intro-restore-file-invalidpassword-text"), SpixiLocalization._SL("global-dialog-ok"));
47+
Utils.sendUiCommand(this, "showPasswordError");
4848
return;
4949
}
5050

@@ -109,7 +109,7 @@ private async void onSelectFile()
109109
return;
110110
}
111111

112-
Utils.sendUiCommand(this, "enableRestore");
112+
Utils.sendUiCommand(this, "setUploadedFileName", filepath);
113113
}
114114

115115
// Attempt to restore the wallet
@@ -173,7 +173,7 @@ private bool restoreAccountFile(string source_path, string pass)
173173
if (!ws.verifyWallet(tmpWalletFile, pass))
174174
{
175175
Directory.Delete(tmpDirectory, true);
176-
displaySpixiAlert(SpixiLocalization._SL("intro-restore-file-invalidpassword-title"), SpixiLocalization._SL("intro-restore-file-invalidpassword-text"), SpixiLocalization._SL("global-dialog-ok"));
176+
Utils.sendUiCommand(this, "showPasswordError");
177177
// Remove overlay
178178
Utils.sendUiCommand(this, "removeLoadingOverlay");
179179
return false;
@@ -217,7 +217,7 @@ private bool restoreWalletFile(string source_path, string pass)
217217
WalletStorage ws = new WalletStorage(source_path);
218218
if (!ws.verifyWallet(source_path, pass))
219219
{
220-
displaySpixiAlert(SpixiLocalization._SL("intro-restore-file-invalidpassword-title"), SpixiLocalization._SL("intro-restore-file-invalidpassword-text"), SpixiLocalization._SL("global-dialog-ok"));
220+
Utils.sendUiCommand(this, "showPasswordError");
221221
// Remove overlay
222222
Utils.sendUiCommand(this, "removeLoadingOverlay");
223223
return false;

Spixi/Resources/Raw/html/app_details.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180

181181
<div class="new-modal-wrapper" id="removeAppModal" style="display: none;">
182182
<div class="new-modal-container">
183-
<img src="img/trash-icon.png" alt="trash-icon" width="32" height="32" />
183+
<i class="fa fa-trash-can modal-trash-icon"></i>
184184
<div class="new-modal-texts">
185185
<span class="label-lg">*SL{apps-remove-title}</span>
186186
<span class="body-sm">*SL{apps-remove-description}</span>

0 commit comments

Comments
 (0)