mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-26 03:59:34 +08:00
Merge branch 'develop' of https://github.com/SteamTools-Team/SteamTools into develop
This commit is contained in:
Binary file not shown.
File diff suppressed because it is too large
Load Diff
+28
-21
@@ -3,33 +3,40 @@
|
||||
3. CLR 升级至 .NET 6 Preview 6
|
||||
4. 新增 库存游戏可浏览已安装的游戏文件夹
|
||||
5. 改进 社区加速计时逻辑
|
||||
6. 新增 QQ 快速登录渠道
|
||||
7. 新增 ASF Plus 本地挂卡
|
||||
8. 更正 导出令牌窗口标题文本错误
|
||||
9. 改进 添加令牌弹窗可调整窗口大小
|
||||
10. 修复 本地令牌上移下移功能不正确
|
||||
11. 改进 本地令牌自定义修改名称操作
|
||||
12. 修复 我的面板中出现垂直滚动条
|
||||
13. 改进 解锁成就风险提示弹窗新增不再提示复选框
|
||||
14. 修复 任务栏位于顶部时托盘菜单位置不正确
|
||||
15. 新增 创意工坊划词翻译脚本
|
||||
16. 修复 挂时长运行中列表移除游戏时引发的闪退
|
||||
17. 改进 部分语言的翻译文本
|
||||
18. 新增 意大利语支持
|
||||
19. 新增 西班牙语支持
|
||||
20. 移除 CEF 模块,现使用系统浏览器进行快速登录
|
||||
21. 改进 自动更新机制
|
||||
22. 改进 新增守护进程,当程序闪退时将自动重启
|
||||
23. 改进 开机自启动现仅对当前用户生效
|
||||
24. Android/macOS/Linux 版现已开启 Beta/Alpha 测试,可从 GitHub/Gitee 上下载
|
||||
6. 更正 导出令牌窗口标题文本错误
|
||||
7. 改进 添加令牌弹窗可调整窗口大小
|
||||
8. 改进 本地令牌自定义修改名称操作
|
||||
9. 修复 我的面板中出现垂直滚动条
|
||||
10. 改进 解锁成就风险提示弹窗新增不再提示复选框
|
||||
11. 修复 任务栏位于顶部时托盘菜单位置不正确
|
||||
12. 新增 创意工坊划词翻译脚本
|
||||
13. 修复 挂时长运行中列表移除游戏时引发的闪退
|
||||
14. 新增 使用硬件加速设置项,也可通过命令行参数禁用硬件加速启动 -clt devtools -disable_gpu
|
||||
15. 新增 家庭库共享排序
|
||||
16. 改进 自动更新机制
|
||||
17. 改进 开机自启动现仅对当前用户生效
|
||||
18. 改进 程序根目录结构,相较于上一个版本移除了 Bin 文件夹,减少 dll 文件数量
|
||||
19. 改进 优化了发行版本压缩包体积(移除了 CEF 模块,对于需要使用第三方账号快速登录功能可使用上一个版本的压缩包中 \Bin\CEF 将这个文件夹拷贝到 \CEF 中)
|
||||
20. Android/macOS/Linux 版现已开启 Beta/Alpha 测试,可从 GitHub/Gitee 上下载
|
||||
|
||||
***
|
||||
|
||||
1. 新增 QQ 快速登录渠道
|
||||
2. 新增 ASF Plus 本地挂卡
|
||||
3. 修复 本地令牌上移下移功能不正确
|
||||
4. 改进 部分语言的翻译文本
|
||||
5. 新增 意大利语支持
|
||||
6. 新增 西班牙语支持
|
||||
7. 改进 第三方账号快速登录,现使用系统浏览器进行快速登录,不再依赖 CEF 模块
|
||||
8. 改进 新增守护进程,当程序闪退时将自动重启
|
||||
|
||||
| RuntimeIdentifier | Available | Edition |
|
||||
| ---- | ---- | ---- |
|
||||
| win-x64 | ✅ | |
|
||||
| osx-x64 | ✅ | β |
|
||||
| linux-x64 | ✅ | α |
|
||||
| android-arm64 | ✅ | β |
|
||||
| android-arm | ✅ | β |
|
||||
| android-arm64 | ✅ | α |
|
||||
| android-arm | ✅ | α |
|
||||
| win-arm64 | ❌ | |
|
||||
| osx-arm64 | ❌ | |
|
||||
| linux-arm64 | ❌ | |
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
|
||||
namespace System.Application.UI.Adapters
|
||||
@@ -19,7 +20,7 @@ namespace System.Application.UI.Adapters
|
||||
public static IReadOnlyList<TViewModel> AsReadOnly(IList<TViewModel> viewModels)
|
||||
{
|
||||
if (viewModels is IReadOnlyList<TViewModel> viewModels_) return viewModels_;
|
||||
return viewModels.ToArray();
|
||||
return new ReadOnlyCollection<TViewModel>(viewModels);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -51,6 +51,8 @@ namespace System
|
||||
|
||||
public const string TAR_GZ = ".tgz";
|
||||
|
||||
public const string TAR_BR = ".tbr";
|
||||
|
||||
public const string BIN = ".bin";
|
||||
|
||||
public const string APNG = ".apng";
|
||||
|
||||
@@ -186,17 +186,19 @@ namespace System
|
||||
//static readonly Lazy<string> _BaseDirectory = new(() =>
|
||||
//{
|
||||
// var value = AppContext.BaseDirectory;
|
||||
// var value2 = new DirectoryInfo(value);
|
||||
// if (value2.Parent != null && string.Equals(value2.Name, "Bin", StringComparison.OrdinalIgnoreCase))
|
||||
// if (DI.Platform == Platform.Windows)
|
||||
// {
|
||||
// value = value2.Parent.FullName;
|
||||
// var value2 = new DirectoryInfo(value);
|
||||
// if (value2.Parent != null && string.Equals(value2.Name, "Bin", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
// value = value2.Parent.FullName;
|
||||
// }
|
||||
// }
|
||||
// return value;
|
||||
//});
|
||||
|
||||
public static string BaseDirectory =>
|
||||
//_BaseDirectory.Value;
|
||||
AppContext.BaseDirectory;
|
||||
public static string BaseDirectory => AppContext.BaseDirectory;
|
||||
/*_BaseDirectory.Value;*/
|
||||
|
||||
#endregion
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
@@ -12,8 +12,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<Platform>Any CPU</Platform>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<SelfContained>true</SelfContained>
|
||||
<PublishSingleFile>False</PublishSingleFile>
|
||||
<PublishReadyToRun>False</PublishReadyToRun>
|
||||
<PublishTrimmed>False</PublishTrimmed>
|
||||
<PublishSingleFile>false</PublishSingleFile>
|
||||
<PublishReadyToRun>false</PublishReadyToRun>
|
||||
<PublishTrimmed>false</PublishTrimmed>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
@@ -12,7 +12,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<RuntimeIdentifier>linux-arm64</RuntimeIdentifier>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<SelfContained>true</SelfContained>
|
||||
<PublishSingleFile>False</PublishSingleFile>
|
||||
<PublishTrimmed>False</PublishTrimmed>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<PublishTrimmed>false</PublishTrimmed>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -14,5 +14,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<!--<PublishReadyToRun Condition=" '$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true' ">true</PublishReadyToRun>-->
|
||||
<TargetFramework>net6.0-macos</TargetFramework>
|
||||
<SelfContained>true</SelfContained>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<PublishTrimmed>false</PublishTrimmed>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
@@ -12,7 +12,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<RuntimeIdentifier>win10-arm64</RuntimeIdentifier>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<SelfContained>true</SelfContained>
|
||||
<PublishSingleFile>False</PublishSingleFile>
|
||||
<PublishReadyToRun>False</PublishReadyToRun>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<PublishReadyToRun>false</PublishReadyToRun>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
@@ -15,8 +15,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<PublishReadyToRunComposite>false</PublishReadyToRunComposite>
|
||||
<Platform>Any CPU</Platform>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<PublishSingleFile>false</PublishSingleFile>
|
||||
<PublishTrimmed>false</PublishTrimmed>
|
||||
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
|
||||
<EnableCompressionInSingleFile>false</EnableCompressionInSingleFile>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
@@ -14,6 +14,6 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<SelfContained>true</SelfContained>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<PublishReadyToRun>false</PublishReadyToRun>
|
||||
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
|
||||
<EnableCompressionInSingleFile>false</EnableCompressionInSingleFile>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
+3
-3
@@ -9,21 +9,21 @@
|
||||
x:Class="System.Application.UI.Views.Pages.SettingsPage">
|
||||
<TabControl Classes="flat" Padding="{StaticResource PageMargin2}">
|
||||
<TabItem Header="{ReflectionBinding Path=Res.Settings_UI,Mode=OneWay,Source={x:Static resx:R.Current}}">
|
||||
<pages:Settings_UI x:DataType="vm:SettingsPageViewModel">
|
||||
<pages:Settings_UI x:DataType="vm:SettingsPageViewModel" x:CompileBindings="True">
|
||||
<pages:Settings_UI.DataContext>
|
||||
<vm:SettingsPageViewModel/>
|
||||
</pages:Settings_UI.DataContext>
|
||||
</pages:Settings_UI>
|
||||
</TabItem>
|
||||
<TabItem Header="{ReflectionBinding Path=Res.Settings_General,Mode=OneWay,Source={x:Static resx:R.Current}}">
|
||||
<pages:Settings_General x:DataType="vm:SettingsPageViewModel">
|
||||
<pages:Settings_General x:DataType="vm:SettingsPageViewModel" x:CompileBindings="True">
|
||||
<pages:Settings_General.DataContext>
|
||||
<vm:SettingsPageViewModel/>
|
||||
</pages:Settings_General.DataContext>
|
||||
</pages:Settings_General>
|
||||
</TabItem>
|
||||
<TabItem Header="{ReflectionBinding Path=Res.Settings_Steam,Mode=OneWay,Source={x:Static resx:R.Current}}">
|
||||
<pages:Settings_Steam x:DataType="vm:SettingsPageViewModel">
|
||||
<pages:Settings_Steam x:DataType="vm:SettingsPageViewModel" x:CompileBindings="True">
|
||||
<pages:Settings_Steam.DataContext>
|
||||
<vm:SettingsPageViewModel/>
|
||||
</pages:Settings_Steam.DataContext>
|
||||
|
||||
+12
-1
@@ -51,11 +51,22 @@
|
||||
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.IsStartupAppMinimized},Path=Value, Mode=TwoWay}"/>
|
||||
</DockPanel>
|
||||
|
||||
<Separator Classes="Separator"/>
|
||||
|
||||
<DockPanel>
|
||||
<TextBlock Text="{ReflectionBinding Path=Res.Settings_General_AutoCheckUpdate,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
|
||||
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.IsAutoCheckUpdate},Path=Value, Mode=TwoWay}"/>
|
||||
</DockPanel>
|
||||
|
||||
<StackPanel Orientation="Vertical" Spacing="10">
|
||||
<TextBlock Text="{ReflectionBinding Path=Res.Settings_General_UpdateChannel,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
|
||||
<ComboBox x:Name="Themes"
|
||||
Items="{Binding UpdateChannels}"
|
||||
SelectedItem="{Binding Source={x:Static ms:GeneralSettings.UpdateChannel},Path=Value, Mode=TwoWay}"
|
||||
HorizontalAlignment="Stretch">
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<Separator Classes="Separator"/>
|
||||
|
||||
<DockPanel>
|
||||
@@ -64,7 +75,7 @@
|
||||
<TextBlock Classes="prompt"
|
||||
Text="{ReflectionBinding Path=Res.Settings_RestartEffective,Mode=OneWay,Source={x:Static resx:R.Current}}"></TextBlock>
|
||||
</WrapPanel>
|
||||
|
||||
|
||||
<ToggleSwitch IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.UseGPURendering},Path=Value, Mode=TwoWay}"/>
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
|
||||
@@ -65,7 +65,9 @@
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<Separator Classes="Separator"/>
|
||||
|
||||
<StackPanel Orientation="Vertical" Spacing="8">
|
||||
<TextBlock Text="{ReflectionBinding Path=Res.Settings_UI_AcrylicTransparency,Mode=OneWay,Source={x:Static resx:R.Current}}"/>
|
||||
<Slider Value="{ReflectionBinding Value,Source={x:Static ms:UISettings.AcrylicOpacity},Mode=TwoWay}" Minimum="0" Maximum="1.0"></Slider>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.999-cibuild0015162-beta" />
|
||||
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.6.10" />
|
||||
<PackageReference Include="CefNet.Avalonia" Version="90.6.21124.1851" />
|
||||
<PackageReference Include="LibVLCSharp.Avalonia" Version="3.5.1" />
|
||||
<!--<PackageReference Include="LibVLCSharp.Avalonia" Version="3.5.1" />-->
|
||||
<!--<PackageReference Include="FluentAvaloniaUI" Version="1.1.0" />-->
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
+1
-1
@@ -3097,7 +3097,7 @@ namespace System.Application.UI.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 启动时自动检查更新 的本地化字符串。
|
||||
/// 查找类似 自动检查更新 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string Settings_General_AutoCheckUpdate {
|
||||
get {
|
||||
|
||||
@@ -1076,7 +1076,7 @@
|
||||
<value>通用设置</value>
|
||||
</data>
|
||||
<data name="Settings_General_AutoCheckUpdate" xml:space="preserve">
|
||||
<value>启动时自动检查更新</value>
|
||||
<value>自动检查更新</value>
|
||||
</data>
|
||||
<data name="Settings_General_RuningMinimize" xml:space="preserve">
|
||||
<value>启动时最小化到托盘</value>
|
||||
|
||||
@@ -39,8 +39,8 @@ namespace System.Application.UI.Resx
|
||||
{ "ko", "Koreana" },
|
||||
{ "ja", "Japanese" },
|
||||
{ "ru", "Russian" },
|
||||
{ "es", "Spanish" },
|
||||
{ "it", "Italian" },
|
||||
//{ "es", "Spanish" },
|
||||
//{ "it", "Italian" },
|
||||
}.ToList();
|
||||
SteamLanguages = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
|
||||
@@ -41,6 +41,13 @@ namespace System.Application.UI.ViewModels
|
||||
get => _SelectFont;
|
||||
set => this.RaiseAndSetIfChanged(ref _SelectFont, value);
|
||||
}
|
||||
|
||||
IReadOnlyCollection<UpdateChannelType>? _UpdateChannels;
|
||||
public IReadOnlyCollection<UpdateChannelType>? UpdateChannels
|
||||
{
|
||||
get => _UpdateChannels;
|
||||
set => this.RaiseAndSetIfChanged(ref _UpdateChannels, value);
|
||||
}
|
||||
#endif
|
||||
|
||||
public SettingsPageViewModel()
|
||||
@@ -57,6 +64,9 @@ namespace System.Application.UI.ViewModels
|
||||
SelectFont = R.Fonts.FirstOrDefault(x => x.Value == UISettings.FontName.Value);
|
||||
this.WhenValueChanged(x => x.SelectFont, false)
|
||||
.Subscribe(x => UISettings.FontName.Value = x.Value);
|
||||
|
||||
|
||||
UpdateChannels = Enum.GetValues<UpdateChannelType>();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -68,5 +78,8 @@ namespace System.Application.UI.ViewModels
|
||||
AppResources.Settings_UI_Dark,
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -185,9 +185,11 @@ namespace System.Application.UI.ViewModels
|
||||
private CancellationTokenSource? CancelCancelAll;
|
||||
|
||||
private readonly ReadOnlyObservableCollection<WinAuthSteamClient.Confirmation>? _Confirmations;
|
||||
private readonly SourceList<WinAuthSteamClient.Confirmation> _ConfirmationsSourceList;
|
||||
public ReadOnlyObservableCollection<WinAuthSteamClient.Confirmation> Confirmations => _Confirmations ?? throw new ArgumentNullException(nameof(_Confirmations));
|
||||
|
||||
private readonly SourceList<WinAuthSteamClient.Confirmation> _ConfirmationsSourceList;
|
||||
public SourceList<WinAuthSteamClient.Confirmation> ConfirmationsSourceList => _ConfirmationsSourceList;
|
||||
|
||||
private bool _IsLoading;
|
||||
public bool IsLoading
|
||||
{
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
using Android.Content;
|
||||
using Android.Runtime;
|
||||
using Android.Util;
|
||||
using System;
|
||||
|
||||
namespace AndroidX.RecyclerView.Widget
|
||||
{
|
||||
public class LinearLayoutManager2 : LinearLayoutManager
|
||||
{
|
||||
public LinearLayoutManager2(Context context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
public LinearLayoutManager2(Context context, int orientation, bool reverseLayout) : base(context, orientation, reverseLayout)
|
||||
{
|
||||
}
|
||||
|
||||
public LinearLayoutManager2(Context context, IAttributeSet attrs, int defStyleAttr, int defStyleRes) : base(context, attrs, defStyleAttr, defStyleRes)
|
||||
{
|
||||
}
|
||||
|
||||
protected LinearLayoutManager2(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state)
|
||||
{
|
||||
try
|
||||
{
|
||||
base.OnLayoutChildren(recycler, state);
|
||||
}
|
||||
catch (Java.Lang.IndexOutOfBoundsException)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
// Copyright (c) 2021 .NET Foundation and Contributors. All rights reserved.
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for full license information.
|
||||
|
||||
using AndroidX.RecyclerView.Widget;
|
||||
using DynamicData;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
|
||||
// https://github.com/reactiveui/ReactiveUI/blob/main/src/ReactiveUI.AndroidX/ReactiveRecyclerViewAdapter.cs
|
||||
|
||||
namespace ReactiveUI.AndroidX
|
||||
{
|
||||
/// <summary>
|
||||
/// An adapter for the Android <see cref="RecyclerView"/>.
|
||||
/// </summary>
|
||||
/// <typeparam name="TViewModel">The type of ViewModel that this adapter holds.</typeparam>
|
||||
public abstract class ReactiveRecyclerViewAdapter2<TViewModel> : RecyclerView.Adapter
|
||||
where TViewModel : class, IReactiveObject
|
||||
{
|
||||
private readonly ISourceList<TViewModel> _list;
|
||||
|
||||
private readonly IDisposable? _inner;
|
||||
|
||||
protected ReactiveRecyclerViewAdapter2(ISourceList<TViewModel> list, IDisposable? inner = null)
|
||||
{
|
||||
_list = list;
|
||||
_inner = inner;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ReactiveRecyclerViewAdapter2{TViewModel}"/> class.
|
||||
/// </summary>
|
||||
/// <param name="backingList">The backing list.</param>
|
||||
protected ReactiveRecyclerViewAdapter2(IObservable<IChangeSet<TViewModel>> backingList)
|
||||
{
|
||||
_list = new SourceList<TViewModel>(backingList);
|
||||
|
||||
_inner = _list
|
||||
.Connect()
|
||||
.ObserveOn(RxApp.MainThreadScheduler)
|
||||
.ForEachChange(UpdateBindings)
|
||||
.Subscribe();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int ItemCount => _list.Count;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetItemViewType(int position) => GetItemViewType(position, GetViewModelByPosition(position));
|
||||
|
||||
/// <summary>
|
||||
/// Determine the View that will be used/re-used in lists where
|
||||
/// the list contains different cell designs.
|
||||
/// </summary>
|
||||
/// <param name="position">The position of the current view in the list.</param>
|
||||
/// <param name="viewModel">The ViewModel associated with the current View.</param>
|
||||
/// <returns>An ID to be used in OnCreateViewHolder.</returns>
|
||||
public virtual int GetItemViewType(int position, TViewModel? viewModel) => base.GetItemViewType(position);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
|
||||
{
|
||||
if (holder is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(holder));
|
||||
}
|
||||
|
||||
if (!(holder is IViewFor viewForHolder))
|
||||
{
|
||||
throw new ArgumentException("Holder must be derived from IViewFor", nameof(holder));
|
||||
}
|
||||
|
||||
viewForHolder.ViewModel = GetViewModelByPosition(position);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
_inner?.Dispose();
|
||||
_list.Dispose();
|
||||
}
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
private TViewModel? GetViewModelByPosition(int position) => position >= _list.Count ? null : _list.Items.ElementAt(position);
|
||||
|
||||
private void UpdateBindings(Change<TViewModel> change)
|
||||
{
|
||||
switch (change.Reason)
|
||||
{
|
||||
case ListChangeReason.Add:
|
||||
NotifyItemInserted(change.Item.CurrentIndex);
|
||||
break;
|
||||
case ListChangeReason.Remove:
|
||||
NotifyItemRemoved(change.Item.CurrentIndex);
|
||||
break;
|
||||
case ListChangeReason.Moved:
|
||||
NotifyItemMoved(change.Item.PreviousIndex, change.Item.CurrentIndex);
|
||||
break;
|
||||
case ListChangeReason.Replace:
|
||||
case ListChangeReason.Refresh:
|
||||
NotifyItemChanged(change.Item.CurrentIndex);
|
||||
break;
|
||||
case ListChangeReason.AddRange:
|
||||
NotifyItemRangeInserted(change.Range.Index, change.Range.Count);
|
||||
break;
|
||||
case ListChangeReason.RemoveRange:
|
||||
case ListChangeReason.Clear:
|
||||
NotifyItemRangeRemoved(change.Range.Index, change.Range.Count);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ namespace System.Application.UI.Activities
|
||||
break;
|
||||
}
|
||||
};
|
||||
var layout = new LinearLayoutManager(this, LinearLayoutManager.Vertical, false);
|
||||
var layout = new LinearLayoutManager2(this, LinearLayoutManager.Vertical, false);
|
||||
binding.rvPreferenceButtons.SetLayoutManager(layout);
|
||||
binding.rvPreferenceButtons.AddItemDecoration(new PreferenceButtonItemDecoration(this, Resource.Dimension.preference_buttons_space_min));
|
||||
binding.rvPreferenceButtons.SetAdapter(adapter);
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace System.Application.UI.Activities
|
||||
|
||||
var adapter = new ExplorerAdapter(ViewModel!);
|
||||
adapter.ItemClick += (_, e) => ViewModel!.OnItemClick(e.Current);
|
||||
var layout = new LinearLayoutManager(this, LinearLayoutManager.Vertical, false);
|
||||
var layout = new LinearLayoutManager2(this, LinearLayoutManager.Vertical, false);
|
||||
binding.rvExplorer.SetLayoutManager(layout);
|
||||
binding.rvExplorer.SetAdapter(adapter);
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace System.Application.UI.Activities
|
||||
};
|
||||
|
||||
var adapter = new SteamAuthTradeConfirmationAdapter(ViewModel!);
|
||||
var layout = new LinearLayoutManager(this, LinearLayoutManager.Vertical, false);
|
||||
var layout = new LinearLayoutManager2(this, LinearLayoutManager.Vertical, false);
|
||||
binding!.rvConfirmations.SetLayoutManager(layout);
|
||||
binding.rvConfirmations.AddItemDecoration(VerticalItemDecoration2.Get(this, Resource.Dimension.activity_vertical_margin, Resource.Dimension.fab_full_height, noTop: true));
|
||||
binding.rvConfirmations.SetAdapter(adapter);
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace System.Application.UI.Adapters
|
||||
{
|
||||
//public AuthTradeWindowViewModel ViewModel { get; }
|
||||
|
||||
public SteamAuthTradeConfirmationAdapter(AuthTradeWindowViewModel viewModel) : base(viewModel.Confirmations)
|
||||
public SteamAuthTradeConfirmationAdapter(AuthTradeWindowViewModel viewModel) : base(viewModel.Confirmations, viewModel.ConfirmationsSourceList)
|
||||
{
|
||||
//ViewModel = viewModel;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace System.Application.UI.Adapters
|
||||
/// <typeparam name="TViewHolder"></typeparam>
|
||||
/// <typeparam name="TViewModel"></typeparam>
|
||||
/// <typeparam name="TViewType"></typeparam>
|
||||
public abstract partial class BaseReactiveRecycleViewAdapter<TViewHolder, TViewModel, TViewType> : ReactiveRecyclerViewAdapter<TViewModel>, IReadOnlyViewModels<TViewModel>
|
||||
public abstract partial class BaseReactiveRecycleViewAdapter<TViewHolder, TViewModel, TViewType> : ReactiveRecyclerViewAdapter2<TViewModel>, IReadOnlyViewModels<TViewModel>
|
||||
where TViewHolder : BaseReactiveViewHolder<TViewModel>
|
||||
where TViewModel : class, IReactiveObject
|
||||
where TViewType : struct, IConvertible
|
||||
@@ -109,6 +109,11 @@ namespace System.Application.UI.Adapters
|
||||
{
|
||||
viewModels = collection;
|
||||
}
|
||||
|
||||
public BaseReactiveRecycleViewAdapter(IList<TViewModel> viewModels, ISourceList<TViewModel> sourceList) : base(sourceList)
|
||||
{
|
||||
this.viewModels = viewModels;
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="BaseReactiveRecycleViewAdapter{TViewHolder, TViewModel, TViewType}"/>
|
||||
@@ -123,5 +128,10 @@ namespace System.Application.UI.Adapters
|
||||
public BaseReactiveRecycleViewAdapter(ReadOnlyObservableCollection<TViewModel> collection) : base(collection)
|
||||
{
|
||||
}
|
||||
|
||||
public BaseReactiveRecycleViewAdapter(IList<TViewModel> viewModels, ISourceList<TViewModel> sourceList) : base(viewModels, sourceList)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@ namespace System.Application.UI.Fragments
|
||||
break;
|
||||
}
|
||||
};
|
||||
var layout = new LinearLayoutManager(Context, LinearLayoutManager.Vertical, false);
|
||||
var layout = new LinearLayoutManager2(Context, LinearLayoutManager.Vertical, false);
|
||||
binding.rvFastLoginChannels.SetLayoutManager(layout);
|
||||
binding.rvFastLoginChannels.AddItemDecoration(new VerticalItemDecoration(Context.Resources!.GetDimensionPixelSize(Resource.Dimension.fast_login_or_register_margin_subtract_compat_padding)));
|
||||
binding.rvFastLoginChannels.SetAdapter(adapter);
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace System.Application.UI.Fragments
|
||||
{
|
||||
AuthDetailActivity.StartActivity(Activity, e.Current.Id);
|
||||
};
|
||||
var layout = new LinearLayoutManager(Context, LinearLayoutManager.Vertical, false);
|
||||
var layout = new LinearLayoutManager2(Context, LinearLayoutManager.Vertical, false);
|
||||
binding!.rvAuthenticators.SetLayoutManager(layout);
|
||||
binding.rvAuthenticators.AddItemDecoration(VerticalItemDecoration2.Get(Context, Resource.Dimension.activity_vertical_margin/*, Resource.Dimension.fab_full_height*/));
|
||||
binding.rvAuthenticators.SetAdapter(adapter);
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace System.Application.UI.Fragments
|
||||
};
|
||||
if (activityType != null) this.StartActivity(activityType);
|
||||
};
|
||||
var layout = new LinearLayoutManager(Context, LinearLayoutManager.Vertical, false);
|
||||
var layout = new LinearLayoutManager2(Context, LinearLayoutManager.Vertical, false);
|
||||
binding.rvPreferenceButtons.SetLayoutManager(layout);
|
||||
binding.rvPreferenceButtons.AddItemDecoration(new VerticalGroupItemDecoration(binding.rvPreferenceButtons.PaddingTop));
|
||||
binding.rvPreferenceButtons.SetAdapter(adapter);
|
||||
|
||||
@@ -41,10 +41,7 @@ namespace System.Application.UI.ViewModels
|
||||
}
|
||||
}
|
||||
Title = title;
|
||||
foreach (var item in PathInfos.ToArray())
|
||||
{
|
||||
PathInfos.Remove(item);
|
||||
}
|
||||
PathInfos.Clear();
|
||||
if (string.IsNullOrEmpty(_CurrentPath))
|
||||
{
|
||||
PathInfos.AddRange(GetRootPathInfoViewModels<List<PathInfoViewModel>>());
|
||||
|
||||
Reference in New Issue
Block a user