Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to .NET8 #100

Merged
merged 26 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
731104c
MAUIバージョンを更新
TetsuOtter Sep 24, 2023
4f41950
nullじゃないのは明白なので、nullableで返さないようにした
TetsuOtter Sep 24, 2023
4d81e5f
Brushを生成できるようにした
TetsuOtter Sep 24, 2023
6a90649
Lineが表示されないバグに対応
TetsuOtter Sep 24, 2023
260a522
Spanが正常に反映されない問題に対応
TetsuOtter Sep 24, 2023
fade375
下手にAddWithSpanを使うとSetRow等が効かなくなるため、修正
TetsuOtter Sep 25, 2023
4403a9a
うまいことRemarksが表示されるようにした
TetsuOtter Sep 25, 2023
55050e6
Merge branch 'main' into fix/span-not-working
TetsuOtter Sep 26, 2023
f7cfa8d
Merge branch 'main' into fix/span-not-working
TetsuOtter Nov 16, 2023
025ae1d
update package versions
TetsuOtter Nov 16, 2023
7323743
不要な実装を削除
TetsuOtter Nov 16, 2023
f6195be
不要なスタイル設定の削除と、スタイル設定のDTACElementStylesへの移行
TetsuOtter Nov 18, 2023
e10ff30
うまくLineが表示されない問題に対応
TetsuOtter Nov 18, 2023
16356cb
Lineが正常に描画されない問題に対応
TetsuOtter Nov 19, 2023
914b104
時刻表エリアの線が正常に表示されない問題を修正
TetsuOtter Nov 20, 2023
9f8f952
線の描画をちょいちょい修正
TetsuOtter Nov 20, 2023
8fc2a1c
RemarksViewの表示位置を微修正
TetsuOtter Nov 20, 2023
553c6ea
LocationServiceButtonのIsEnabled対応を実装
TetsuOtter Nov 20, 2023
997e382
Separatorを微修正
TetsuOtter Nov 20, 2023
dd4a28e
Title部分の微調整
TetsuOtter Nov 20, 2023
13cf438
着発時刻の「分」が改行されてしまう問題を修正
TetsuOtter Nov 20, 2023
f5a5329
.NET SDKバージョンをGA版に変更
TetsuOtter Nov 20, 2023
9db87f4
macosのバージョンを13に上げた
TetsuOtter Nov 20, 2023
4593061
[skip ci] iOS / macいずれかのpublishに失敗した際にそこで実行中止しないようにした
TetsuOtter Nov 20, 2023
616a741
[skip ci] fix warnings
TetsuOtter Nov 20, 2023
e26c4cc
[skip ci] TrainInfoとBeforeDepartureの間の線が薄い不具合を修正
TetsuOtter Nov 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/cd-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ env:
PKG_PATH: ./out/TRViS.pkg
AAB_PATH: ./out/dev.t0r.trvis-Signed.aab
APK_PATH: ./out/dev.t0r.trvis-Signed.apk
SDK_VERSION: '8.0.100-preview.4.23260.5'
SDK_VERSION: '8.0.100'
APP_CENTER_SECRETS_FILE_NAME: ./TRViS/AppCenterSecrets.cs
IOS_DSYM_PATH: ./TRViS/bin/Release/net8.0-ios/ios-arm64
IOS_DSYM_FILENAME: TRViS.app.dSYM
Expand Down Expand Up @@ -133,7 +133,7 @@ jobs:
|| github.event.pull_request.draft == false
)

runs-on: macos-12
runs-on: macos-13
timeout-minutes: 30
needs:
- get-version
Expand Down Expand Up @@ -337,7 +337,7 @@ jobs:
|| github.event.pull_request.draft == false
)

runs-on: macos-12
runs-on: macos-13
timeout-minutes: 30
needs:
- get-version
Expand Down Expand Up @@ -581,7 +581,6 @@ jobs:
needs.publish-ios.result == 'success'
|| needs.publish-mac.result == 'success'
)
&& !failure()

