Skip to content

Commit

Permalink
Merge branch 'release/v1.2.22'
Browse files Browse the repository at this point in the history
  • Loading branch information
tor4kichi committed Dec 15, 2021
2 parents 93f4e21 + daf4cea commit 322b7f6
Show file tree
Hide file tree
Showing 9 changed files with 101 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public Task<FollowUsersResponse> GetItemsAsync(int pageSize, FollowUsersResponse
return _niconicoSession.ToolkitContext.Follow.User.GetFollowUsersAsync(pageSize, lastRes);
}

Task<bool> IFollowProvider<IUser>.IsFollowingAsync(IUser followable) => IsFollowingAsync(followable.UserId);
Task<bool> IFollowProvider<IUser>.IsFollowingAsync(IUser followable) => followable is null ? Task.FromResult(false) : IsFollowingAsync(followable.UserId);

public async Task<ContentManageResult> AddFollowAsync(IUser user)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ await _dispatcherQueue.EnqueueAsync(async () =>
_smtc.DisplayUpdater.ClearAll();
_smtc.DisplayUpdater.Type = MediaPlaybackType.Video;
_smtc.DisplayUpdater.VideoProperties.Title = CurrentPlayingSession.VideoDetails.Title;
_smtc.DisplayUpdater.VideoProperties.Subtitle = CurrentPlayingSession.VideoDetails.ProviderName;
_smtc.DisplayUpdater.VideoProperties.Subtitle = CurrentPlayingSession.VideoDetails.ProviderName ?? String.Empty; // 投稿者退会済みの場合nullになるのでカバー
_smtc.DisplayUpdater.Thumbnail = RandomAccessStreamReference.CreateFromUri(new Uri(CurrentPlayingSession.VideoDetails.ThumbnailUrl));
_smtc.DisplayUpdater.Update();
});
Expand Down
2 changes: 1 addition & 1 deletion Hohoema/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" IgnorableNamespaces="uap mp uap3">
<Identity Name="18803tor4kichi.Hohoema" Publisher="CN=DFF1CEA0-5963-4197-8676-6105C5E8CE4B" Version="1.2.21.0" />
<Identity Name="18803tor4kichi.Hohoema" Publisher="CN=DFF1CEA0-5963-4197-8676-6105C5E8CE4B" Version="1.2.22.0" />
<mp:PhoneIdentity PhoneProductId="01cfd879-0a19-44a7-b5db-11bdbd13f0df" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>Hohoema</DisplayName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,11 @@
<uwpControls:WrapPanel Orientation="Horizontal" HorizontalSpacing="8">

<!-- 投稿者 -->
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal" Visibility="{x:Bind _vm.IsVideoProviderDeleted, Converter={StaticResource BooleanToVisibilityInverted}}">
<Button Padding="0 0 8 0" BorderThickness="0">
<StackPanel Orientation="Horizontal">
<Image Source="{x:Bind _vm.VideoDetails.OwnerIconUrl, Mode=OneWay}" Height="48" Width="48" />
<!-- 投稿者削除に対応するためBindingを利用 -->
<Image Source="{Binding VideoDetails.OwnerIconUrl, Mode=OneWay}" Height="48" Width="48" />
<TextBlock Text="{x:Bind _vm.VideoDetails.ProviderName, Mode=OneWay}" VerticalAlignment="Center" Margin="8 0 0 0" />
</StackPanel>

Expand Down Expand Up @@ -182,6 +183,13 @@
</ToggleButton>

</StackPanel>

<!-- 投稿者退会済み -->
<Button Visibility="{x:Bind _vm.IsVideoProviderDeleted, Converter={StaticResource BooleanToVisibility}}" IsEnabled="False">
<!-- TODO: 投稿者退会済みの場合の表示 -->

<TextBlock Text="動画投稿者 退会済み" VerticalAlignment="Bottom" MaxLines="2" MaxWidth="80" TextWrapping="WrapWholeWords" />
</Button>

