* Pixiview/UI/CardView.cs:
* Pixiview/UI/StyleDefinition.cs: * Pixiview/Resources/ResourceHelper.cs: * Pixiview/Resources/Languages/zh-CN.xml: * Pixiview/Illust/IllustCollectionPage.cs: * Pixiview.Android/Pixiview.Android.csproj: * Pixiview.Android/Renderers/AdaptedPageRenderer.cs: UI adjust * Pixiview/Illust/FavoritesPage.xaml: * Pixiview/Illust/FavoritesPage.xaml.cs: fix: no title in favorite page * Pixiview/Utils/Stores.cs: * Pixiview/Illust/RankingPage.xaml.cs: feature: remember last query parameters
This commit is contained in:
parent
74e5d8c281
commit
a2b91a2406
@ -79,6 +79,7 @@
|
|||||||
<Compile Include="Renderers\SearchBarRenderer.cs" />
|
<Compile Include="Renderers\SearchBarRenderer.cs" />
|
||||||
<Compile Include="SplashActivity.cs" />
|
<Compile Include="SplashActivity.cs" />
|
||||||
<Compile Include="Renderers\RoundImageRenderer.cs" />
|
<Compile Include="Renderers\RoundImageRenderer.cs" />
|
||||||
|
<Compile Include="Renderers\AdaptedPageRenderer.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Resources\AboutResources.txt" />
|
<None Include="Resources\AboutResources.txt" />
|
||||||
|
43
Pixiview.Android/Renderers/AdaptedPageRenderer.cs
Normal file
43
Pixiview.Android/Renderers/AdaptedPageRenderer.cs
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
using Android.Content;
|
||||||
|
using Pixiview.Droid.Renderers;
|
||||||
|
using Pixiview.UI;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
using Xamarin.Forms.Platform.Android;
|
||||||
|
|
||||||
|
[assembly: ExportRenderer(typeof(AdaptedPage), typeof(AdaptedPageRenderer))]
|
||||||
|
namespace Pixiview.Droid.Renderers
|
||||||
|
{
|
||||||
|
public class AdaptedPageRenderer : PageRenderer
|
||||||
|
{
|
||||||
|
public AdaptedPageRenderer(Context context) : base(context)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnAttachedToWindow()
|
||||||
|
{
|
||||||
|
base.OnAttachedToWindow();
|
||||||
|
|
||||||
|
if (Element is AdaptedPage page)
|
||||||
|
{
|
||||||
|
page.OnLoad();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (Element is AdaptedPage page)
|
||||||
|
{
|
||||||
|
page.OnUnload();
|
||||||
|
}
|
||||||
|
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
//protected override void OnDetachedFromWindow()
|
||||||
|
//{
|
||||||
|
// App.DebugPrint("detached from window");
|
||||||
|
|
||||||
|
// base.OnDetachedFromWindow();
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
}
|
@ -18,12 +18,5 @@
|
|||||||
Margin="16" RowSpacing="16" ColumnSpacing="16"
|
Margin="16" RowSpacing="16" ColumnSpacing="16"
|
||||||
ItemTemplate="{StaticResource cardView}"/>
|
ItemTemplate="{StaticResource cardView}"/>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
<Frame HasShadow="False" Margin="0" Padding="20" CornerRadius="8"
|
|
||||||
IsVisible="{Binding IsLoading}"
|
|
||||||
HorizontalOptions="Center" VerticalOptions="Center"
|
|
||||||
BackgroundColor="{DynamicResource MaskColor}">
|
|
||||||
<ActivityIndicator IsRunning="True" IsVisible="True"
|
|
||||||
Color="{DynamicResource WindowColor}"/>
|
|
||||||
</Frame>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</i:FavoriteIllustCollectionPage>
|
</i:FavoriteIllustCollectionPage>
|
||||||
|
@ -43,7 +43,16 @@ namespace Pixiview.Illust
|
|||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return favorites.Illusts.ToArray();
|
var illusts = favorites.Illusts;
|
||||||
|
for (var i = 0; i < illusts.Count; i++)
|
||||||
|
{
|
||||||
|
var item = illusts[i];
|
||||||
|
if (item.RankTitle == null)
|
||||||
|
{
|
||||||
|
item.RankTitle = item.Title;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return illusts.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Reload(bool force = false)
|
public void Reload(bool force = false)
|
||||||
|
@ -312,7 +312,7 @@ namespace Pixiview.Illust
|
|||||||
Margin = 0,
|
Margin = 0,
|
||||||
CornerRadius = 10,
|
CornerRadius = 10,
|
||||||
ShadowColor = StyleDefinition.ColorLightShadow,
|
ShadowColor = StyleDefinition.ColorLightShadow,
|
||||||
ShadowOffset = new Size(2, 2),
|
ShadowOffset = new Size(1, 1),
|
||||||
Content = new Grid
|
Content = new Grid
|
||||||
{
|
{
|
||||||
HorizontalOptions = LayoutOptions.Fill,
|
HorizontalOptions = LayoutOptions.Fill,
|
||||||
@ -358,7 +358,7 @@ namespace Pixiview.Illust
|
|||||||
Margin = 0,
|
Margin = 0,
|
||||||
CornerRadius = 10,
|
CornerRadius = 10,
|
||||||
ShadowColor = StyleDefinition.ColorLightShadow,
|
ShadowColor = StyleDefinition.ColorLightShadow,
|
||||||
ShadowOffset = new Size(2, 2),
|
ShadowOffset = new Size(1, 1),
|
||||||
Content = new Grid
|
Content = new Grid
|
||||||
{
|
{
|
||||||
HorizontalOptions = LayoutOptions.Fill,
|
HorizontalOptions = LayoutOptions.Fill,
|
||||||
@ -427,6 +427,7 @@ namespace Pixiview.Illust
|
|||||||
|
|
||||||
protected void DoLoadIllusts(bool force = false)
|
protected void DoLoadIllusts(bool force = false)
|
||||||
{
|
{
|
||||||
|
App.DebugPrint($"start loading data, force: {force}");
|
||||||
illustData = DoLoadIllustData(force);
|
illustData = DoLoadIllustData(force);
|
||||||
if (illustData == null)
|
if (illustData == null)
|
||||||
{
|
{
|
||||||
|
@ -98,13 +98,32 @@ namespace Pixiview.Illust
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
gridFilter.TranslationY = -100;
|
gridFilter.TranslationY = -100;
|
||||||
panelFilter.TranslationY = -100;
|
panelFilter.TranslationY = -100;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnLoad()
|
||||||
|
{
|
||||||
|
SegmentDate = Preferences.Get(Configs.QueryModeKey, 0);
|
||||||
|
SegmentType = Preferences.Get(Configs.QueryTypeKey, 0);
|
||||||
lastQueryKey = QueryKey;
|
lastQueryKey = QueryKey;
|
||||||
queryDate = null; // $"{now.Year}{now.Month:00}{now.Day:00}";
|
queryDate = Preferences.Get(Configs.QueryDateKey, null);
|
||||||
currentPage = 1;
|
currentPage = 1;
|
||||||
|
|
||||||
datePicker.MinimumDate = new DateTime(2007, 9, 13);
|
datePicker.MinimumDate = new DateTime(2007, 9, 13);
|
||||||
MaximumDate = DateTime.Now;
|
MaximumDate = DateTime.Now;
|
||||||
|
|
||||||
|
App.DebugPrint("page loaded.");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnDisappearing()
|
||||||
|
{
|
||||||
|
base.OnDisappearing();
|
||||||
|
|
||||||
|
// saving state
|
||||||
|
Preferences.Set(Configs.QueryModeKey, SegmentDate);
|
||||||
|
Preferences.Set(Configs.QueryTypeKey, SegmentType);
|
||||||
|
if (queryDate != null)
|
||||||
|
{
|
||||||
|
Preferences.Set(Configs.QueryDateKey, queryDate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void DoIllustsLoaded(IllustCollection collection)
|
protected override void DoIllustsLoaded(IllustCollection collection)
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
<SaveOriginal>保存原图</SaveOriginal>
|
<SaveOriginal>保存原图</SaveOriginal>
|
||||||
<Share>分享</Share>
|
<Share>分享</Share>
|
||||||
<UserDetail>浏览用户</UserDetail>
|
<UserDetail>浏览用户</UserDetail>
|
||||||
|
<RelatedIllusts>相关推荐</RelatedIllusts>
|
||||||
<SaveSuccess>成功保存图片到照片库。</SaveSuccess>
|
<SaveSuccess>成功保存图片到照片库。</SaveSuccess>
|
||||||
<AlreadySavedQuestion>原图已保存,是否继续?</AlreadySavedQuestion>
|
<AlreadySavedQuestion>原图已保存,是否继续?</AlreadySavedQuestion>
|
||||||
<InvalidUrl>无法识别该 URL。</InvalidUrl>
|
<InvalidUrl>无法识别该 URL。</InvalidUrl>
|
||||||
|
@ -20,6 +20,7 @@ namespace Pixiview.Resources
|
|||||||
public static string SaveOriginal => GetResource(nameof(SaveOriginal));
|
public static string SaveOriginal => GetResource(nameof(SaveOriginal));
|
||||||
public static string Share => GetResource(nameof(Share));
|
public static string Share => GetResource(nameof(Share));
|
||||||
public static string UserDetail => GetResource(nameof(UserDetail));
|
public static string UserDetail => GetResource(nameof(UserDetail));
|
||||||
|
public static string RelatedIllusts => GetResource(nameof(RelatedIllusts));
|
||||||
public static string SaveSuccess => GetResource(nameof(SaveSuccess));
|
public static string SaveSuccess => GetResource(nameof(SaveSuccess));
|
||||||
public static string AlreadySavedQuestion => GetResource(nameof(AlreadySavedQuestion));
|
public static string AlreadySavedQuestion => GetResource(nameof(AlreadySavedQuestion));
|
||||||
public static string InvalidUrl => GetResource(nameof(InvalidUrl));
|
public static string InvalidUrl => GetResource(nameof(InvalidUrl));
|
||||||
|
@ -10,7 +10,7 @@ namespace Pixiview.UI
|
|||||||
public static readonly BindableProperty ShadowColorProperty = BindableProperty.Create(
|
public static readonly BindableProperty ShadowColorProperty = BindableProperty.Create(
|
||||||
nameof(ShadowColor), typeof(Color), typeof(CardView));
|
nameof(ShadowColor), typeof(Color), typeof(CardView));
|
||||||
public static readonly BindableProperty ShadowRadiusProperty = BindableProperty.Create(
|
public static readonly BindableProperty ShadowRadiusProperty = BindableProperty.Create(
|
||||||
nameof(ShadowRadius), typeof(float), typeof(CardView), 5f);
|
nameof(ShadowRadius), typeof(float), typeof(CardView), 3f);
|
||||||
public static readonly BindableProperty ShadowOffsetProperty = BindableProperty.Create(
|
public static readonly BindableProperty ShadowOffsetProperty = BindableProperty.Create(
|
||||||
nameof(ShadowOffset), typeof(Size), typeof(CardView));
|
nameof(ShadowOffset), typeof(Size), typeof(CardView));
|
||||||
public static readonly BindableProperty RankProperty = BindableProperty.Create(
|
public static readonly BindableProperty RankProperty = BindableProperty.Create(
|
||||||
|
@ -41,7 +41,7 @@ namespace Pixiview.UI
|
|||||||
public const string IconLove = "\uf004";
|
public const string IconLove = "\uf004";
|
||||||
public const string IconOption = "\uf013";
|
public const string IconOption = "\uf013";
|
||||||
public const string IconFavorite = "\uf02e";
|
public const string IconFavorite = "\uf02e";
|
||||||
public const string IconShare = "\uf35d";
|
public const string IconShare = "\uf1e0";
|
||||||
public const string IconCaretDown = "\uf0d7";
|
public const string IconCaretDown = "\uf0d7";
|
||||||
//public const string IconCaretUp = "\uf0d8";
|
//public const string IconCaretUp = "\uf0d8";
|
||||||
public const string IconCircleCheck = "\uf058";
|
public const string IconCircleCheck = "\uf058";
|
||||||
|
@ -407,6 +407,9 @@ namespace Pixiview.Utils
|
|||||||
public const string IsProxiedKey = "isProxied";
|
public const string IsProxiedKey = "isProxied";
|
||||||
public const string HostKey = "host";
|
public const string HostKey = "host";
|
||||||
public const string PortKey = "port";
|
public const string PortKey = "port";
|
||||||
|
public const string QueryModeKey = "query_mode";
|
||||||
|
public const string QueryTypeKey = "query_type";
|
||||||
|
public const string QueryDateKey = "query_date";
|
||||||
|
|
||||||
public const int MaxThreads = 3;
|
public const int MaxThreads = 3;
|
||||||
public const string Referer = "https://www.pixiv.net/";
|
public const string Referer = "https://www.pixiv.net/";
|
||||||
@ -434,7 +437,7 @@ namespace Pixiview.Utils
|
|||||||
//public const string AcceptEncoding = "gzip, deflate";
|
//public const string AcceptEncoding = "gzip, deflate";
|
||||||
public const string AcceptLanguage = "zh-cn";
|
public const string AcceptLanguage = "zh-cn";
|
||||||
|
|
||||||
#if !TEST
|
#if TEST
|
||||||
public const string UserId = "53887721";
|
public const string UserId = "53887721";
|
||||||
public const string Cookie =
|
public const string Cookie =
|
||||||
"PHPSESSID=5sn8n049j5c18l0tlj91qrjhesgddhjv; " +
|
"PHPSESSID=5sn8n049j5c18l0tlj91qrjhesgddhjv; " +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user