runs-on: ubuntu-latest
timeout-minutes: 5
Expand Down
6 changes: 3 additions & 3 deletions TRViS.IO.Tests/TRViS.IO.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.1" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit.Analyzers" Version="3.6.1"><IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PackageReference Include="NUnit.Analyzers" Version="3.9.0"><IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0"><IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
4 changes: 2 additions & 2 deletions TRViS.IO/TRViS.IO.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="sqlite-net-pcl" Version="1.8.116" />
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="2.1.5" />
<PackageReference Include="System.Text.Json" Version="7.0.2" />
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="2.1.6" />
<PackageReference Include="System.Text.Json" Version="8.0.0" />
</ItemGroup>
</Project>
5 changes: 2 additions & 3 deletions TRViS/DTAC/BeforeAfterRemarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ public BeforeAfterRemarks(Grid Parent)

IsVisible = false;

Grid.SetColumn(Label, 2);
Grid.SetColumnSpan(Label, 6);

Label.Margin = new(32, 0);
Label.HorizontalOptions = LayoutOptions.Start;
Label.LineHeight = 1.4;
Expand Down Expand Up @@ -47,6 +44,8 @@ public string Text

public void AddToParent()
{
Grid.SetColumn(Label, 2);
Grid.SetColumnSpan(Label, 6);
Parent.Add(Label);
}

Expand Down
21 changes: 4 additions & 17 deletions TRViS/DTAC/BeforeDeparture_AfterArrive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ public class BeforeDeparture_AfterArrive
};
readonly Label HeaderLabel = DTACElementStyles.HeaderLabelStyle<Label>();

readonly Line UpperSeparator = DTACElementStyles.HorizontalSeparatorLineStyle();
readonly Line LowerSeparator = DTACElementStyles.HorizontalSeparatorLineStyle();

readonly HtmlAutoDetectLabel Label = DTACElementStyles.LabelStyle<HtmlAutoDetectLabel>();
readonly HtmlAutoDetectLabel Label_OnStationTrackColumn = DTACElementStyles.LabelStyle<HtmlAutoDetectLabel>();

Expand All @@ -39,17 +36,9 @@ public BeforeDeparture_AfterArrive(Grid Parent, string HeaderLabelText, bool Alw
this.Parent = Parent;
this.AlwaysShow = AlwaysShow;

UpperSeparator.VerticalOptions = LayoutOptions.Start;

Label.HorizontalOptions = LayoutOptions.Start;
Label_OnStationTrackColumn.HorizontalOptions = LayoutOptions.Start;

Grid.SetColumn(Label, 1);
Grid.SetColumnSpan(Label, 7);

Grid.SetColumn(Label_OnStationTrackColumn, 4);
Grid.SetColumnSpan(Label_OnStationTrackColumn, 4);

DTACElementStyles.HeaderTextColor.Apply(HeaderLabel, Microsoft.Maui.Controls.Label.TextColorProperty);
DTACElementStyles.HeaderBackgroundColor.Apply(HeaderBoxView, BoxView.ColorProperty);

Expand Down Expand Up @@ -99,10 +88,12 @@ public void AddToParent()
{
Parent.Add(HeaderBoxView);
Parent.Add(HeaderLabel);
Grid.SetColumn(Label, 1);
Grid.SetColumn(Label_OnStationTrackColumn, 4);
Grid.SetColumnSpan(Label, 7);
Grid.SetColumnSpan(Label_OnStationTrackColumn, 4);
Parent.Add(Label);
Parent.Add(Label_OnStationTrackColumn);
Parent.Add(LowerSeparator);
Parent.Add(UpperSeparator);
}

bool _IsVisible = false;
Expand All @@ -122,8 +113,6 @@ public bool IsVisible

HeaderBoxView.IsVisible
= HeaderLabel.IsVisible
= LowerSeparator.IsVisible
= UpperSeparator.IsVisible
= Label.IsVisible
= Label_OnStationTrackColumn.IsVisible
= value;
Expand All @@ -134,8 +123,6 @@ public void SetRow(in int row)
{
Grid.SetRow(HeaderBoxView, row);
Grid.SetRow(HeaderLabel, row);
Grid.SetRow(LowerSeparator, row);
Grid.SetRow(UpperSeparator, row);
Grid.SetRow(Label, row);
Grid.SetRow(Label_OnStationTrackColumn, row);
}
Expand Down
181 changes: 174 additions & 7 deletions TRViS/DTAC/DTACElementStyles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ public static readonly AppThemeGenericsBindingExtension<Brush> MarkerMarkButtonB
);

