Skip to content

Commit

Permalink
Added new sample CachedImageSizingTestPage
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-luberda committed Jan 5, 2018
1 parent af90823 commit 13fb872
Show file tree
Hide file tree
Showing 13 changed files with 105 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@
<AndroidResource Include="Resources\values-v21\style.xml" />
<AndroidResource Include="Resources\layout\tabs.axml" />
<AndroidResource Include="Resources\layout\toolbar.axml" />
<AndroidResource Include="Resources\drawable-hdpi\ic_star_black_24dp.png" />
<AndroidResource Include="Resources\drawable-xhdpi\ic_star_black_24dp.png" />
<AndroidResource Include="Resources\drawable-xxhdpi\ic_star_black_24dp.png" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<ItemGroup>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@
<Compile Include="Pages\ByteArrayListPageCell.xaml.cs">
<DependentUpon>ByteArrayListPageCell.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\CachedImageSizingTestPage.xaml.cs">
<DependentUpon>CachedImageSizingTestPage.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\CachedImageSizingTestPageModel.cs" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -296,6 +300,9 @@
<EmbeddedResource Include="Pages\ByteArrayListPageCell.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
<EmbeddedResource Include="Pages\CachedImageSizingTestPage.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:xamvvm="clr-namespace:Xamvvm;assembly=Xamvvm.Forms" xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms" xmlns:fftransformations="clr-namespace:FFImageLoading.Transformations;assembly=FFImageLoading.Transformations" x:Class="FFImageLoading.Forms.Sample.CachedImageSizingTestPage">
<ScrollView>
<StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Padding="16,32,16,16">
<StackLayout Orientation="Horizontal">
<Label Text="Forms:Image" FontSize="14" HorizontalOptions="CenterAndExpand"/>
<Label Text="FFImageloading:CachedImage" HorizontalOptions="CenterAndExpand" FontSize="14"/>
</StackLayout>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width=".5*" />
<ColumnDefinition Width=".5*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="100" />
<RowDefinition Height="100" />
<RowDefinition Height="100" />
<RowDefinition Height="100" />
<RowDefinition Height="100" />
<RowDefinition Height="100" />
</Grid.RowDefinitions>

<StackLayout Grid.Column="0" Grid.Row="0" HorizontalOptions="FillAndExpand">
<Image HorizontalOptions="Center" Source="ic_star_black_24dp" />
</StackLayout>

<StackLayout Grid.Column="1" Grid.Row="0" HorizontalOptions="FillAndExpand">
<ffimageloading:CachedImage HorizontalOptions="Center" Source="ic_star_black_24dp" />
</StackLayout>

<StackLayout Grid.Column="0" Grid.Row="1" HorizontalOptions="FillAndExpand">
<Image HorizontalOptions="Center" Source="ic_star_black_24dp" WidthRequest="40"/>
</StackLayout>

<StackLayout Grid.Column="1" Grid.Row="1" HorizontalOptions="FillAndExpand">
<ffimageloading:CachedImage HorizontalOptions="Center" Source="ic_star_black_24dp" DownsampleToViewSize="true" WidthRequest="40"/>
</StackLayout>

<StackLayout Grid.Column="0" Grid.Row="2" HorizontalOptions="FillAndExpand">
<Image HorizontalOptions="Center" Source="ic_star_black_24dp" WidthRequest="40"/>
</StackLayout>

<StackLayout Grid.Column="1" Grid.Row="2" HorizontalOptions="FillAndExpand">
<ffimageloading:CachedImage HorizontalOptions="Center" Source="ic_star_black_24dp" DownsampleToViewSize="true" WidthRequest="40" DownsampleWidth="24"/>
</StackLayout>

<StackLayout Grid.Column="0" Grid.Row="3" HorizontalOptions="FillAndExpand">
<Image HorizontalOptions="Center" Source="ic_star_black_24dp" WidthRequest="24" />
</StackLayout>

<StackLayout Grid.Column="1" Grid.Row="3" HorizontalOptions="FillAndExpand">
<ffimageloading:CachedImage HorizontalOptions="Center" Source="ic_star_black_24dp" DownsampleToViewSize="true" WidthRequest="24"/>
</StackLayout>

</Grid>
</StackLayout>
</ScrollView>
</ContentPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Xamarin.Forms;
using Xamvvm;

namespace FFImageLoading.Forms.Sample
{
public partial class CachedImageSizingTestPage : ContentPage, IBasePage<CachedImageSizingTestPageModel>
{
public CachedImageSizingTestPage()
{
InitializeComponent();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using Xamvvm;

namespace FFImageLoading.Forms.Sample
{
public class CachedImageSizingTestPageModel : BasePageModel
{
public CachedImageSizingTestPageModel()
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,15 @@ public MenuPageModel()
})
},

new MenuItem() {
Section = "Advanced",
Title = "CachedImage sizing test",
Command = new BaseCommand(async (param) =>
{
await this.PushPageFromCacheAsync<CachedImageSizingTestPageModel>();
})
},

//new MenuItem() {
// Section = "Advanced",
// Title = "Stream with custom cache key example",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
<BundleResource Include="Resources\error.png" />
<BundleResource Include="Resources\loading.png" />
<BundleResource Include="Resources\sample.svg" />
<BundleResource Include="Resources\ic_star_black_24dp.png" />
<BundleResource Include="Resources\ic_star_black_24dp%402x.png" />
<BundleResource Include="Resources\ic_star_black_24dp%403x.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Shared\FFImageLoading.Forms.Sample.csproj">
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 13fb872

Please sign in to comment.