[OAPRNA-188] Patch fixes items positions and creates white line below.
Additionally creates "clear all" button with command binded to the
view model called on X icon tap.
Change-Id: I78ff6e3532561aeddab8ade7d6ca4e9d1fb93bfe
<DependentUpon>AppItemView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\BindableStackLayout.cs" />
+ <Compile Include="Views\ClearAllItemView.xaml.cs">
+ <DependentUpon>ClearAllItemView.xaml</DependentUpon>
+ </Compile>
<Compile Include="Views\MainView.xaml.cs">
<DependentUpon>MainView.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Folder Include="lib\" />
- <Folder Include="res\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Views\MainView.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
</ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Views\ClearAllItemView.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="res\images\clear_all_button_icon.png" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
public MainViewModel()
{
this.Applications = new ObservableCollection<ApplicationInfo>();
- //this.Applications.Add(new ApplicationInfo { Name = "Video", Icon = "/usr/apps/org.tizen.videos/shared/res/org.tizen.videos.png" });
- //this.Applications.Add(new ApplicationInfo { Name = "Settings", Icon = "/usr/apps/org.tizen.setting/shared/res/org.tizen.setting.png" });
- //this.Applications.Add(new ApplicationInfo { Name = "Contacts", Icon = "/usr/apps/org.tizen.contacts/shared/res/org.tizen.contacts.png" });
- //this.Applications.Add(new ApplicationInfo { Name = "My Files", Icon = "/usr/apps/org.tizen.myfile/shared/res/org.tizen.myfile.png" });
- //this.Applications.Add(new ApplicationInfo { Name = "Music", Icon = "/usr/apps/org.tizen.music-player/shared/res/org.tizen.music-player.png" });
- //this.Applications.Add(new ApplicationInfo { Name = "Messages", Icon = " /usr/apps/org.tizen.message/shared/res/message.png" });
- //this.Applications.Add(new ApplicationInfo { Name = "Memo", Icon = " /usr/apps/org.tizen.memo/shared/res/org.tizen.memo.png" });
- //this.Applications.Add(new ApplicationInfo { Name = "Internet", Icon = "/usr/apps/org.tizen.browser/shared/res/org.tizen.browser.png" });
- //this.Applications.Add(new ApplicationInfo { Name = "Gallery", Icon = "/usr/apps/org.tizen.gallery/shared/res/org.tizen.gallery.png" });
- //this.Applications.Add(new ApplicationInfo { Name = "Email", Icon = "/usr/apps/org.tizen.email/shared/res/org.tizen.email.png" });
- //this.Applications.Add(new ApplicationInfo { Name = "Camera", Icon = "/usr/apps/org.tizen.camera-app/shared/res/org.tizen.camera-app.png" });
- //this.Applications.Add(new ApplicationInfo { Name = "Clock", Icon = " /usr/apps/org.tizen.clock/shared/res/clock.png" });
- //this.Applications.Add(new ApplicationInfo { Name = "Calendar", Icon = "/usr/apps/org.tizen.calendar/shared/res/calendar.png" });
+ this.Applications.Add(new ApplicationInfo { Name = "Video", Icon = "/usr/apps/org.tizen.videos/shared/res/org.tizen.videos.png" });
+ this.Applications.Add(new ApplicationInfo { Name = "Settings", Icon = "/usr/apps/org.tizen.setting/shared/res/org.tizen.setting.png" });
+ this.Applications.Add(new ApplicationInfo { Name = "Contacts", Icon = "/usr/apps/org.tizen.contacts/shared/res/org.tizen.contacts.png" });
+ this.Applications.Add(new ApplicationInfo { Name = "My Files", Icon = "/usr/apps/org.tizen.myfile/shared/res/org.tizen.myfile.png" });
+ this.Applications.Add(new ApplicationInfo { Name = "Music", Icon = "/usr/apps/org.tizen.music-player/shared/res/org.tizen.music-player.png" });
+ this.Applications.Add(new ApplicationInfo { Name = "Messages", Icon = " /usr/apps/org.tizen.message/shared/res/message.png" });
+ this.Applications.Add(new ApplicationInfo { Name = "Memo", Icon = " /usr/apps/org.tizen.memo/shared/res/org.tizen.memo.png" });
+ this.Applications.Add(new ApplicationInfo { Name = "Internet", Icon = "/usr/apps/org.tizen.browser/shared/res/org.tizen.browser.png" });
+ this.Applications.Add(new ApplicationInfo { Name = "Gallery", Icon = "/usr/apps/org.tizen.gallery/shared/res/org.tizen.gallery.png" });
+ this.Applications.Add(new ApplicationInfo { Name = "Email", Icon = "/usr/apps/org.tizen.email/shared/res/org.tizen.email.png" });
+ this.Applications.Add(new ApplicationInfo { Name = "Camera", Icon = "/usr/apps/org.tizen.camera-app/shared/res/org.tizen.camera-app.png" });
+ this.Applications.Add(new ApplicationInfo { Name = "Clock", Icon = " /usr/apps/org.tizen.clock/shared/res/clock.png" });
+ this.Applications.Add(new ApplicationInfo { Name = "Calendar", Icon = "/usr/apps/org.tizen.calendar/shared/res/calendar.png" });
}
public ObservableCollection<ApplicationInfo> Applications { get; private set; }
x:Class="TaskManager.Tizen.Views.AppItemView"
>
<ContentView.Content>
- <RelativeLayout>
+ <RelativeLayout HeightRequest="118" Padding="0, 31">
<AbsoluteLayout RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0, Constant=0}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1, Constant=0}">
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1, Constant=0}"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1, Constant=0}">
<Image x:Name="AppIcon" Source="{Binding Icon}"
AbsoluteLayout.LayoutBounds=".5, .5, 118, 118" AbsoluteLayout.LayoutFlags="PositionProportional"/>
- <Label x:Name="AppName" Text="{Binding Name}" VerticalTextAlignment="Center" TextColor="White" FontSize="20" FontAttributes="Bold"
- AbsoluteLayout.LayoutBounds="1, .5, 0.38, .24" AbsoluteLayout.LayoutFlags="All"/>
+ <Label x:Name="AppName" Text="{Binding Name}" VerticalTextAlignment="Center" TextColor="White" FontSize="20" FontAttributes="Bold" VerticalOptions="CenterAndExpand"
+ AbsoluteLayout.LayoutBounds="1, .5, 0.38, 1" AbsoluteLayout.LayoutFlags="All"/>
</AbsoluteLayout>
</RelativeLayout>
</ContentView.Content>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+ xmlns:views="clr-namespace:TaskManager.Tizen.Views;assembly=TaskManager.Tizen"
+ x:Class="TaskManager.Tizen.Views.ClearAllItemView"
+ >
+
+ <ContentView.Content>
+ <AbsoluteLayout VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
+ <Image x:Name="AppIcon" Source="images/clear_all_button_icon.png"
+ AbsoluteLayout.LayoutBounds=".5, .5, 62, 62" AbsoluteLayout.LayoutFlags="PositionProportional">
+ <Image.GestureRecognizers>
+ <TapGestureRecognizer Tapped="OnTapped"/>
+ </Image.GestureRecognizers>
+ </Image>
+ <Label x:Name="AppName" Text="Clear all" VerticalTextAlignment="Center" TextColor="White" FontSize="20" FontAttributes="Bold" VerticalOptions="CenterAndExpand"
+ AbsoluteLayout.LayoutBounds="1, .5, 0.38, 1" AbsoluteLayout.LayoutFlags="All"/>
+ </AbsoluteLayout>
+ </ContentView.Content>
+</ContentView>
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Input;
+using Tizen;
+using Xamarin.Forms;
+
+namespace TaskManager.Tizen.Views
+{
+ public partial class ClearAllItemView : ContentView
+ {
+ public static readonly BindableProperty OnIconTappedProperty = BindableProperty.Create(nameof(OnIconTapped), typeof(ICommand), typeof(ContentView), null, BindingMode.OneWay, null);
+ public ICommand OnIconTapped
+ {
+ set
+ {
+ SetValue(OnIconTappedProperty, value);
+ }
+ get
+ {
+ return (ICommand)GetValue(OnIconTappedProperty);
+ }
+ }
+
+ public ClearAllItemView()
+ {
+ InitializeComponent();
+ }
+
+ private void OnTapped(object sender, EventArgs e)
+ {
+ OnIconTapped?.Execute(sender);
+ }
+ }
+}
IsVisible="{Binding Applications, Converter={StaticResource InvertListToBoolConverter}}"/>
<ScrollView AbsoluteLayout.LayoutBounds=".5, .5, 1, 1" AbsoluteLayout.LayoutFlags="All" IsVisible="{Binding Applications, Converter={StaticResource ListToBoolConverter}}">
- <views:BindableStackLayout ItemsSource="{Binding Applications}" >
- <views:BindableStackLayout.ItemTemplate>
- <DataTemplate>
- <ViewCell>
- <views:AppItemView></views:AppItemView>
- </ViewCell>
- </DataTemplate>
- </views:BindableStackLayout.ItemTemplate>
- </views:BindableStackLayout>
+ <StackLayout>
+ <BoxView VerticalOptions="FillAndExpand" HeightRequest="210"/>
+ <AbsoluteLayout>
+ <BoxView BackgroundColor="White" AbsoluteLayout.LayoutBounds=".5, 31, 2, 1" AbsoluteLayout.LayoutFlags="XProportional, HeightProportional"/>
+ <views:ClearAllItemView AbsoluteLayout.LayoutBounds=".5, .0, 1, 62" AbsoluteLayout.LayoutFlags="PositionProportional, WidthProportional" OnIconTapped="{Binding KillAll}"/>
+ <views:BindableStackLayout ItemsSource="{Binding Applications}" Padding="0, 25, 0, 0" AbsoluteLayout.LayoutBounds=".5, 62, 1, 1" AbsoluteLayout.LayoutFlags="XProportional, HeightProportional, WidthProportional">
+ <views:BindableStackLayout.ItemTemplate>
+ <DataTemplate>
+ <ViewCell>
+ <views:AppItemView/>
+ </ViewCell>
+ </DataTemplate>
+ </views:BindableStackLayout.ItemTemplate>
+ </views:BindableStackLayout>
+ </AbsoluteLayout>
+ </StackLayout>
</ScrollView>
</AbsoluteLayout>