fix: ranking page duplicate refresh
@ -76,6 +76,7 @@
|
|||||||
</u:SegmentedControl.Children>
|
</u:SegmentedControl.Children>
|
||||||
</u:SegmentedControl>
|
</u:SegmentedControl>
|
||||||
<u:SegmentedControl Grid.Row="1" HorizontalOptions="Start"
|
<u:SegmentedControl Grid.Row="1" HorizontalOptions="Start"
|
||||||
|
IsVisible="{Binding SegmentTypeVisible}"
|
||||||
Margin="6, 3, 6, 6" VerticalOptions="Center"
|
Margin="6, 3, 6, 6" VerticalOptions="Center"
|
||||||
SelectedSegmentIndex="{Binding SegmentType, Mode=TwoWay}"
|
SelectedSegmentIndex="{Binding SegmentType, Mode=TwoWay}"
|
||||||
SelectedTextColor="{DynamicResource TextColor}"
|
SelectedTextColor="{DynamicResource TextColor}"
|
||||||
|
@ -16,12 +16,14 @@ namespace Pixiview.Illust
|
|||||||
|
|
||||||
public static readonly BindableProperty SegmentDateProperty = BindableProperty.Create(
|
public static readonly BindableProperty SegmentDateProperty = BindableProperty.Create(
|
||||||
nameof(SegmentDate), typeof(int), typeof(RankingPage), propertyChanged: OnSegmentDatePropertyChanged);
|
nameof(SegmentDate), typeof(int), typeof(RankingPage), propertyChanged: OnSegmentDatePropertyChanged);
|
||||||
|
public static readonly BindableProperty SegmentTypeVisibleProperty = BindableProperty.Create(
|
||||||
|
nameof(SegmentTypeVisible), typeof(bool), typeof(RankingPage));
|
||||||
public static readonly BindableProperty SegmentTypeProperty = BindableProperty.Create(
|
public static readonly BindableProperty SegmentTypeProperty = BindableProperty.Create(
|
||||||
nameof(SegmentType), typeof(int), typeof(RankingPage), propertyChanged: OnSegmentTypePropertyChanged);
|
nameof(SegmentType), typeof(int), typeof(RankingPage), propertyChanged: OnSegmentTypePropertyChanged);
|
||||||
public static readonly BindableProperty MaximumDateProperty = BindableProperty.Create(
|
public static readonly BindableProperty MaximumDateProperty = BindableProperty.Create(
|
||||||
nameof(MaximumDate), typeof(DateTime), typeof(RankingPage), DateTime.Now);
|
nameof(MaximumDate), typeof(DateTime), typeof(RankingPage), DateTime.Today);
|
||||||
public static readonly BindableProperty SelectedDateProperty = BindableProperty.Create(
|
public static readonly BindableProperty SelectedDateProperty = BindableProperty.Create(
|
||||||
nameof(SelectedDate), typeof(DateTime), typeof(RankingPage), DateTime.Now);
|
nameof(SelectedDate), typeof(DateTime), typeof(RankingPage), DateTime.Today);
|
||||||
|
|
||||||
private static void OnSegmentDatePropertyChanged(BindableObject obj, object old, object @new)
|
private static void OnSegmentDatePropertyChanged(BindableObject obj, object old, object @new)
|
||||||
{
|
{
|
||||||
@ -59,6 +61,11 @@ namespace Pixiview.Illust
|
|||||||
get => (int)GetValue(SegmentDateProperty);
|
get => (int)GetValue(SegmentDateProperty);
|
||||||
set => SetValue(SegmentDateProperty, value);
|
set => SetValue(SegmentDateProperty, value);
|
||||||
}
|
}
|
||||||
|
public bool SegmentTypeVisible
|
||||||
|
{
|
||||||
|
get => (bool)GetValue(SegmentTypeVisibleProperty);
|
||||||
|
set => SetValue(SegmentTypeVisibleProperty, value);
|
||||||
|
}
|
||||||
public int SegmentType
|
public int SegmentType
|
||||||
{
|
{
|
||||||
get => (int)GetValue(SegmentTypeProperty);
|
get => (int)GetValue(SegmentTypeProperty);
|
||||||
@ -97,17 +104,33 @@ namespace Pixiview.Illust
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
gridFilter.TranslationY = -100;
|
gridFilter.TranslationY = -100;
|
||||||
panelFilter.TranslationY = -100;
|
panelFilter.TranslationY = -100;
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnLoad()
|
// preferences
|
||||||
{
|
|
||||||
SegmentDate = Preferences.Get(Configs.QueryModeKey, 0);
|
SegmentDate = Preferences.Get(Configs.QueryModeKey, 0);
|
||||||
SegmentType = Preferences.Get(Configs.QueryTypeKey, 0);
|
SegmentType = Preferences.Get(Configs.QueryTypeKey, 0);
|
||||||
lastQueryKey = QueryKey;
|
lastQueryKey = QueryKey;
|
||||||
queryDate = Preferences.Get(Configs.QueryDateKey, null);
|
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.Today;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnAppearing()
|
||||||
|
{
|
||||||
|
var r18 = Configs.IsOnR18;
|
||||||
|
if (!r18)
|
||||||
|
{
|
||||||
|
SegmentType = 0;
|
||||||
|
var query = QueryKey;
|
||||||
|
if (lastQueryKey != query)
|
||||||
|
{
|
||||||
|
ReleaseCollection();
|
||||||
|
lastQueryKey = query;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SegmentTypeVisible = r18;
|
||||||
|
|
||||||
|
base.OnAppearing();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDisappearing()
|
protected override void OnDisappearing()
|
||||||
@ -243,17 +266,11 @@ namespace Pixiview.Illust
|
|||||||
ToggleFilterPanel(false);
|
ToggleFilterPanel(false);
|
||||||
}
|
}
|
||||||
// release
|
// release
|
||||||
var collection = IllustCollection;
|
ReleaseCollection();
|
||||||
if (collection != null)
|
|
||||||
{
|
|
||||||
collection.Running = false;
|
|
||||||
IllustCollection = null;
|
|
||||||
}
|
|
||||||
previousEnabled = false;
|
previousEnabled = false;
|
||||||
dateEnabled = false;
|
dateEnabled = false;
|
||||||
nextEnabled = false;
|
nextEnabled = false;
|
||||||
queryDate = date;
|
queryDate = date;
|
||||||
currentPage = 1;
|
|
||||||
StartLoad(true);
|
StartLoad(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -273,22 +290,17 @@ namespace Pixiview.Illust
|
|||||||
|
|
||||||
private void DatePicker_DateSelected(object sender, DateChangedEventArgs e)
|
private void DatePicker_DateSelected(object sender, DateChangedEventArgs e)
|
||||||
{
|
{
|
||||||
if (IsLoading)
|
if (e.OldDate == DateTime.Today || IsLoading)
|
||||||
{
|
{
|
||||||
|
// first load or loading
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// release
|
// release
|
||||||
var collection = IllustCollection;
|
ReleaseCollection();
|
||||||
if (collection != null)
|
|
||||||
{
|
|
||||||
collection.Running = false;
|
|
||||||
IllustCollection = null;
|
|
||||||
}
|
|
||||||
previousEnabled = false;
|
previousEnabled = false;
|
||||||
dateEnabled = false;
|
dateEnabled = false;
|
||||||
nextEnabled = false;
|
nextEnabled = false;
|
||||||
queryDate = e.NewDate.ToString("yyyyMMdd");
|
queryDate = e.NewDate.ToString("yyyyMMdd");
|
||||||
currentPage = 1;
|
|
||||||
StartLoad(true);
|
StartLoad(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,17 +354,11 @@ namespace Pixiview.Illust
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (lastQueryKey != query)
|
//if (lastQueryKey != query)
|
||||||
{
|
{
|
||||||
// release
|
// release
|
||||||
var collection = IllustCollection;
|
ReleaseCollection();
|
||||||
if (collection != null)
|
|
||||||
{
|
|
||||||
collection.Running = false;
|
|
||||||
IllustCollection = null;
|
|
||||||
}
|
|
||||||
// query changed.
|
// query changed.
|
||||||
currentPage = 1;
|
|
||||||
lastQueryKey = query;
|
lastQueryKey = query;
|
||||||
refresh = true;
|
refresh = true;
|
||||||
App.DebugPrint($"query changed: {query}");
|
App.DebugPrint($"query changed: {query}");
|
||||||
@ -363,5 +369,16 @@ namespace Pixiview.Illust
|
|||||||
StartLoad(true);
|
StartLoad(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ReleaseCollection()
|
||||||
|
{
|
||||||
|
var collection = IllustCollection;
|
||||||
|
if (collection != null)
|
||||||
|
{
|
||||||
|
collection.Running = false;
|
||||||
|
IllustCollection = null;
|
||||||
|
}
|
||||||
|
currentPage = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,6 +92,7 @@ namespace Pixiview.Illust
|
|||||||
return new Grid
|
return new Grid
|
||||||
{
|
{
|
||||||
RowSpacing = 0,
|
RowSpacing = 0,
|
||||||
|
ColumnSpacing = 0,
|
||||||
RowDefinitions =
|
RowDefinitions =
|
||||||
{
|
{
|
||||||
new RowDefinition { Height = 40 },
|
new RowDefinition { Height = 40 },
|
||||||
|
@ -148,6 +148,7 @@ namespace Pixiview.Illust
|
|||||||
|
|
||||||
protected override void OnDisappearing()
|
protected override void OnDisappearing()
|
||||||
{
|
{
|
||||||
|
Screen.SetHomeIndicatorAutoHidden(Shell.Current, false);
|
||||||
base.OnDisappearing();
|
base.OnDisappearing();
|
||||||
|
|
||||||
if (ugoira != null)
|
if (ugoira != null)
|
||||||
@ -160,7 +161,6 @@ namespace Pixiview.Illust
|
|||||||
{
|
{
|
||||||
Stores.SaveFavoritesIllusts();
|
Stores.SaveFavoritesIllusts();
|
||||||
}
|
}
|
||||||
Screen.SetHomeIndicatorAutoHidden(Shell.Current, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private DataTemplate GetCarouseTemplate(bool multiPages)
|
private DataTemplate GetCarouseTemplate(bool multiPages)
|
||||||
|
@ -450,7 +450,7 @@ namespace Pixiview.Utils
|
|||||||
public const string QueryTypeKey = "query_type";
|
public const string QueryTypeKey = "query_type";
|
||||||
public const string QueryDateKey = "query_date";
|
public const string QueryDateKey = "query_date";
|
||||||
|
|
||||||
public const int MaxThreads = 3;
|
public const int MaxThreads = 6;
|
||||||
public const string Referer = "https://www.pixiv.net/";
|
public const string Referer = "https://www.pixiv.net/";
|
||||||
public const string RefererIllust = "https://www.pixiv.net/artworks/{0}";
|
public const string RefererIllust = "https://www.pixiv.net/artworks/{0}";
|
||||||
public const string RefererIllustRanking = "https://www.pixiv.net/ranking.php?{0}";
|
public const string RefererIllustRanking = "https://www.pixiv.net/ranking.php?{0}";
|
||||||
|
@ -3,7 +3,14 @@ iOS/Android client app for [Pixiv.net](https://pixiv.net/).
|
|||||||
|
|
||||||
## Screenshot
|
## Screenshot
|
||||||
|
|
||||||

|
|||
|
||||||
|
|:-|:-|
|
||||||
|
|||
|
||||||
|
|:-|:-|
|
||||||
|
|||
|
||||||
|
|:-|:-|
|
||||||
|
|||
|
||||||
|
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 588 KiB After Width: | Height: | Size: 2.4 MiB |
BIN
Res/screenshot2.png
Normal file
After Width: | Height: | Size: 1.7 MiB |
BIN
Res/screenshot3.png
Normal file
After Width: | Height: | Size: 2.3 MiB |
BIN
Res/screenshot4.png
Normal file
After Width: | Height: | Size: 2.2 MiB |
BIN
Res/screenshot5.png
Normal file
After Width: | Height: | Size: 2.0 MiB |
BIN
Res/screenshot6.png
Normal file
After Width: | Height: | Size: 2.2 MiB |
BIN
Res/screenshot7.png
Normal file
After Width: | Height: | Size: 2.4 MiB |
BIN
Res/screenshot8.png
Normal file
After Width: | Height: | Size: 635 KiB |