public static readonly AppThemeColorBindingExtension ForegroundBlackWhite = genColor(0x00, 0xFF);
public static readonly AppThemeGenericsBindingExtension<Brush> ForegroundBlackWhiteBrush = ForegroundBlackWhite.ToBrushTheme();

public static readonly AppThemeColorBindingExtension LocationServiceSelectedSideFrameColor = genColor(0xFF, 0xAA);
public static readonly AppThemeColorBindingExtension LocationServiceSelectedSideDisabledFrameColor = genColor(0xDD, 0x99);
public static readonly AppThemeColorBindingExtension LocationServiceSelectedSideTextColor = genColor(0xFF, 0xDD);
public static readonly AppThemeColorBindingExtension LocationServiceNotSelectedSideTextColor = genColor(0x00, 0x00);
public static readonly AppThemeColorBindingExtension LocationServiceNotSelectedSideBaseColor = genColor(0xFF, 0xDD);
public static readonly AppThemeColorBindingExtension LocationServiceNotSelectedSideDisabledBaseColor = genColor(0xDD, 0x99);

public static readonly AppThemeColorBindingExtension StartEndRunButtonTextColor = genColor(0xFF, 0xE0);

Expand Down Expand Up @@ -84,6 +88,28 @@ public static readonly AppThemeGenericsBindingExtension<Brush> MarkerMarkButtonB
new(new(64))
);

static Style? _labelStyleResource = null;
public static Style LabelStyleResource
{
get
{
if (_labelStyleResource is not null)
return _labelStyleResource;

_labelStyleResource = new Style(typeof(Label));
_labelStyleResource.Setters.Add(Label.HorizontalOptionsProperty, LayoutOptions.Center);
_labelStyleResource.Setters.Add(Label.VerticalOptionsProperty, LayoutOptions.Center);
_labelStyleResource.Setters.Add(Label.TextColorProperty, DefaultTextColor);
_labelStyleResource.Setters.Add(Label.FontSizeProperty, DefaultTextSize);
_labelStyleResource.Setters.Add(Label.FontFamilyProperty, DefaultFontFamily);
_labelStyleResource.Setters.Add(Label.MarginProperty, new Thickness(4, 0));
_labelStyleResource.Setters.Add(Label.LineBreakModeProperty, LineBreakMode.CharacterWrap);
_labelStyleResource.Setters.Add(Label.LineHeightProperty, DeviceInfo.Platform == DevicePlatform.Android ? 0.9 : 1.1);

return _labelStyleResource;
}
}

public static T LabelStyle<T>() where T : Label, new()
{
T v = new();
Expand All @@ -101,6 +127,25 @@ public static readonly AppThemeGenericsBindingExtension<Brush> MarkerMarkButtonB
return v;
}

static Style? _headerLabelStyleResource = null;
public static Style HeaderLabelStyleResource
{
get
{
if (_headerLabelStyleResource is not null)
return _headerLabelStyleResource;

_headerLabelStyleResource = new Style(typeof(Label))
{
BasedOn = LabelStyleResource
};

_headerLabelStyleResource.Setters.Add(Label.TextColorProperty, HeaderTextColor);
_headerLabelStyleResource.Setters.Add(Label.MarginProperty, new Thickness(1));

return _headerLabelStyleResource;
}
}
public static T HeaderLabelStyle<T>() where T : Label, new()
{
T v = LabelStyle<T>();
Expand Down Expand Up @@ -146,6 +191,27 @@ public static readonly AppThemeGenericsBindingExtension<Brush> MarkerMarkButtonB
return v;
}

