summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls/HanselForms/TwitterPage.xaml
blob: fb072797113779b93df5d83667bac616289985c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Xamarin.Forms.Controls.TwitterPage" Title="{Binding Title}" Icon="{Binding Icon}" IsBusy="{Binding IsBusy}">
	<AbsoluteLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
		<ListView CachingStrategy="RecycleElement" x:Name="listView" ItemsSource="{Binding Tweets}" HasUnevenRows="True" RowHeight="150" IsPullToRefreshEnabled="True" RefreshCommand="{Binding LoadTweetsCommand}" IsRefreshing="{Binding IsBusy, Mode=OneWay}" AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1,1">
			<ListView.ItemTemplate>
				<DataTemplate>
					<ViewCell>
						<Grid Padding="10,5">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="Auto" />
								<ColumnDefinition Width="*" />
							</Grid.ColumnDefinitions>
							<Image Source="{Binding Image}" VerticalOptions="Center">
								<Image.WidthRequest>
									<OnPlatform x:TypeArguments="x:Double">
										<OnPlatform.iOS>55</OnPlatform.iOS>
										<OnPlatform.Android>55 </OnPlatform.Android>
										<OnPlatform.WinPhone>75</OnPlatform.WinPhone>
									</OnPlatform>
								</Image.WidthRequest>
								<Image.HeightRequest>
									<OnPlatform x:TypeArguments="x:Double">
										<OnPlatform.iOS>55</OnPlatform.iOS>
										<OnPlatform.Android>55</OnPlatform.Android>
										<OnPlatform.WinPhone>75</OnPlatform.WinPhone>
									</OnPlatform>
								</Image.HeightRequest>
							</Image>
							<StackLayout Grid.Column="1" Padding="8" Spacing="4" VerticalOptions="Center">
								<Label Text="{Binding Date}" FontSize="Medium" TextColor="#3498DB" LineBreakMode="NoWrap" />
								<Label Text="{Binding Text}" x:Name="TweetText" FontSize="Small" LineBreakMode="WordWrap" />
							</StackLayout>
						</Grid>
					</ViewCell>
				</DataTemplate>
			</ListView.ItemTemplate>
		</ListView>
		<StackLayout IsVisible="{Binding IsBusy}" BackgroundColor="#80000000" Padding="12" AbsoluteLayout.LayoutFlags="PositionProportional" AbsoluteLayout.LayoutBounds="0.5,0.5,-1,-1">
			<ActivityIndicator IsRunning="{Binding IsBusy}" Color="White">
			</ActivityIndicator>
			<Label Text="Loading Twitter..." HorizontalOptions="Center" TextColor="White" />
		</StackLayout>
	</AbsoluteLayout>
</ContentPage>