<!-- 動画データ -->
<TextBlock>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,13 @@ public INicoVideoDetails VideoDetails
set { SetProperty(ref _VideoDetails, value); }
}


private bool _isVideoProviderDeleted;
public bool IsVideoProviderDeleted
{
get => _isVideoProviderDeleted;
private set => SetProperty(ref _isVideoProviderDeleted, value);
}
CancellationTokenSource _navigationCts;
CancellationToken _navigationCancellationToken;
public async Task OnNavigatedToAsync(INavigationParameters parameters)
Expand Down Expand Up @@ -468,6 +475,8 @@ public async Task OnNavigatedToAsync(INavigationParameters parameters)

await UpdateVideoDescription();

IsVideoProviderDeleted = string.IsNullOrEmpty(VideoInfo.ProviderName);

if (NiconicoSession.IsLoggedIn)
{
var owner = await NicoVideoProvider.ResolveVideoOwnerAsync(videoId.Value);
Expand Down
86 changes: 52 additions & 34 deletions Hohoema/Presentation.Views.Pages/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@
</Style>
<Style x:Key="SettingsMiddleGroupStackPanelStyle"
TargetType="StackPanel">
<Setter Property="Spacing"
Value="32" />
<Setter Property="Margin"
Value="16 0 0 0" />
<Setter Property="Spacing" Value="24" />
<Setter Property="Margin" Value="16 0 8 0" />
<Setter Property="MinWidth" Value="320" />
<Setter Property="MaxWidth" Value="320" />
</Style>

<Style x:Key="SettingsOptionTitleTextBlock"
Expand All @@ -111,37 +111,38 @@
</Style>

<Style x:Key="SettingsTitleContainerStyle" TargetType="toolkit:DockPanel">
<Setter Property="Margin" Value="0 32" />
<Setter Property="Margin" Value="8 32 8 16" />
<Setter Property="MinWidth" Value="320" />
</Style>

<locales:LocaleToDisplayNameConverter x:Key="LocaleToDisplayNameConverter" />
</Page.Resources>
<Grid>
<uwptoolkitControl:DockPanel>
<StackPanel x:Name="HeaderPanel" uwptoolkitControl:DockPanel.Dock="Top" HorizontalAlignment="Stretch">
<CommandBar x:Name="VideoListCommandBar" DefaultLabelPosition="Right" VerticalContentAlignment="Center">
<CommandBar.Content>
<controls:AppTitleBar Title="{Binding Title}" />
</CommandBar.Content>
<CommandBar.PrimaryCommands>
<AppBarButton Background="Transparent">
<AppBarButton.Flyout>

<uwpcontrols:DockPanel Margin="8 0" >

<StackPanel Orientation="Horizontal" uwpcontrols:DockPanel.Dock="Right">
<TextBlock Opacity="0.7" Style="{StaticResource BodyTextBlockStyle}" VerticalAlignment="Center"
TextAlignment="Right"
Text="{Binding VersionText}"
IsTextSelectionEnabled="True"
>
<TextBlock.ContextFlyout>
<MenuFlyout>
<MenuFlyoutItem Text="{i18nExt:Localize Key=CopyAppVersionToClipboard}" Command="{Binding CopyVersionTextToClipboardCommand}" />
<ToggleMenuFlyoutItem Text="{i18nExt:Localize Key=EnableDebugModeToggleSwitchTitle}" IsChecked="{Binding IsDebugModeEnabled.Value,Mode=TwoWay}" />
</MenuFlyout>
</AppBarButton.Flyout>
<StackPanel Orientation="Horizontal">
<TextBlock Opacity="0.5" Style="{StaticResource SubtitleTextBlockStyle}" VerticalAlignment="Center">
v<Run Text="{Binding VersionText}" /></TextBlock>
</StackPanel>
</AppBarButton>
</CommandBar.PrimaryCommands>
</CommandBar>
</TextBlock.ContextFlyout>
</TextBlock>
</StackPanel>
<controls:AppTitleBar Title="{Binding Title}" />
</uwpcontrols:DockPanel>
</StackPanel>

<ScrollViewer>
<StackPanel x:Name="ContentPanel" Spacing="16" Padding="0 0 0 32" MinWidth="400" MaxWidth="640" HorizontalAlignment="Left">
<uwpcontrols:WrapPanel x:Name="ContentPanel" Padding="0 0 0 32" MinWidth="400" MaxWidth="960" HorizontalSpacing="8" VerticalSpacing="16">
<!-- アプリの表示設定 -->
<StackPanel>
<toolkit:DockPanel Style="{StaticResource SettingsTitleContainerStyle}">
Expand Down Expand Up @@ -226,7 +227,7 @@
<StackPanel Margin="0 8">
<uwpcontrols:Expander Header="{i18nExt:Localize Key=ShowFilteredVideoOwnerNames}" HorizontalContentAlignment="Left" >
<ListView ItemsSource="{Binding NGVideoOwnerUserIds}"
Margin="16 8"
Margin="0 0"
IsTabStop="False"
HorizontalContentAlignment="Stretch"
IsItemClickEnabled="True"
Expand All @@ -237,16 +238,28 @@
InputConverter="{StaticResource ItemClickEventArgsConverter}" />
</core:EventTriggerBehavior>
</i:Interaction.Behaviors>

<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Padding" Value="2" />
<Setter Property="Margin" Value="0" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="{ThemeResource ButtonDisabledBorderThemeBrush}" />
<Setter Property="CornerRadius" Value="8" />
</Style>
</ListView.ItemContainerStyle>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Background="Transparent" IsHitTestVisible="True" BorderBrush="{ThemeResource ButtonBorderThemeBrush}" BorderThickness="1" Padding="16 8">
<TextBlock Text="{Binding Description}" VerticalAlignment="Center" />
<Border Background="Transparent" IsHitTestVisible="True" Padding="4 0"
Width="140"
>
<TextBlock Text="{Binding Description}" VerticalAlignment="Center" TextWrapping="Wrap" />
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsWrapGrid Orientation="Horizontal" />
<uwpcontrols:UniformGrid ColumnSpacing="4" RowSpacing="4" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
</ListView>
Expand Down Expand Up @@ -327,7 +340,7 @@
</StackPanel>
</Grid>

<StackPanel Orientation="Horizontal" Spacing="32" HorizontalAlignment="Right">
<StackPanel Orientation="Horizontal" Spacing="16" HorizontalAlignment="Right">

<Button Content="{i18nExt:Localize Key=OpenCacheFolder}" Command="{Binding OpenCurrentCacheFolderCommand}" HorizontalAlignment="Right" />
<Button Content="{i18nExt:Localize Key=ChangeCacheFolder}" Command="{Binding ChangeCacheVideoFolderCommand}" HorizontalAlignment="Right" />
Expand Down Expand Up @@ -371,15 +384,15 @@
<TextBlock Text="{i18nExt:Localize Key=AboutThisApp}" Style="{StaticResource SubtitleTextBlockStyle}" VerticalAlignment="Center" toolkit:DockPanel.Dock="Left" />
<Border Style="{StaticResource SettingsSubHeaderHorizonBorderStyle}" />
</toolkit:DockPanel>
<StackPanel Style="{StaticResource SettingsMiddleGroupStackPanelStyle}">
<StackPanel Style="{StaticResource SettingsMiddleGroupStackPanelStyle}" Spacing="8">
<Grid>
<TextBlock Text="{i18nExt:Localize Key=ApplicationVersion}" Opacity="0.7" VerticalAlignment="Center" />
<TextBlock HorizontalAlignment="Right">
v<Run Text="{Binding VersionText}" /></TextBlock>
<TextBlock HorizontalAlignment="Right" TextAlignment="Right" IsTextSelectionEnabled="True">
<Run Text="{Binding VersionText}" /></TextBlock>
</Grid>
<HyperlinkButton Content="{i18nExt:Localize Key=ShowUpdateNote}" Command="{Binding ShowUpdateNoticeCommand}" CommandParameter="{Binding CurrentVersion}" HorizontalAlignment="Right" />
<HyperlinkButton Content="{i18nExt:Localize Key=DevelopProjectPage_LinkTitle}" Margin="0 0 0 8" NavigateUri="https://github.com/tor4kichi/Hohoema" UseSystemFocusVisuals="True" HorizontalAlignment="Right" />
<HyperlinkButton Content="{i18nExt:Localize Key=PrivacyPolicy}" Margin="0 0 0 8" NavigateUri="https://github.com/tor4kichi/Hohoema/wiki/Privacy-policy" UseSystemFocusVisuals="True" HorizontalAlignment="Right" />
<HyperlinkButton Content="{i18nExt:Localize Key=DevelopProjectPage_LinkTitle}" NavigateUri="https://github.com/tor4kichi/Hohoema" UseSystemFocusVisuals="True" HorizontalAlignment="Right" />
<HyperlinkButton Content="{i18nExt:Localize Key=PrivacyPolicy}" NavigateUri="https://github.com/tor4kichi/Hohoema/wiki/Privacy-policy" UseSystemFocusVisuals="True" HorizontalAlignment="Right" />
</StackPanel>
</StackPanel>
<StackPanel>
Expand All @@ -397,7 +410,7 @@
<TextBlock Text="{i18nExt:Localize Key=ThirdPartyLibraryDependencies}" Style="{StaticResource SubtitleTextBlockStyle}" VerticalAlignment="Center" toolkit:DockPanel.Dock="Left" />
<Border Style="{StaticResource SettingsSubHeaderHorizonBorderStyle}" />
</toolkit:DockPanel>
<ItemsControl ItemsSource="{Binding LisenceItems}" Margin="0 8 8 8" IsTabStop="False">
<ItemsControl ItemsSource="{Binding LisenceItems}" Margin="0 0 8 0" IsTabStop="False">
<ItemsControl.ItemTemplate>
<DataTemplate>
<HyperlinkButton Margin="0 0" NavigateUri="{Binding Site}" Content="{Binding Name}" HorizontalAlignment="Right" />
Expand Down Expand Up @@ -508,6 +521,11 @@
InputConverter="{StaticResource ItemClickEventArgsConverter}" />
</core:EventTriggerBehavior>
</i:Interaction.Behaviors>
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Margin" Value="0 0 0 4" />
</Style>
</ListView.ItemContainerStyle>
<ListView.ItemTemplate>
<DataTemplate>
<Grid>
Expand All @@ -529,7 +547,7 @@
</StackPanel>

<!-- 実験的機能 -->
<uwptoolkitControl:Expander>
<uwptoolkitControl:Expander Visibility="Collapsed">

<uwptoolkitControl:Expander.Header>
<TextBlock Text="実験的機能" Style="{StaticResource SubtitleTextBlockStyle}" VerticalAlignment="Center" toolkit:DockPanel.Dock="Left" />
Expand All @@ -546,7 +564,7 @@
</StackPanel>
</uwptoolkitControl:Expander>

</StackPanel>
</uwpcontrols:WrapPanel>
</ScrollViewer>
</uwptoolkitControl:DockPanel>
<VisualStateManager.VisualStateGroups>
Expand Down
29 changes: 14 additions & 15 deletions Hohoema/Presentation.Views.Pages/SettingsPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
using Hohoema.Models.Domain.VideoCache;
using Hohoema.Models.UseCase.VideoCache;
using Hohoema.Models.UseCase.Niconico.Player.Comment;
using System.Text;
using Microsoft.Toolkit.Uwp.Helpers;
using Xamarin.Essentials;

namespace Hohoema.Presentation.ViewModels.Pages.Hohoema
{
Expand Down Expand Up @@ -206,7 +209,7 @@ BackupManager backupManager
var folder = _videoCacheFolderManager.VideoCacheFolder;
if (folder != null)
{
await Launcher.LaunchFolderAsync(folder);
await Windows.System.Launcher.LaunchFolderAsync(folder);
}
});