static Style? _timetableLabelStyleResource = null;
public static Style TimetableLabelStyleResource
{
get
{
if (_timetableLabelStyleResource is not null)
return _timetableLabelStyleResource;

_timetableLabelStyleResource = new Style(typeof(Label))
{
BasedOn = LabelStyleResource
};

_timetableLabelStyleResource.Setters.Add(Label.TextColorProperty, TimetableTextColor);
_timetableLabelStyleResource.Setters.Add(Label.FontSizeProperty, DeviceInfo.Current.Platform == DevicePlatform.iOS ? 28 : 26);
_timetableLabelStyleResource.Setters.Add(Label.FontAttributesProperty, FontAttributes.Bold);
_timetableLabelStyleResource.Setters.Add(Label.InputTransparentProperty, true);

return _timetableLabelStyleResource;
}
}
public static T TimetableLabel<T>() where T : Label, new()
{
T v = LabelStyle<T>();
Expand All @@ -158,6 +224,26 @@ public static readonly AppThemeGenericsBindingExtension<Brush> MarkerMarkButtonB
return v;
}

static Style? _timetableLargeNumberLabelStyleResource = null;
public static Style TimetableLargeNumberLabelStyleResource
{
get
{
if (_timetableLargeNumberLabelStyleResource is not null)
return _timetableLargeNumberLabelStyleResource;

_timetableLargeNumberLabelStyleResource = new Style(typeof(Label))
{
BasedOn = TimetableLabelStyleResource
};

_timetableLargeNumberLabelStyleResource.Setters.Add(Label.FontFamilyProperty, TimetableNumFontFamily);
_timetableLargeNumberLabelStyleResource.Setters.Add(Label.VerticalOptionsProperty, LayoutOptions.End);
_timetableLargeNumberLabelStyleResource.Setters.Add(Label.LineBreakModeProperty, LineBreakMode.NoWrap);

return _timetableLargeNumberLabelStyleResource;
}
}
public static T TimetableLargeNumberLabel<T>() where T : Label, new()
{
T v = TimetableLabel<T>();
Expand Down Expand Up @@ -203,6 +289,25 @@ public static readonly AppThemeGenericsBindingExtension<Brush> MarkerMarkButtonB
return v;
}

static Style? _timetableDefaultNumberLabelStyleResource = null;
public static Style TimetableDefaultNumberLabelStyleResource
{
get
{
if (_timetableDefaultNumberLabelStyleResource is not null)
return _timetableDefaultNumberLabelStyleResource;

_timetableDefaultNumberLabelStyleResource = new Style(typeof(Label))
{
BasedOn = TimetableLargeNumberLabelStyleResource
};

_timetableDefaultNumberLabelStyleResource.Setters.Add(Label.FontSizeProperty, 16);
_timetableDefaultNumberLabelStyleResource.Setters.Add(Label.MarginProperty, new Thickness(1, 3));

return _timetableDefaultNumberLabelStyleResource;
}
}
public static T TimetableDefaultNumberLabel<T>() where T : Label, new()
{
T v = TimetableLabel<T>();
Expand All @@ -213,19 +318,80 @@ public static readonly AppThemeGenericsBindingExtension<Brush> MarkerMarkButtonB
return v;
}

