Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

詳細を確認するリンクの遷移先設定 #1175

Merged
merged 2 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions Covid19Radar/Covid19Radar/Common/AppConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ public static readonly DateTime SURVEY_END_DATE_UTC
/// </summary>
public const int EventLogFileExpiredSeconds = 14 * 24 * 60 * 60; // 14 days

public const string EndOfServiceCheckDetailsUrl = "https://www.mhlw.go.jp/cocoa/yousei.html";

#region Other Private Methods

private static TimeZoneInfo JstTimeZoneInfo()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Covid19Radar.Services.Logs;
using Covid19Radar.Views.EndOfService;
using Prism.Navigation;
using Xamarin.Essentials;
using Xamarin.Forms;

namespace Covid19Radar.ViewModels.EndOfService
Expand All @@ -27,6 +28,15 @@ ILoggerService loggerService
_loggerService = loggerService;
}

public Command CheckDetailsCommand => new Command(async () =>
{
_loggerService.StartMethod();

await Browser.OpenAsync(AppConstants.EndOfServiceCheckDetailsUrl, BrowserLaunchMode.SystemPreferred);

_loggerService.EndMethod();
});

public Command OnTerminationProcedureButton => new Command(async () =>
{
_loggerService.StartMethod();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
using System;
using Covid19Radar.Common;
using Covid19Radar.Resources;
using Prism.Navigation;
using Xamarin.Essentials;
using Xamarin.Forms;

namespace Covid19Radar.ViewModels.EndOfService
{
Expand All @@ -14,6 +16,11 @@ public class EndOfServicePageViewModel : ViewModelBase
public EndOfServicePageViewModel(INavigationService navigationService) : base(navigationService)
{
}

public Command CheckDetailsCommand => new Command(async () =>
{
await Browser.OpenAsync(AppConstants.EndOfServiceCheckDetailsUrl, BrowserLaunchMode.SystemPreferred);
});
}
}

Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
using System;
using Covid19Radar.Common;
using Covid19Radar.Resources;
using Prism.Navigation;
using Xamarin.Essentials;
using Xamarin.Forms;

namespace Covid19Radar.ViewModels.EndOfService
Expand All @@ -18,8 +19,9 @@ INavigationService navigationService
{
}

public Command OpenWebView => new Command(() =>
public Command CheckDetailsCommand => new Command(async () =>
{
await Browser.OpenAsync(AppConstants.EndOfServiceCheckDetailsUrl, BrowserLaunchMode.SystemPreferred);
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
HorizontalTextAlignment="Center"
Text="{x:Static resources:AppResources.EndOfServiceNoticePageTextLink}">
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding Path=OpenWebView}" />
<TapGestureRecognizer Command="{Binding Path=CheckDetailsCommand}" />
</Label.GestureRecognizers>
</Label>
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
HorizontalTextAlignment="Center"
Text="{x:Static resources:AppResources.EndOfServicePageTextLink}">
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding Path=OpenWebView}" />
<TapGestureRecognizer Command="{Binding Path=CheckDetailsCommand}" />
</Label.GestureRecognizers>
</Label>
</StackLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
HorizontalTextAlignment="Center"
Text="{x:Static resources:AppResources.TerminationOfUseCompletePageTextLink}">
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding Path=OpenWebView}" />
<TapGestureRecognizer Command="{Binding Path=CheckDetailsCommand}" />
</Label.GestureRecognizers>
</Label>
</StackLayout>
Expand Down