add Android version

This commit is contained in:
2020-05-11 23:18:38 +08:00
parent 9f5685a2f8
commit 4561bc2674
53 changed files with 14716 additions and 63 deletions

View File

@@ -19,10 +19,9 @@
ItemTemplate="{StaticResource cardView}"/>
</ScrollView>
<u:BlurryPanel VerticalOptions="Start" HeightRequest="50" Margin="{Binding PanelTopMargin}"/>
<SearchBar Placeholder="{r:Text Search}" HeightRequest="50"
<SearchBar x:Name="searchBar" Placeholder="{r:Text Search}" HeightRequest="50"
VerticalOptions="Start"
Margin="{Binding PageTopMargin}"
BackgroundColor="Transparent"
CancelButtonColor="{DynamicResource TintColor}"
Text="{Binding Keywords, Mode=TwoWay}"
SearchButtonPressed="SearchBar_SearchButtonPressed"

View File

@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Windows.Input;
using Pixiview.UI;
using Pixiview.Utils;
using Xamarin.Essentials;
using Xamarin.Forms;
@@ -24,6 +23,14 @@ namespace Pixiview.Illust
{
Resources.Add("cardView", GetCardViewTemplate());
InitializeComponent();
#if __IOS__
searchBar.BackgroundColor = Color.Transparent;
#elif __ANDROID__
searchBar.SetDynamicResource(SearchBar.TextColorProperty, UI.Theme.ThemeBase.TextColor);
searchBar.SetDynamicResource(SearchBar.PlaceholderColorProperty, UI.Theme.ThemeBase.SubTextColor);
searchBar.SetDynamicResource(BackgroundColorProperty, UI.Theme.ThemeBase.WindowColor);
#endif
}
protected override bool IsLazyload => true;

View File

@@ -7,7 +7,12 @@
BackgroundColor="{DynamicResource WindowColor}">
<Shell.TitleView>
<StackLayout Orientation="Horizontal" Padding="0, 2, 0, 4">
<u:CircleImage Aspect="AspectFill" Source="{Binding UserIcon}"/>
<u:CircleImage Aspect="AspectFill" Source="{Binding UserIcon}"
WidthRequest="{x:OnPlatform Android=40}">
<u:CircleImage.Margin>
<OnPlatform x:TypeArguments="Thickness" Android="0, 5, 0, 5"/>
</u:CircleImage.Margin>
</u:CircleImage>
<Label Text="{Binding IllustItem.UserName}" Margin="10, 0, 0, 0"
VerticalOptions="Center" LineBreakMode="TailTruncation"
TextColor="{DynamicResource TextColor}"/>

View File

@@ -18,7 +18,7 @@
<CarouselView ItemsSource="{Binding Illusts}" HorizontalScrollBarVisibility="Never"
PositionChanged="CarouselView_PositionChanged">
<CarouselView.ItemsLayout>
<LinearItemsLayout Orientation="Horizontal" ItemSpacing="20"/>
<LinearItemsLayout Orientation="Vertical" ItemSpacing="20"/>
</CarouselView.ItemsLayout>
<CarouselView.ItemTemplate>
<DataTemplate x:DataType="mdl:IllustDetailItem">

View File

@@ -17,6 +17,7 @@ namespace Pixiview.Illust
{
public static readonly BindableProperty FavoriteIconProperty = BindableProperty.Create(
nameof(FavoriteIcon), typeof(ImageSource), typeof(ViewIllustPage));
public static readonly BindableProperty IllustsProperty = BindableProperty.Create(
nameof(Illusts), typeof(IllustDetailItem[]), typeof(ViewIllustPage));
public static readonly BindableProperty PagePositionTextProperty = BindableProperty.Create(
@@ -345,7 +346,7 @@ namespace Pixiview.Illust
{
MainThread.BeginInvokeOnMainThread(async () =>
{
var result = await FileStore.SaveImageToGalleryAsync(image);
var result = await FileStore.SaveImageToGalleryAsync(image, item.OriginalUrl);
string message = result ?? ResourceHelper.SaveSuccess;
await DisplayAlert(ResourceHelper.Title, message, ResourceHelper.Ok);