static readonly AppThemeGenericsBindingExtension<Brush> SeparatorLineBrush = SeparatorLineColor.ToBrushTheme();
static Style? _horizontalSeparatorLineStyleResource = null;
public static Style HorizontalSeparatorLineStyleResource
{
get
{
if (_horizontalSeparatorLineStyleResource is not null)
return _horizontalSeparatorLineStyleResource;

_horizontalSeparatorLineStyleResource = new Style(typeof(Line));

_horizontalSeparatorLineStyleResource.Setters.Add(Line.VerticalOptionsProperty, LayoutOptions.End);
_horizontalSeparatorLineStyleResource.Setters.Add(Line.StrokeThicknessProperty, 0.5);
_horizontalSeparatorLineStyleResource.Setters.Add(Line.HeightRequestProperty, 0.5);
_horizontalSeparatorLineStyleResource.Setters.Add(Line.StrokeProperty, SeparatorLineBrush.Default);
_horizontalSeparatorLineStyleResource.Setters.Add(Grid.ColumnSpanProperty, 8);
_horizontalSeparatorLineStyleResource.Setters.Add(Line.X1Property, 0);
_horizontalSeparatorLineStyleResource.Setters.Add(Line.X2Property, 10000);

return _horizontalSeparatorLineStyleResource;
}
}
static Style? _verticalSeparatorLineStyleResource = null;
public static Style VerticalSeparatorLineStyleResource
{
get
{
if (_verticalSeparatorLineStyleResource is not null)
return _verticalSeparatorLineStyleResource;

_verticalSeparatorLineStyleResource = new Style(typeof(Line));

_verticalSeparatorLineStyleResource.Setters.Add(Line.HorizontalOptionsProperty, LayoutOptions.End);
_verticalSeparatorLineStyleResource.Setters.Add(Line.MarginProperty, new Thickness(0, 6));
_verticalSeparatorLineStyleResource.Setters.Add(Line.StrokeProperty, SeparatorLineBrush.Default);
_verticalSeparatorLineStyleResource.Setters.Add(Line.StrokeThicknessProperty, 1);
_verticalSeparatorLineStyleResource.Setters.Add(Line.WidthRequestProperty, 1);
_verticalSeparatorLineStyleResource.Setters.Add(Line.Y1Property, 0);
_verticalSeparatorLineStyleResource.Setters.Add(Line.Y2Property, 100);

return _verticalSeparatorLineStyleResource;
}
}
public static Line HorizontalSeparatorLineStyle()
{
Line v = new();
Line v = new()
{
VerticalOptions = LayoutOptions.End,
StrokeThickness = 0.5,
HeightRequest = 0.5,
X1 = 0,
X2 = 10000,
};

v.VerticalOptions = LayoutOptions.End;
SeparatorLineColor.Apply(v, Line.BackgroundColorProperty);
v.StrokeThickness = 0.5;
v.HeightRequest = 0.5;
SeparatorLineBrush.Apply(v, Line.StrokeProperty);

Grid.SetColumnSpan(v, 8);
return v;
}
public static Line TimetableRowHorizontalSeparatorLineStyle()
{
Line v = HorizontalSeparatorLineStyle();

v.Opacity = 0.5;

return v;
}
public static void AddTimetableRowHorizontalSeparatorLineStyle(Grid grid, int row)
=> AddHorizontalSeparatorLineStyle(grid, TimetableRowHorizontalSeparatorLineStyle(), row);
public static void AddHorizontalSeparatorLineStyle(Grid grid, Line line, int row)
{
Grid.SetRow(line, row);
Grid.SetColumnSpan(line, 8);
grid.Add(line);
}

public static TimeCell TimeCell()
{
Expand Down Expand Up @@ -258,6 +424,7 @@ public static Grid LastStopLineGrid()
return v;
}

static readonly AppThemeGenericsBindingExtension<Brush> LastStopLineBrush = TimetableTextColor.ToBrushTheme();
public static Line LastStopLine()
{
Line v = new()
Expand All @@ -272,7 +439,7 @@ public static Line LastStopLine()
HorizontalOptions = LayoutOptions.Center,
};

TimetableTextColor.Apply(v, Line.BackgroundColorProperty);
LastStopLineBrush.Apply(v, Line.StrokeProperty);

return v;
}
Expand Down
Loading