Skip to content

Commit

Permalink
Merge pull request #85 from alekseynemiro/v1.4
Browse files Browse the repository at this point in the history
v1.4_to_master
  • Loading branch information
alekseynemiro authored Jun 8, 2023
2 parents 658a44c + cdce1a3 commit a7fc982
Show file tree
Hide file tree
Showing 57 changed files with 1,549 additions and 562 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Change Log

## v1.4 (June 8, 2023)

This release contains significant improvements, bug fixes and performance improvements.

### Added

* Added the ability to change the language of the application interface (https://github.com/alekseynemiro/tapplayer/issues/9).
* Added automatic opening of the last project (https://github.com/alekseynemiro/tapplayer/issues/10).
* Added logging (https://github.com/alekseynemiro/tapplayer/issues/6).

### Removed

* Removed automatic adjustment of the color of the status indicators due to possible instability (https://github.com/alekseynemiro/tapplayer/issues/90).

### Changed

* Tiles in the project editor now have status indicators (https://github.com/alekseynemiro/tapplayer/issues/58).
* New versioning convention (https://github.com/alekseynemiro/tapplayer/issues/81).

### Fixed

* Fixed performance issues (https://github.com/alekseynemiro/tapplayer/issues/72).
* Fixed issue with missing scrollbars (https://github.com/alekseynemiro/tapplayer/issues/61).
* Fixed display position of labels on tiles (https://github.com/alekseynemiro/tapplayer/issues/65).

## v1.0.3 (May 27, 2023)

This release contains critical fixes and improvements.
Expand Down
4 changes: 4 additions & 0 deletions media-kit/history/README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

Записи, которые были сделаны в процессе работы над проектом:

* https://vk.com/aleksey.developer?w=wall-96983816_204 - Невозможное поведение UI от автоматического тестирования Google Play
* https://vk.com/aleksey.developer?w=wall-96983816_203 - Коварный баг с копированием неправильного кода XAML в MAUI
* https://vk.com/aleksey.developer?w=wall-96983816_201 - Проблема замены главной страницы и освобождения ресурсов
* https://vk.com/aleksey.developer?w=wall-96983816_197 - Пробелмы производительности MAUI
* https://vk.com/aleksey.developer?w=wall-96983816_195 - NotFoundException: 'Resource ID #0x7f0d003a'
* https://vk.com/aleksey.developer?w=wall-96983816_193 - Организация рабочего процесса над проектом
* https://vk.com/aleksey.developer?w=wall-96983816_192 - Публикация в Google Play
Expand Down
89 changes: 48 additions & 41 deletions src/TapPlayer.Maui/AboutPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,55 @@
x:Class="TapPlayer.Maui.AboutPage"
Title="{markup:Localization Key=About}"
>
<VerticalStackLayout
Padding="16"
Spacing="8"
<ScrollView
HorizontalScrollBarVisibility="Never"
VerticalScrollBarVisibility="Default"
HorizontalOptions="Fill"
VerticalOptions="Fill"
StyleClass="WithPadding"
>
<HorizontalStackLayout
Spacing="4"
<VerticalStackLayout
Spacing="8"
>
<ImageButton
Source="tapplayer.png"
HorizontalOptions="Center"
VerticalOptions="Start"
MaximumWidthRequest="64"
MaximumHeightRequest="64"
Margin="0,0,8,0"
SemanticProperties.Description="TapPlayer logo"
<HorizontalStackLayout
Spacing="4"
>
<ImageButton
Source="tapplayer.png"
HorizontalOptions="Center"
VerticalOptions="Start"
MaximumWidthRequest="64"
MaximumHeightRequest="64"
Margin="0,0,8,0"
SemanticProperties.Description="TapPlayer logo"
/>
<VerticalStackLayout Spacing="4">
<HorizontalStackLayout Spacing="4">
<Label
Text="TapPlayer"
/>
<Label
Text="{Binding Version}"
/>
</HorizontalStackLayout>
<HorizontalStackLayout Spacing="4">
<Label Text="Author:" />
<Label Text="Aleksey Nemiro" />
</HorizontalStackLayout>
</VerticalStackLayout>
</HorizontalStackLayout>
<BoxView StyleClass="Separator" />
<components:Hyperlink Text="https://aleksey.nemiro.ru" Url="https://aleksey.nemiro.ru" />
<components:Hyperlink Text="https://vk.com/aleksey.nemiro" Url="https://vk.com/aleksey.nemiro" />
<components:Hyperlink Text="https://github.com/alekseynemiro" Url="https://github.com/alekseynemiro" />
<BoxView StyleClass="Separator" />
<Button
Text="Ok"
Command="{Binding OkCommand}"
StyleClass="SecondaryButton"
HorizontalOptions="Start"
MinimumWidthRequest="75"
/>
<VerticalStackLayout Spacing="4">
<HorizontalStackLayout Spacing="4">
<Label
Text="TapPlayer"
/>
<Label
Text="{Binding Version}"
/>
</HorizontalStackLayout>
<HorizontalStackLayout Spacing="4">
<Label Text="Author:" />
<Label Text="Aleksey Nemiro" />
</HorizontalStackLayout>
</VerticalStackLayout>
</HorizontalStackLayout>
<BoxView StyleClass="Separator" />
<components:Hyperlink Text="https://aleksey.nemiro.ru" Url="https://aleksey.nemiro.ru" />
<components:Hyperlink Text="https://vk.com/aleksey.nemiro" Url="https://vk.com/aleksey.nemiro" />
<components:Hyperlink Text="https://github.com/alekseynemiro" Url="https://github.com/alekseynemiro" />
<BoxView StyleClass="Separator" />
<Button
Text="Ok"
Command="{Binding OkCommand}"
StyleClass="SecondaryButton"
HorizontalOptions="Start"
MinimumWidthRequest="75"
/>
</VerticalStackLayout>
</VerticalStackLayout>
</ScrollView>
</ContentPage>
17 changes: 16 additions & 1 deletion src/TapPlayer.Maui/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
namespace TapPlayer.Maui;
using System.Globalization;
using TapPlayer.Maui.Services;

namespace TapPlayer.Maui;

public partial class App : Application
{
public App(IServiceProvider serviceProvider)
{
InitializeComponent();

var appSettings = serviceProvider.GetRequiredService<IAppSettingsService>();
var activeProjectService = serviceProvider.GetRequiredService<IActiveProjectService>();

if (appSettings.Language != 0)
{
Thread.CurrentThread.CurrentCulture =
Thread.CurrentThread.CurrentUICulture =
CultureInfo.GetCultureInfo(appSettings.Language);
}

activeProjectService.Set(appSettings.LastProjectId);

Current.UserAppTheme = AppTheme.Light;
MainPage = serviceProvider.GetRequiredService<AppShell>();
}
Expand Down
30 changes: 30 additions & 0 deletions src/TapPlayer.Maui/AppBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using CommunityToolkit.Maui;
using MetroLog.MicrosoftExtensions;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;
using TapPlayer.Core.Services;
using TapPlayer.Core.Services.Projects;
using TapPlayer.Data;
Expand All @@ -26,6 +28,29 @@ public static MauiAppBuilder CreateBuilder()
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});

// logging
builder.Logging
.SetMinimumLevel(LogLevel.Trace)
.AddTraceLogger(options =>
{
options.MinLevel = LogLevel.Trace;
options.MaxLevel = LogLevel.Critical;
})
.AddConsoleLogger(options =>
{
#if DEBUG
options.MinLevel = LogLevel.Trace;
#else
options.MinLevel = LogLevel.Information;
#endif
options.MaxLevel = LogLevel.Critical;
}) // will write to the Console Output (logcat for android)
.AddStreamingFileLogger(options =>
{
options.RetainDays = 2;
options.FolderPath = Path.Combine(FileSystem.CacheDirectory, "logs");
});

// localization
builder.Services.AddLocalization();
builder.Services.AddSingleton<IStringLocalizer<CommonStrings>, StringLocalizer<CommonStrings>>();
Expand All @@ -35,6 +60,8 @@ public static MauiAppBuilder CreateBuilder()
builder.Services.AddSingleton<IJsonStorageConfig, JsonStorageConfig>();

// common services
builder.Services.AddSingleton(Preferences.Default);
builder.Services.AddSingleton<IAppSettingsService, AppSettingsService>();
builder.Services.AddSingleton<IDateTimeService, DateTimeService>();
builder.Services.AddSingleton<IProjectListService, ProjectListService>();
builder.Services.AddSingleton<IProjectService, ProjectService>();
Expand All @@ -43,13 +70,15 @@ public static MauiAppBuilder CreateBuilder()
builder.Services.AddSingleton<IActiveProjectService, ActiveProjectService>();
builder.Services.AddSingleton<IAppInfo, Services.AppInfo>();
builder.Services.AddSingleton<IDialogService, DialogService>();
builder.Services.AddSingleton<IDispatcherService, DispatcherService>();
builder.Services.AddSingleton<IKeyboardService, KeyboardService>();
builder.Services.AddSingleton<INavigationService, NavigationService>();
builder.Services.AddSingleton<ITapPlayerService, TapPlayerService>();

// view models
builder.Services.AddSingleton<IAppShellViewModel, AppShellViewModel>();
builder.Services.AddTransient<IAboutPageViewModel, AboutPageViewModel>();
builder.Services.AddTransient<IAppSettingsPageViewModel, AppSettingsPageViewModel>();
builder.Services.AddTransient<IMainPageViewModel, MainPageViewModel>();
builder.Services.AddTransient<IProjectEditViewModel, ProjectEditViewModel>();
builder.Services.AddTransient<IProjectListItemViewModel, ProjectListItemViewModel>();
Expand All @@ -62,6 +91,7 @@ public static MauiAppBuilder CreateBuilder()

// pages
builder.Services.AddPage<AboutPage>();
builder.Services.AddPage<AppSettingsPage>();
builder.Services.AddPage<MainPage>();
builder.Services.AddPage<ProjectEditPage>();
builder.Services.AddPage<ProjectListPage>();
Expand Down
53 changes: 53 additions & 0 deletions src/TapPlayer.Maui/AppSettingsPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TapPlayer.Maui.AppSettingsPage"
xmlns:markup="clr-namespace:TapPlayer.Maui.MarkupExtensions"
Title="{markup:Localization Key=ApplicationSettings}"
>
<ScrollView
HorizontalScrollBarVisibility="Never"
VerticalScrollBarVisibility="Default"
HorizontalOptions="Fill"
VerticalOptions="Fill"
StyleClass="WithPadding"
>
<VerticalStackLayout
Spacing="8"
>
<Label Text="{markup:Localization Key=LanguageField}" />
<Border StyleClass="FormField">
<Picker
ItemsSource="{Binding AvailableLanguages}"
ItemDisplayBinding="{Binding Name}"
SelectedItem="{Binding CurrentLanguage}"
SemanticProperties.Description="{markup:Localization Key=LanguageField}"
/>
</Border>

<Label Text="{markup:Localization Key=RestartIsRequired}" />

<BoxView
StyleClass="Separator"
/>

<HorizontalStackLayout
Margin="0"
Spacing="8"
>
<Button
Text="{markup:Localization Key=Save}"
Command="{Binding SaveCommand}"
SemanticProperties.Description="{markup:Localization Key=SaveAppSettings}"
/>
<Button
Text="{markup:Localization Key=Cancel}"
StyleClass="SecondaryButton"
Command="{Binding CloseCommand}"
SemanticProperties.Description="{markup:Localization Key=CloseAppSettings}"
/>
</HorizontalStackLayout>
</VerticalStackLayout>
</ScrollView>
</ContentPage>
12 changes: 12 additions & 0 deletions src/TapPlayer.Maui/AppSettingsPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using TapPlayer.Maui.ViewModels;

namespace TapPlayer.Maui;

public partial class AppSettingsPage : ContentPage
{
public AppSettingsPage(IAppSettingsPageViewModel model)
{
BindingContext = model;
InitializeComponent();
}
}
4 changes: 4 additions & 0 deletions src/TapPlayer.Maui/AppShell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
Text="{markup:Localization Key=ProjectSettings}"
Command="{Binding ProjectSettingsCommand}"
/>
<MenuItem
Text="{markup:Localization Key=ApplicationSettings}"
Command="{Binding ApplicationSettingsCommand}"
/>
<MenuItem
Text="{markup:Localization Key=About}"
Command="{Binding AboutCommand}"
Expand Down
5 changes: 5 additions & 0 deletions src/TapPlayer.Maui/Behaviors/DummyBehavior.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace TapPlayer.Maui.Behaviors;

internal class DummyBehavior : PlatformBehavior<View>
{
}
Loading

0 comments on commit a7fc982

Please sign in to comment.