Expand All @@ -229,19 +232,15 @@ BackupManager backupManager
.AddTo(_CompositeDisposable);



// アバウト
var version = Windows.ApplicationModel.Package.Current.Id.Version;
#if DEBUG
VersionText = $"{version.Major}.{version.Minor}.{version.Build} DEBUG";
#else
VersionText = $"{version.Major}.{version.Minor}.{version.Build}";
#endif


var dispatcher = Window.Current.CoreWindow.Dispatcher;


StringBuilder sb = new StringBuilder();
sb.Append(SystemInformation.Instance.ApplicationName)
.Append(" v").Append(SystemInformation.Instance.ApplicationVersion.ToFormattedString())
.AppendLine();
sb.Append(SystemInformation.Instance.OperatingSystem).Append(" ").Append(SystemInformation.Instance.OperatingSystemArchitecture)
.Append("(").Append(SystemInformation.Instance.OperatingSystemVersion).Append(")")
.Append(" ").Append(DeviceInfo.Idiom)
;
VersionText = sb.ToString();

IsDebugModeEnabled = new ReactiveProperty<bool>((App.Current as App).IsDebugModeEnabled, mode: ReactivePropertyMode.DistinctUntilChanged)
.AddTo(_CompositeDisposable);
Expand Down Expand Up @@ -509,7 +508,7 @@ public DelegateCommand ShowIssuesWithBrowserCommand
return _ShowIssuesWithBrowserCommand
?? (_ShowIssuesWithBrowserCommand = new DelegateCommand(async () =>
{
await Launcher.LaunchUriAsync(AppIssuePageUri);
await Windows.System.Launcher.LaunchUriAsync(AppIssuePageUri);
}));
}
}
Expand Down
6 changes: 4 additions & 2 deletions Hohoema/Presentation.Views.Player/VideoPlayerPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
<!-- 左右スワイプでシーク -->
<mybehavior:Swipe x:Name="SeekSwipe" SwipeCommand="{x:Bind _vm.SeekCommand}" SwipeAmountConverter="{StaticResource SwipeSeekValueToTimeSpan}" SwipeAmountScale="0.15" SwipeEdgeOfPlay="48" />
<!-- マウスの非表示 -->
<mybehavior:PointerCursolAutoHideBehavior x:Name="AutoHideCursor" IsAutoHideEnabled="False" AutoHideDelay="0:0:1" />
<mybehavior:PointerCursolAutoHideBehavior x:Name="AutoHideCursor" IsAutoHideEnabled="False" AutoHideDelay="0:0:1.25" />
<core:EventTriggerBehavior EventName="Loaded">
<mybehavior:SetFocus TargetObject="{Binding ElementName=RootLayout}" />
</core:EventTriggerBehavior>
Expand Down Expand Up @@ -958,14 +958,16 @@
<VisualState>
<VisualState.StateTriggers>
<StateTrigger IsActive="{x:Bind IsDisplayControlUI, Mode=OneWay}" />
<StateTrigger IsActive="{Binding PlayerView.IsCompactOverlay, Mode=OneWay}" />
<myTrigger:WindowInWindowViewModeTrigger myExt:DependencyObjectExtensions.DisposeOnUnloadedTarget="{x:Bind RootLayout}"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="AutoHideCursor.IsAutoHideEnabled" Value="False" />
</VisualState.Setters>
</VisualState>
<VisualState>
<VisualState.StateTriggers>
<StateTrigger IsActive="{Binding PlayerView.IsFullScreen, Mode=OneWay}" />
<StateTrigger IsActive="True" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="AutoHideCursor.IsAutoHideEnabled" Value="True" />
Expand Down
Loading

0 comments on commit 322b7f6

Please sign in to comment.