Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,94 +7,20 @@ namespace TwinTechs.Example
{
public static class DataProvider
{
/// <summary>
/// Gets the media items. - some canned data
/// </summary>
/// <returns>The media items.</returns>
public static ObservableCollection<MediaItem> GetMediaItems ()
{
var imagePaths = new String[] {
"http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/brent_5F00_schooley.metablogapi/6521.evolve_2D00_th_5F00_2FC8A2E4.jpg",
"https://www.google.com/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=&url=http%3A%2F%2Fwww.hanselman.com%2Fblog%2FXamarinEvolve2013TalkVideoHowCSavedMyMarriage.aspx&ei=uu5IVcrSLsmrgwTNvIHQAg&bvm=bv.92291466,d.eXY&psig=AFQjCNFXgQ4M3FZzJn3mlB3UeqqmUsqYZw&ust=1430929467200256",
"http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/nick-landry.metablogapi/5545.XamarinEvolveBannerNick_5F00_26AE7CBA.png",
"http://blog.xamarin.com/wp-content/uploads/2013/05/xamarin-stage.jpg",
"http://blog.xamarin.com/wp-content/uploads/2012/11/Austin-Conv-Center1-300x232.jpg",
"https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcR9Bf0UonMZGYjDzrUAuFlYLp0nFSiyyCtN_tSnX_ly4MsDv-qm",
"https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQ4YlPrkvqRk4SzwOlKqazpKHfQTsjX8LPNc68KdKKOxOe1gTZ6",
"http://i.ytimg.com/vi/SKEdFsLKH-U/maxresdefault.jpg",
"http://i.ytimg.com/vi/v9vEhwomUEY/maxresdefault.jpg",
"http://i.ytimg.com/vi/rBKxG67gAqE/maxresdefault.jpg",
"http://blog.xamarin.com/wp-content/uploads/2013/02/josh-speaks-300x200.jpg",
"http://i.ytimg.com/vi/GK9h71vGkpQ/maxresdefault.jpg",
"http://www.mirskayamusicstudio.com/images/2007SrRecital.jpg",
"http://i.ytimg.com/vi/aVmeb7im6M0/maxresdefault.jpg",
};
/// <summary>
 /// Gets the media items. - some canned data
 /// </summary>
 /// <returns>The media items.</returns>
 public static ObservableCollection<MediaItem> GetMediaItems ()
 {
// Random images as placeholders from https://unsplash.it
// URL Syntax:
// https://unsplash.it/<width>/<height>/?random
// Example:
// https://unsplash.it/200/300/?random
// You also need to add an additional random number to the URL to avoid the browser cache returning always the same image:
// https://unsplash.it/1920/1280/?random&num=<some random number>

var thumbnailPaths = new String[] {
"https://www.cambridgenetwork.co.uk/public/news/thumbnail_59902__suffolk-tap.png",
"http://datateca.unad.edu.co/contenidos/551059/OVAS/lecc4-scorm/story_content/thumbnail.jpg",
"https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcTbXpym6R2tgnAeKC1soKmEfHP4R5UFK9k9mixksHFT_n2uwlfBnA",
"https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSBuOuHm62yob2nL8DIWwWeOrI7kmnFuURCtLY0H53Z9Uca9bME",
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTTRtBIFU25jPkjSbYPOd244ft99WC2-_mrH3FbkRgnZM6rpdDD",
"https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcSXtrv2J733DzB779jniZEtncYJ5zyU-ovyapTOrxRRQKHWWlXw5Q",
"https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQQ1Tgn4cRdvvxmyblIJt9_kqb2Vuzr7v51l0u0I7L7Ef4OsbIUcQ",
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT3Di56JKw-IvOKFLJqgkVo9g4LeZrA2ZZFGq5t1-QR_5T45kNC",
"https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQFm2AtW1KzyWPpa2iGeopWpGPGN0LeevSJanO9SJO0bRyTYuIs",
"https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcRgvmWx5KtJQBCyW5kTfE3SO6Q3_ML1reqCPcV3qjLcV8Yz_eHmXA",
"https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcT_giyE73DP5fX2FxnluI1B6f9ljmFMTSIMMxeTEV0S0429z5yH",
"https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRPdi-AFq6Aln92RhhyNmZCoECy2p_FFEP2aGhhQd2AFWjLhhH6",
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ032CaSsv6sbufx_7FO8Mr-rWPTOXcVzmyhudLh7i09MRLwVMY1w",
"https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcTSKDEx6X-Dq90nSFZS7FBE3OplihNPU8L38h5yMde815uVUVwHTg",
};
var imageNames = new String[] {
"xaml is fast!",
"an interesting name",
"somethign I thought about",
"too quick for me",
"that's really nice",
"slow down!",
"move too fast",
"got to make",
"the moment last",
"kicking around",
"the cobbled stone",
"looking for fun",
"and feeling",
"groovy"
};


var userNames = new String[] {
"bob",
"shirly",
"ethel",
"jack",
"virginia",
"erik",
"rusty",
"mickey",
"Falcon",
"Henry",
"Lazarus",
"Jackie",
"Ashley",
"Penelope",
"Heather"
};
Random rand = new Random ();

 var imagePaths = new String [] {
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 };




 var thumbnailPaths = new String [] {
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 "https://unsplash.it/1920/1280/?random&num=" + rand.Next(),
 };





 var imageNames = new String [] {
 "xaml is fast!",
 "an interesting name",
 "somethign I thought about",
 "too quick for me",
 "that's really nice",
 "slow down!",
 "move too fast",
 "got to make",
 "the moment last",
 "kicking around",
 "the cobbled stone",
 "looking for fun",
 "and feeling",
 "groovy"
 };


 var userNames = new String [] {
 "bob",
 "shirly",
 "ethel",
 "jack",
 "virginia",
 "erik",
 "rusty",
 "mickey",
 "Falcon",
 "Henry",
 "Lazarus",
 "Jackie",
 "Ashley",
 "Penelope",
 "Heather"
 };

 ObservableCollection<MediaItem> items = new ObservableCollection<MediaItem> ();

 int counter = 0;
 for (int index = 0; index < 20; index++) {
 for (int i = 0; i < imagePaths.Length; i++) {
 var item = new MediaItem (imageNames [i], imageNames [i], userNames [i], imagePaths [i], imagePaths [i], thumbnailPaths [i], counter);
 items.Add (item);
 counter++;
 }

ObservableCollection<MediaItem> items = new ObservableCollection<MediaItem> ();

int counter = 0;
for (int index = 0; index < 20; index++) {
for (int i = 0; i < imagePaths.Length; i++) {
var item = new MediaItem (imageNames [i], imageNames [i], userNames [i], imagePaths [i], imagePaths [i], thumbnailPaths [i], counter);
items.Add (item);
counter++;
}

}
return items;
}
}
 return items;
 }
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
<?xml version="1.0" encoding="UTF-8"?>

<controls:FastCell
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

x:Class="TwinTechs.Example.FastCells.Cells.ComplexFastCellSVG"
xmlns:controls="clr-namespace:TwinTechs.Controls;assembly=TwinTechsForms"
xmlns:ncontrols="clr-namespace:TwinTechs;assembly=TwinTechsForms.SvgImage">

<AbsoluteLayout
BackgroundColor="Black">

<controls:FastImage
x:Name="ImageView"
AbsoluteLayout.LayoutFlags="WidthProportional"
AbsoluteLayout.LayoutBounds="0,0,1,260" />

<controls:FastImage
x:Name="UserThumbnailView"
AbsoluteLayout.LayoutFlags="None"
AbsoluteLayout.LayoutBounds="5,240,40,40" />

<Label
x:Name="NameLabel"
Text="Someone"
TextColor="White"
AbsoluteLayout.LayoutFlags="None"
FontSize="Small"
AbsoluteLayout.LayoutBounds="50,250,100,30" />

<Label
x:Name="DescriptionLabel"
Text="Description"
TextColor="White"
AbsoluteLayout.LayoutFlags="None"
FontSize="Small"
AbsoluteLayout.LayoutBounds="50,280,100,40" />

<StackLayout
Orientation="Horizontal">

<StackLayout
AbsoluteLayout.LayoutFlags="WidthProportional"
AbsoluteLayout.LayoutBounds="0,0,0.3,310">

<Label
Text="FAST CELL"
TextColor="White" />

<Label
Text="FAST CELL"
TextColor="White" />

<Button
Text="touch me" />

<Entry
Text="changeme" />

</StackLayout>



<StackLayout
AbsoluteLayout.LayoutFlags="WidthProportional"
AbsoluteLayout.LayoutBounds="0.3,0,0.3,310">



<Label
Text="FAST CELL"
TextColor="White" />

<Label
Text="FAST CELL"
TextColor="White" />


<ncontrols:SvgImage x:Name="svgPic1"
AbsoluteLayout.LayoutFlags="None"
AbsoluteLayout.LayoutBounds="5,5,40,40"
WidthRequest="40"
HeightRequest="40" />


<Entry
Text="changeme" />

<controls:FastImage
x:Name="UserThumbnailView2"
AbsoluteLayout.LayoutFlags="None"
AbsoluteLayout.LayoutBounds="5,40,40,40"
WidthRequest="40"
HeightRequest="40" />

<controls:FastImage
x:Name="UserThumbnailView3"
AbsoluteLayout.LayoutFlags="None"
AbsoluteLayout.LayoutBounds="5,80,40,40"
WidthRequest="40"
HeightRequest="40" />

<controls:FastImage
x:Name="UserThumbnailView4"
AbsoluteLayout.LayoutFlags="None"
AbsoluteLayout.LayoutBounds="5,120,40,40"
WidthRequest="40"
HeightRequest="40" />

</StackLayout>

<StackLayout
AbsoluteLayout.LayoutFlags="WidthProportional"
AbsoluteLayout.LayoutBounds="0.6,0,0.3,310">

<Label
Text="FAST CELL"
TextColor="White" />

<Label
Text="FAST CELL"
TextColor="White" />

<ncontrols:SvgImage x:Name="svgPic2"
AbsoluteLayout.LayoutFlags="None"
AbsoluteLayout.LayoutBounds="5,5,40,40"
WidthRequest="40"
HeightRequest="40" />

<Entry
Text="changeme" />

<controls:FastImage
x:Name="UserThumbnailView5"
AbsoluteLayout.LayoutFlags="None"
AbsoluteLayout.LayoutBounds="5,40,40,40"
WidthRequest="40"
HeightRequest="40" />

<controls:FastImage
x:Name="UserThumbnailView6"
AbsoluteLayout.LayoutFlags="None"
AbsoluteLayout.LayoutBounds="5,80,40,40"
WidthRequest="40"
HeightRequest="40" />

<controls:FastImage
x:Name="UserThumbnailView7"
AbsoluteLayout.LayoutFlags="None"
AbsoluteLayout.LayoutBounds="5,120,40,40"
WidthRequest="40"
HeightRequest="40" />



</StackLayout>

</StackLayout>

</AbsoluteLayout>

</controls:FastCell>
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
using System;
using System.Collections.Generic;
using Xamarin.Forms;
using TwinTechsForms.NControl;
using TwinTechs.Controls;
using System.Reflection;
using System.ComponentModel;
using System.Text;
using System.Threading.Tasks;
using System.Linq;


namespace TwinTechs.Example.FastCells.Cells
{
public partial class ComplexFastCellSVG : FastCell, INotifyPropertyChanged
{



protected override void InitializeCell ()
{


InitializeComponent ();



}

protected override void SetupCell (bool isRecycled)
{


var mediaItem = BindingContext as MediaItem;
if (mediaItem != null) {
UserThumbnailView.ImageUrl = mediaItem.ImagePath ?? "";
ImageView.ImageUrl = mediaItem.ThumbnailImagePath ?? "";
NameLabel.Text = mediaItem.Name;
DescriptionLabel.Text = mediaItem.Description;
UserThumbnailView2.ImageUrl = mediaItem.ThumbnailImagePath ?? "";
UserThumbnailView3.ImageUrl = mediaItem.ThumbnailImagePath ?? "";
UserThumbnailView4.ImageUrl = mediaItem.ThumbnailImagePath ?? "";
UserThumbnailView5.ImageUrl = mediaItem.ThumbnailImagePath ?? "";
UserThumbnailView6.ImageUrl = mediaItem.ThumbnailImagePath ?? "";
UserThumbnailView7.ImageUrl = mediaItem.ThumbnailImagePath ?? "";

svgPic1.SvgAssembly = this.SvgAssembly;
svgPic1.SvgPath = this.SmilePath;

svgPic2.SvgAssembly = this.SvgAssembly;
svgPic2.SvgPath = this.SunPath;


}
}


private Assembly _svgAssembly;

public Assembly SvgAssembly {
get {
if (_svgAssembly == null) {
_svgAssembly = typeof (App).GetTypeInfo ().Assembly;
}
return _svgAssembly;
}
}

public string SmilePath {
get { return @"TwinTechs.TwinTechs.Example.SvgImageSample.Assets.Smile.svg"; }
}

public string SunPath {
get { return @"TwinTechs.TwinTechs.Example.SvgImageSample.Assets.SunAtNight.svg"; }
}






}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>

<ContentPage
xmlns:cells="clr-namespace:TwinTechs.Example.FastCells.Cells;assembly=TwinTechsFormsExample"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TwinTechs.Example.FastCells.FastCellComplexSVGSamplePage"
Title="FastCell Complex">

<ContentPage.Content>

<ListView
x:Name="MediaItemsListView"
BackgroundColor="Transparent"
ItemSelected="OnItemSelected"
SeparatorVisibility="None"
RowHeight="300">

<ListView.ItemTemplate>

<DataTemplate>

<cells:ComplexFastCellSVG />

</DataTemplate>

</ListView.ItemTemplate>

</ListView>

</ContentPage.Content>

</ContentPage>
Loading