* Pixiview.iOS/Renderers/AdaptedPageRenderer.cs: fixed: status bar
hidden issue when startup with landscape * Pixiview/MainPage.xaml: * Pixiview/MainPage.xaml.cs: feature: add illust command * Pixiview/UI/CardView.cs: feature: resize height when measure card view. * Pixiview/Utils/Stores.cs: fixed: update working dirs
This commit is contained in:
@@ -14,8 +14,9 @@ namespace Pixiview.Utils
|
||||
public class Stores
|
||||
{
|
||||
public static readonly string PersonalFolder = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
|
||||
//public static readonly string CacheFolder = Environment.GetFolderPath(Environment.SpecialFolder.InternetCache);
|
||||
public static readonly string CacheFolder = Environment.GetFolderPath(Environment.SpecialFolder.InternetCache);
|
||||
private const string imageFolder = "img-master";
|
||||
private const string previewFolder = "img-preview";
|
||||
private const string thumbFolder = "img-thumb";
|
||||
private const string userFolder = "user-profile";
|
||||
private const string illustFile = "illust.json";
|
||||
@@ -88,25 +89,30 @@ namespace Pixiview.Utils
|
||||
|
||||
public static ImageSource LoadIllustImage(string url)
|
||||
{
|
||||
return LoadImage(url, imageFolder);
|
||||
return LoadImage(url, PersonalFolder, imageFolder);
|
||||
}
|
||||
|
||||
public static ImageSource LoadPreviewImage(string url)
|
||||
{
|
||||
return LoadImage(url, PersonalFolder, previewFolder);
|
||||
}
|
||||
|
||||
public static ImageSource LoadThumbnailImage(string url)
|
||||
{
|
||||
return LoadImage(url, thumbFolder);
|
||||
return LoadImage(url, CacheFolder, thumbFolder);
|
||||
}
|
||||
|
||||
public static ImageSource LoadUserProfileImage(string url)
|
||||
{
|
||||
return LoadImage(url, userFolder);
|
||||
return LoadImage(url, CacheFolder, userFolder);
|
||||
}
|
||||
|
||||
public static ImageSource LoadImage(string url, string folder)
|
||||
private static ImageSource LoadImage(string url, string working, string folder)
|
||||
{
|
||||
var file = Path.Combine(PersonalFolder, folder, Path.GetFileName(url));
|
||||
var file = Path.Combine(working, folder, Path.GetFileName(url));
|
||||
if (!File.Exists(file))
|
||||
{
|
||||
file = DownloadImage(url, folder);
|
||||
file = DownloadImage(url, working, folder);
|
||||
}
|
||||
if (file != null)
|
||||
{
|
||||
@@ -115,11 +121,11 @@ namespace Pixiview.Utils
|
||||
return null;
|
||||
}
|
||||
|
||||
public static string DownloadImage(string url, string folder)
|
||||
private static string DownloadImage(string url, string working, string folder)
|
||||
{
|
||||
try
|
||||
{
|
||||
var directory = Path.Combine(PersonalFolder, folder);
|
||||
var directory = Path.Combine(working, folder);
|
||||
if (!Directory.Exists(directory))
|
||||
{
|
||||
Directory.CreateDirectory(directory);
|
||||
|
||||
Reference in New Issue
Block a user