Skip to content

Commit ae2d941

Browse files
committed
- fixed view on explorer link
- added SpixiAppSdk.onInit call when mini app is started - fixed VoIP on some iOS devices - UI fixes
1 parent a696f00 commit ae2d941

File tree

10 files changed

+86
-33
lines changed

10 files changed

+86
-33
lines changed

Spixi/Pages/Home/HomePage.xaml.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,10 @@ private void onNavigating(object sender, WebNavigatingEventArgs e)
378378
string appId = current_url.Substring("ixian:appDetails:".Length);
379379
onAppDetails(appId);
380380
}
381+
else if (current_url.StartsWith("ixian:explorer"))
382+
{
383+
Browser.Default.OpenAsync(new Uri(Config.explorerUrl + "index.php?p=address&id=" + IxianHandler.primaryWalletAddress));
384+
}
381385
else
382386
{
383387
// Otherwise it's just normal navigation

Spixi/Pages/MiniApps/MiniAppPage.xaml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,16 @@ private void onNavigated(object sender, WebNavigatedEventArgs e)
189189

190190
private void onLoad()
191191
{
192+
if (userAddresses != null)
193+
{
194+
// Multi User App
195+
Utils.sendUiCommand(this, "SpixiAppSdk.onInit", Crypto.hashToString(sessionId), string.Join(',', userAddresses.Select(x => x.ToString())));
196+
} else
197+
{
198+
// Single User App
199+
Utils.sendUiCommand(this, "SpixiAppSdk.onInit");
200+
}
201+
192202
// Execute timer-related functionality immediately
193203
updateScreen();
194204
}

Spixi/Platforms/Windows/app.manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
3-
<assemblyIdentity version="1.0.0.0" name="Spixi.WinUI.app"/>
3+
<assemblyIdentity version="0.9.6.0" name="Spixi.WinUI.app"/>
44

55
<application xmlns="urn:schemas-microsoft-com:asm.v3">
66
<windowsSettings>

Spixi/Platforms/iOS/SAudioRecorder.cs

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public class SAudioRecorder : IAudioRecorder, IAudioEncoderCallback
1212
private Action<byte[]> OnSoundDataReceived;
1313

1414
private AVAudioEngine audioRecorder = null;
15+
private AVAudioConverter audioConverter = null;
1516
private IAudioEncoder audioEncoder = null;
1617

1718
bool running = false;
@@ -24,6 +25,9 @@ public class SAudioRecorder : IAudioRecorder, IAudioEncoderCallback
2425
int bitRate = SPIXI.Meta.Config.VoIP_bitRate;
2526
int channels = SPIXI.Meta.Config.VoIP_channels;
2627

28+
AVAudioFormat desiredFormat;
29+
AVAudioFormat recordingFormat;
30+
2731
private static SAudioRecorder _singletonInstance;
2832
public static SAudioRecorder Instance()
2933
{
@@ -57,17 +61,29 @@ public void start(string codec)
5761

5862
private void initRecorder()
5963
{
60-
audioRecorder = new AVAudioEngine();
6164
NSError error = new NSError();
6265
if (!AVAudioSession.SharedInstance().SetPreferredSampleRate(sampleRate, out error))
6366
{
64-
throw new Exception("Error setting preffered sample rate for recorder: " + error);
67+
throw new Exception("Error setting preferred sample rate for recorder: " + error);
6568
}
69+
6670
AVAudioSession.SharedInstance().SetCategory(AVAudioSessionCategory.PlayAndRecord, AVAudioSessionCategoryOptions.InterruptSpokenAudioAndMixWithOthers);
6771
AVAudioSession.SharedInstance().SetActive(true);
68-
AVAudioFormat recording_format = new AVAudioFormat(AVAudioCommonFormat.PCMInt16, sampleRate, (uint)channels, false);
69-
uint buffer_size = (uint)CodecTools.getPcmFrameByteSize(sampleRate, bitRate, channels) * 1000;
70-
audioRecorder.InputNode.InstallTapOnBus(0, buffer_size, recording_format, onDataAvailable);
72+
73+
audioRecorder = new AVAudioEngine();
74+
75+
desiredFormat = new AVAudioFormat(AVAudioCommonFormat.PCMInt16, sampleRate, (uint)channels, false);
76+
recordingFormat = audioRecorder.InputNode.GetBusOutputFormat(0);
77+
78+
Logging.info($"Recording format: {recordingFormat}");
79+
Logging.info($"Desired output format: {desiredFormat}");
80+
81+
audioConverter = new AVAudioConverter(recordingFormat, desiredFormat);
82+
83+
84+
uint bufferSize = (uint)(recordingFormat.SampleRate * 0.1); // 100ms
85+
audioRecorder.InputNode.InstallTapOnBus(0, bufferSize, recordingFormat, onDataAvailable);
86+
7187
audioRecorder.Prepare();
7288
if (!audioRecorder.StartAndReturnError(out error))
7389
{
@@ -77,7 +93,21 @@ private void initRecorder()
7793

7894
private void onDataAvailable(AVAudioPcmBuffer buffer, AVAudioTime when)
7995
{
80-
AudioBuffer audioBuffer = buffer.AudioBufferList[0];
96+
AVAudioPcmBuffer outputBuffer = new AVAudioPcmBuffer(desiredFormat, (uint)(desiredFormat.SampleRate * 0.1)); // 100ms
97+
AVAudioConverterInputHandler inputHandler = (uint inNumberOfPackets, out AVAudioConverterInputStatus outStatus) =>
98+
{
99+
outStatus = AVAudioConverterInputStatus.HaveData;
100+
return buffer;
101+
};
102+
NSError? outError;
103+
var status = audioConverter.ConvertToBuffer(outputBuffer, out outError, inputHandler);
104+
if (status != AVAudioConverterOutputStatus.HaveData)
105+
{
106+
Logging.warn("Conversion failed or no data. Status: {0}, Error: {1}", status, outError?.LocalizedDescription ?? "Unknown error");
107+
return;
108+
}
109+
110+
AudioBuffer audioBuffer = outputBuffer.AudioBufferList[0];
81111
byte[] data = new byte[audioBuffer.DataByteSize];
82112
Marshal.Copy(audioBuffer.Data, data, 0, audioBuffer.DataByteSize);
83113

Spixi/Resources/Raw/html/css/spixiui-dark.css

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3349,7 +3349,8 @@ img.emoji {
33493349
padding-bottom: 8px;
33503350
min-height: 100px;
33513351
color: var(--colors-text-01);
3352-
overflow: break-all;
3352+
overflow: scroll;
3353+
word-break: break-all;
33533354
overflow-wrap: anywhere;
33543355
}
33553356

@@ -4111,6 +4112,7 @@ img.emoji {
41114112
opacity: 1; /* Initially hidden */
41124113
pointer-events: none; /* Allows interaction with elements below */
41134114
transition: opacity 0.3s ease;
4115+
z-index: 9998;
41144116
}
41154117

41164118
.spixi-app-details-header {
@@ -4220,9 +4222,10 @@ img.emoji {
42204222

42214223
.action-slide-up-container {
42224224
position: fixed;
4225+
top: auto;
42234226
bottom: 0;
42244227
right: 0;
4225-
width: 100%;
4228+
left: 0;
42264229
background: var(--colors-surface-01);
42274230
color: var(--colors-text-01);
42284231
border-radius: 32px 32px 0 0;
@@ -4231,15 +4234,14 @@ img.emoji {
42314234
display: flex;
42324235
flex-direction: column;
42334236
gap: 32px;
4234-
transform: translateY(100%);
4235-
transition: max-height 0.5s ease-in-out, transform 0.5s ease-in-out;
4236-
max-height: 0;
4237+
transform-origin: bottom;
4238+
transform: translateY(200%);
4239+
transition: transform 0.5s ease-in-out;
42374240
overflow: hidden;
42384241
}
42394242

42404243
.action-slide-up-container.active {
42414244
transform: translateY(0);
4242-
max-height: 500px;
42434245
}
42444246

42454247
.new-modal-wrapper {
@@ -4577,10 +4579,11 @@ img.emoji {
45774579
align-content: center;
45784580
justify-content: center;
45794581

4580-
> i {
4581-
color: var(--colors-icon-accent-dark);
4582-
font-size: 2rem;
4583-
}
4582+
}
4583+
4584+
.backup-prompt-icon-container > i {
4585+
color: var(--colors-icon-accent-dark);
4586+
font-size: 2rem;
45844587
}
45854588

45864589
.send-ixi-buttons {

Spixi/Resources/Raw/html/css/spixiui-light.css

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2533,7 +2533,7 @@ img.emoji {
25332533
padding: 10px;
25342534
background-color: var(--colors-surface-01);
25352535
color: var(--colors-icon-01);
2536-
border-radius: 0px 0x 12px 12px;
2536+
border-radius: 0px 0px 12px 12px;
25372537
font-size: 12pt;
25382538
font-weight: bold;
25392539
line-height: 20pt;
@@ -3330,7 +3330,8 @@ img.emoji {
33303330
padding-bottom: 8px;
33313331
min-height: 100px;
33323332
color: var(--colors-text-01);
3333-
overflow: break-all;
3333+
overflow: scroll;
3334+
word-break: break-all;
33343335
overflow-wrap: anywhere;
33353336
}
33363337

@@ -4083,6 +4084,7 @@ img.emoji {
40834084
opacity: 1; /* Initially hidden */
40844085
pointer-events: none; /* Allows interaction with elements below */
40854086
transition: opacity 0.3s ease;
4087+
z-index: 9998;
40864088
}
40874089

40884090
.spixi-app-details-header {
@@ -4192,27 +4194,27 @@ img.emoji {
41924194
background: var(--colors-surface-action-hover);
41934195
}
41944196

4195-
.action-slide-up-container{
4197+
.action-slide-up-container {
41964198
position: fixed;
4199+
top: auto;
41974200
bottom: 0;
41984201
right: 0;
4199-
width: 100%;
4202+
left: 0;
42004203
background: var(--colors-surface-01);
42014204
border-radius: 32px 32px 0 0;
42024205
padding: 24px 16px;
42034206
z-index: 9999;
42044207
display: flex;
42054208
flex-direction: column;
42064209
gap: 32px;
4207-
transform: translateY(100%);
4208-
transition: max-height 0.5s ease-in-out, transform 0.5s ease-in-out;
4209-
max-height: 0;
4210+
transform-origin: bottom;
4211+
transform: translateY(200%);
4212+
transition: transform 0.5s ease-in-out;
42104213
overflow: hidden;
42114214
}
42124215

42134216
.action-slide-up-container.active {
42144217
transform: translateY(0);
4215-
max-height: 500px;
42164218
}
42174219

42184220
.new-modal-wrapper{
@@ -4544,11 +4546,11 @@ img.emoji {
45444546
display: flex;
45454547
align-content: center;
45464548
justify-content: center;
4549+
}
45474550

4548-
> i{
4549-
color: var(--colors-icon-accent-dark);
4550-
font-size: 2rem;
4551-
}
4551+
.backup-prompt-icon-container > i {
4552+
color: var(--colors-icon-accent-dark);
4553+
font-size: 2rem;
45524554
}
45534555

45544556
.send-ixi-buttons{

Spixi/Resources/Raw/html/css/webflow.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1876,7 +1876,8 @@ textarea.w-select {
18761876
padding-bottom: 8px;
18771877
min-height: 100px;
18781878
color: #6a6a6a;
1879-
overflow: break-all;
1879+
overflow: scroll;
1880+
word-break: break-all;
18801881
overflow-wrap: anywhere;
18811882
}
18821883

Spixi/Resources/Raw/html/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
<div class="important-notice-text">
122122
<span class="label-sm">*SL{index-missing-tx-title}</span>
123123
<span class="body-xs">*SL{index-missing-tx-text}</span>
124-
<span class="label-xs s-text-link" onclick="window.open('https://explorer.ixian.io/')">*SL{index-missing-tx-view-all} <i class="fa fa-arrow-right"></i></span>
124+
<span class="label-xs s-text-link" onclick="selectMenuOption('explorer');">*SL{index-missing-tx-view-all} <i class="fa fa-arrow-right"></i></span>
125125
</div>
126126
<i class="fa fa-chevron-down notice-toggle-chevron" style="cursor: pointer" onclick="toggleImportantNotice(this)"></i>
127127
</div>

Spixi/Resources/Raw/html/settings.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,10 @@
155155
<div class="spixi-holder-40"></div>
156156

157157
<hr class="spixi-separator-main" />
158-
<div id="lockSwitch" class="spixi-switch off"></div>
158+
159+
<div class="spixi-textsection-holder">
160+
<div id="lockSwitch" class="spixi-switch off"></div>
161+
</div>
159162

160163
<div class="spixi-textsection-holder spixi-textsection-header">
161164
*SL{settings-lock-title}

Spixi/Resources/Raw/html/wallet_sent.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
</div>
113113
<div class="payment-data-row">
114114
<div id="viewexplorer" class="spixi-flat-button" style="width: 100%;">
115-
<i class="fa-solid fa-arrow-up-right-from-square"></i> View in Explorer
115+
<i class="fa-solid fa-arrow-up-right-from-square"></i> *SL{wallet-sent-view-explorer}
116116
</div>
117117
</div>
118118
</section>

0 commit comments

Comments
 (0)