Skip to content

Commit

Permalink
Some design and stability update
Browse files Browse the repository at this point in the history
  • Loading branch information
kurema committed Jul 6, 2022
1 parent 40e9e9d commit 8970f5e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,21 @@ public double CurrentPosition
}
}

public bool IsPlaying => audioTrack?.PlayState == PlayState.Playing && audioTrack?.State == AudioTrackState.Initialized && audioTrack?.PlaybackHeadPosition != audioTrack?.BufferSizeInFrames;
public bool IsPlaying
{
get
{
try
{
return audioTrack?.PlayState == PlayState.Playing && audioTrack?.State == AudioTrackState.Initialized &&
(Build.VERSION.SdkInt < BuildVersionCodes.N || audioTrack?.PlaybackHeadPosition != audioTrack?.BufferSizeInFrames);
}
catch
{
return false;
}
}
}

public async Task Register(Func<int, int, int, (double, bool)> generator, double duration, int sampleRate = 44100)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ private async static void Speak(object a)
Resx.LocalResources.LeftRight,
Resx.LocalResources.Left,
Resx.LocalResources.Right,
Resx.AppResources.More_OpenDictionary_Left,
Resx.AppResources.More_OpenDictionary_Right,
Resx.AppResources.Word_Center,
Resx.AppResources.Word_Frequency,
Resx.AppResources.Sound_Sweep_Title,
//Resx.AppResources.More_OpenDictionary_Left,
//Resx.AppResources.More_OpenDictionary_Right,
Resx.AppResources.More_OpenCompass_Title,
Resx.AppResources.Profile_Accounts_Github_ID,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
<Label Text="{x:Static r:AppResources.Sound_Tune_JustIntonation}" VerticalOptions="Center" />
</StackLayout>
</ScrollView>
<local:AdDefaultView HeightRequest="51" HorizontalOptions="Fill" WidthRequest="320" />
<local:AdDefaultView HeightRequest="51" HorizontalOptions="Fill" WidthRequest="320" Margin="0,0,0,33" />
</StackLayout>
</ScrollView>

Expand Down Expand Up @@ -257,7 +257,7 @@
<Label Text="{x:Static r:AppResources.Sound_Sweep_Option_Step}" VerticalOptions="Center" />
</StackLayout>
</ScrollView>
<local:AdDefaultView HeightRequest="51" HorizontalOptions="Fill" WidthRequest="320" />
<local:AdDefaultView HeightRequest="51" HorizontalOptions="Fill" WidthRequest="320" Margin="0,0,0,33" />
</StackLayout>
</ScrollView>
<!--<Button Grid.Row="2" Margin="0" Text="{x:Static r:AppResources.Word_Play_Sound}" Clicked="Button_Clicked" />-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,12 @@
</Grid.ColumnDefinitions>
<Picker ItemsSource="{Binding SearchWords}" SelectedItem="{Binding SearchWord,Mode=TwoWay}" />
<Picker ItemsSource="{Binding SearchServices}" Grid.Column="1" ItemDisplayBinding="{Binding Title,Mode=OneWay}" SelectedItem="{Binding SearchServiceSelected,Mode=TwoWay}" />
<Button Text="{x:Static r:AppResources.More_Search_Word}" Command="{Binding OpenSearchCommand}" Grid.Column="2" />
<!--<Button Text="{x:Static r:AppResources.More_Search_Word}" Command="{Binding OpenSearchCommand}" Grid.Column="2" />-->
<Button Grid.Column="2" Command="{Binding OpenSearchCommand}" >
<Button.ImageSource>
<FontImageSource FontFamily="Material" Glyph="&#xe8b6;" />
</Button.ImageSource>
</Button>
</Grid>
</StackLayout>
</StackLayout>
Expand Down

0 comments on commit 8970f5e

Please sign in to comment.