TizenRefApp-8628 Implement project skeleton for Call app 66/141466/4
authorRuslan Zakharov <r.zakharov@samsung.com>
Thu, 27 Jul 2017 13:13:08 +0000 (16:13 +0300)
committerRuslan Zakharov <r.zakharov@samsung.com>
Mon, 14 Aug 2017 08:49:59 +0000 (11:49 +0300)
Added Contact information panel, made refactor

Change-Id: I5d805a337289a26359f03db542f5836c2bf75a1a

15 files changed:
CallApp.Tizen/Call/Controls/ContactInformationPanel.xaml [new file with mode: 0644]
CallApp.Tizen/Call/Controls/ContactInformationPanel.xaml.cs [new file with mode: 0644]
CallApp.Tizen/Call/Controls/RejectCallPanel.xaml.cs
CallApp.Tizen/Call/Themes/CallTheme.xaml
CallApp.Tizen/CallApp.Tizen.csproj
CallApp.Tizen/res/Call ID/348x348/call_photo_id_conference.png [new file with mode: 0644]
CallApp.Tizen/res/Call ID/96x96/call_active_photo_id_bg.png [deleted file]
CallApp.Tizen/res/Call ID/96x96/call_active_photo_id_default.png [deleted file]
CallApp.Tizen/res/Call ID/96x96/call_photo_id_emergency.png [deleted file]
CallApp.Tizen/res/Call ID/96x96/call_photo_id_messageinfo.png [deleted file]
CallApp.Tizen/res/call_btn_ic_accept.png [deleted file]
CallApp.Tizen/res/call_end_ic_call.png [deleted file]
CallApp.Tizen/res/call_end_message.png [deleted file]
CallApp.Tizen/res/call_multi_ic_arrow.png [new file with mode: 0644]
CallApp.Tizen/res/core_button_add.png [deleted file]

diff --git a/CallApp.Tizen/Call/Controls/ContactInformationPanel.xaml b/CallApp.Tizen/Call/Controls/ContactInformationPanel.xaml
new file mode 100644 (file)
index 0000000..f1f0713
--- /dev/null
@@ -0,0 +1,176 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
+             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+             x:Class="CallApp.Tizen.Call.Controls.ContactInformationPanel"
+             x:Name="This"
+             xmlns:callThemes="clr-namespace:CallApp.Tizen.Call.Themes"
+             xmlns:commonControls="clr-namespace:CallApp.Tizen.Common.Controls">
+
+    <ContentView.Resources>
+        <ResourceDictionary MergedWith="callThemes:CallTheme">
+            <ControlTemplate x:Key="EndPanel">
+                <commonControls:CustomGrid>
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="232" />
+                        <ColumnDefinition Width="*" />
+                    </Grid.ColumnDefinitions>
+
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="24" />
+                        <RowDefinition Height="54" />
+                        <RowDefinition Height="242" />
+                    </Grid.RowDefinitions>
+
+                    <Label Grid.Column="0" Grid.Row="1" Margin="32,0,0,0" HorizontalOptions="Start" VerticalOptions="Center"
+                           TextColor="{StaticResource CallDefaultTextColor}" FontSize="27" Text="{TemplateBinding StatusText}" />
+
+                    <Image Grid.Column="0" Grid.Row="2" Margin="32,0,32,0" WidthRequest="168" HeightRequest="168"
+                           HorizontalOptions="Center" VerticalOptions="Center" Source="{TemplateBinding Image}" />
+
+                    <commonControls:CustomGrid Grid.Column="1" Grid.Row="2">
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="50" />
+                            <RowDefinition Height="76" />
+                            <RowDefinition Height="6" />
+                            <RowDefinition Height="46" />
+                        </Grid.RowDefinitions>
+
+                        <Label Grid.Row="1" HorizontalOptions="Start" VerticalOptions="Center" TextColor="{StaticResource CallDefaultTextColor}"
+                               FontSize="38" Text="{TemplateBinding PrimaryText}" />
+
+                        <Label Grid.Row="3" HorizontalOptions="Start" VerticalOptions="Center" TextColor="{StaticResource CallDefaultTextColor}"
+                               FontSize="23" Text="{TemplateBinding SecondaryText}" />
+                    </commonControls:CustomGrid>
+                </commonControls:CustomGrid>
+            </ControlTemplate>
+
+            <ControlTemplate x:Key="MiniPanel">
+                <commonControls:CustomGrid HeightRequest="172">
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="160" />
+                        <ColumnDefinition Width="*" />
+                    </Grid.ColumnDefinitions>
+
+                    <RelativeLayout Grid.Column="0" HorizontalOptions="Center" VerticalOptions="Center">
+                        <Image x:Name="xPhoto" WidthRequest="96" HeightRequest="96"
+                               HorizontalOptions="Center" VerticalOptions="Center" Source="{TemplateBinding Image}" />
+
+                        <Image Source="call_active_ic_call.png"
+                               RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=xPhoto, Property=X, Constant=55}"
+                               RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=xPhoto, Property=Y, Constant=55}" />
+                    </RelativeLayout>
+
+                    <StackLayout Grid.Column="1" VerticalOptions="Center">
+                        <Label HeightRequest="43" HorizontalOptions="Start" VerticalOptions="Center" TextColor="{StaticResource CallDefaultTextColor}"
+                               FontSize="21" Text="{TemplateBinding StatusText}" />
+
+                        <Label HeightRequest="53" HorizontalOptions="Start" VerticalOptions="Center" TextColor="{StaticResource CallDefaultTextColor}"
+                               FontSize="26" Text="{TemplateBinding PrimaryText}" />
+
+                        <Label HeightRequest="43" HorizontalOptions="Start" VerticalOptions="Center"
+                               TextColor="{StaticResource CallDefaultTextColor}" FontSize="21" Text="{TemplateBinding SecondaryText}"
+                               IsVisible="False" />
+                    </StackLayout>
+                </commonControls:CustomGrid>
+            </ControlTemplate>
+
+            <ControlTemplate x:Key="MultiplePanel">
+                <commonControls:CustomGrid>
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="104" />
+                        <ColumnDefinition Width="*" />
+                        <ColumnDefinition Width="104" />
+                    </Grid.ColumnDefinitions>
+
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="Auto" />
+                        <RowDefinition Height="Auto" />
+                    </Grid.RowDefinitions>
+
+                    <commonControls:CustomGrid Grid.Column="1" Grid.Row="0">
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="24" />
+                            <RowDefinition Height="54" />
+                            <RowDefinition Height="33" />
+                            <RowDefinition Height="348" />
+                        </Grid.RowDefinitions>
+
+                        <Label Grid.Row="1" HorizontalOptions="Start" VerticalOptions="Center" TextColor="{StaticResource CallDefaultTextColor}"
+                               FontSize="27" Text="{TemplateBinding StatusText}" />
+
+                        <Image Grid.Row="3" HorizontalOptions="Center" VerticalOptions="Center" Source="{TemplateBinding Image}" />
+                    </commonControls:CustomGrid>
+
+                    <commonControls:CustomGrid Grid.Column="1" Grid.Row="1">
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="42" />
+                            <RowDefinition Height="86" />
+                            <RowDefinition Height="8" />
+                            <RowDefinition Height="54" />
+                            <RowDefinition Height="63" />
+                        </Grid.RowDefinitions>
+
+                        <Label Grid.Row="1" HorizontalOptions="Center" VerticalOptions="Center" TextColor="{StaticResource CallDefaultTextColor}"
+                               FontSize="47" Text="{TemplateBinding PrimaryText}" />
+
+                        <Label Grid.Row="3" HorizontalOptions="Center" VerticalOptions="Center" TextColor="{StaticResource CallDefaultTextColor}"
+                               FontSize="27" Text="{TemplateBinding SecondaryText}" />
+                    </commonControls:CustomGrid>
+
+                    <Image Grid.Column="2" Grid.Row="1" HorizontalOptions="Center" VerticalOptions="Center" Source="call_multi_ic_arrow.png" />
+                </commonControls:CustomGrid>
+            </ControlTemplate>
+
+            <ControlTemplate x:Key="SinglePanel">
+                <commonControls:CustomGrid>
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="32" />
+                        <ColumnDefinition Width="*" />
+                        <ColumnDefinition Width="32" />
+                    </Grid.ColumnDefinitions>
+
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="24" />
+                        <RowDefinition Height="54" />
+                        <RowDefinition Height="33" />
+                        <RowDefinition Height="348" />
+                        <RowDefinition Height="42" />
+                        <RowDefinition Height="86" />
+                        <RowDefinition Height="8" />
+                        <RowDefinition Height="54" />
+                        <RowDefinition Height="63" />
+                    </Grid.RowDefinitions>
+
+                    <Label Grid.Column="1" Grid.Row="1" HorizontalOptions="Start" VerticalOptions="Center" TextColor="{StaticResource CallDefaultTextColor}"
+                           FontSize="27" Text="{TemplateBinding StatusText}" />
+
+                    <Image Grid.Column="1" Grid.Row="3" HorizontalOptions="Center" VerticalOptions="Center" Source="{TemplateBinding Image}" />
+
+                    <Label Grid.Column="1" Grid.Row="5" HorizontalOptions="Center" VerticalOptions="Center" TextColor="{StaticResource CallDefaultTextColor}"
+                           FontSize="47" Text="{TemplateBinding PrimaryText}" />
+
+                    <Label Grid.Column="1" Grid.Row="7" HorizontalOptions="Center" VerticalOptions="Center" TextColor="{StaticResource CallDefaultTextColor}"
+                           FontSize="27" Text="{TemplateBinding SecondaryText}" />
+                </commonControls:CustomGrid>
+            </ControlTemplate>
+        </ResourceDictionary>
+    </ContentView.Resources>
+
+    <ContentView.Triggers>
+        <DataTrigger TargetType="ContentView" Binding="{Binding Source={x:Reference This}, Path=LayoutType}" Value="End">
+            <Setter Property="ControlTemplate" Value="{StaticResource EndPanel}" />
+        </DataTrigger>
+
+        <DataTrigger TargetType="ContentView" Binding="{Binding Source={x:Reference This}, Path=LayoutType}" Value="Mini">
+            <Setter Property="ControlTemplate" Value="{StaticResource MiniPanel}" />
+        </DataTrigger>
+
+        <DataTrigger TargetType="ContentView" Binding="{Binding Source={x:Reference This}, Path=LayoutType}" Value="Multiple">
+            <Setter Property="ControlTemplate" Value="{StaticResource MultiplePanel}" />
+        </DataTrigger>
+
+        <DataTrigger TargetType="ContentView" Binding="{Binding Source={x:Reference This}, Path=LayoutType}" Value="Single">
+            <Setter Property="ControlTemplate" Value="{StaticResource SinglePanel}" />
+        </DataTrigger>
+    </ContentView.Triggers>
+</ContentView>
\ No newline at end of file
diff --git a/CallApp.Tizen/Call/Controls/ContactInformationPanel.xaml.cs b/CallApp.Tizen/Call/Controls/ContactInformationPanel.xaml.cs
new file mode 100644 (file)
index 0000000..ec5597b
--- /dev/null
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using Xamarin.Forms;
+
+namespace CallApp.Tizen.Call.Controls
+{
+    public partial class ContactInformationPanel : ContentView
+    {
+        /// <summary>
+        /// Layout types
+        /// </summary>
+        public enum LayoutTypes
+        {
+            End,
+            Mini,
+            Multiple,
+            Single
+        }
+
+        public ContactInformationPanel()
+        {
+            InitializeComponent();
+        }
+
+        /// <summary>
+        /// Layout type of panel
+        /// </summary>
+        public static readonly BindableProperty LayoutTypeProperty = BindableProperty.Create(
+            "LayoutType",
+            typeof(LayoutTypes),
+            typeof(ContactInformationPanel),
+            LayoutTypes.Single);
+
+        public LayoutTypes LayoutType
+        {
+            get
+            {
+                return (LayoutTypes)GetValue(LayoutTypeProperty);
+            }
+            set
+            {
+                SetValue(LayoutTypeProperty, value);
+            }
+        }
+
+        /// <summary>
+        /// Text of status
+        /// </summary>
+        public static readonly BindableProperty StatusTextProperty = BindableProperty.Create(
+            "StatusText",
+            typeof(string),
+            typeof(ContactInformationPanel),
+            string.Empty);
+
+        public string StatusText
+        {
+            get
+            {
+                return (string)GetValue(StatusTextProperty);
+            }
+            set
+            {
+                SetValue(StatusTextProperty, value);
+            }
+        }
+
+        /// <summary>
+        /// Image, may be photo of contact for example
+        /// </summary>
+        public static readonly BindableProperty ImageProperty = BindableProperty.Create(
+            "Image",
+            typeof(ImageSource),
+            typeof(ContactInformationPanel),
+            null);
+
+        public ImageSource Image
+        {
+            get
+            {
+                return (ImageSource)GetValue(ImageProperty);
+            }
+            set
+            {
+                SetValue(ImageProperty, value);
+            }
+        }
+
+        /// <summary>
+        /// Primary text, may be name of contact for example
+        /// </summary>
+        public static readonly BindableProperty PrimaryTextProperty = BindableProperty.Create(
+            "PrimaryText",
+            typeof(string),
+            typeof(ContactInformationPanel),
+            string.Empty);
+
+        public string PrimaryText
+        {
+            get
+            {
+                return (string)GetValue(PrimaryTextProperty);
+            }
+            set
+            {
+                SetValue(PrimaryTextProperty, value);
+            }
+        }
+
+        /// <summary>
+        /// Secondary text, may be phone number of contact for example
+        /// </summary>
+        public static readonly BindableProperty SecondaryTextProperty = BindableProperty.Create(
+            "SecondaryText",
+            typeof(string),
+            typeof(ContactInformationPanel),
+            string.Empty);
+
+        public string SecondaryText
+        {
+            get
+            {
+                return (string)GetValue(SecondaryTextProperty);
+            }
+            set
+            {
+                SetValue(SecondaryTextProperty, value);
+            }
+        }
+    }
+}
index 0785ef3..8f1aa3f 100644 (file)
@@ -21,7 +21,7 @@ namespace CallApp.Tizen.Call.Controls
     public partial class RejectCallPanel : ContentView
     {
         /// <summary>
-        /// Type of direction of panel
+        /// Opening direction type
         /// </summary>
         public enum OpenDirectionType
         {
index 5d804d8..57ceb80 100644 (file)
@@ -4,6 +4,7 @@
                     x:Class="CallApp.Tizen.Call.Themes.CallTheme">
 
     <Color x:Key="CallBGColor">#FFF7F7F7</Color>
+    <Color x:Key="CallDefaultTextColor">#FFFAFAFA</Color>
 
     <Color x:Key="CallButtonCircleRejectBGColor">#4DE02222</Color>
     <Color x:Key="CallButtonCircleRejectNormalColor">#FFD63131</Color>
index 7bd3756..d8426bd 100644 (file)
@@ -58,6 +58,9 @@
     <Compile Include="Call\Controls\CallHandlingPanel.xaml.cs">
       <DependentUpon>CallHandlingPanel.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Call\Controls\ContactInformationPanel.xaml.cs">
+      <DependentUpon>ContactInformationPanel.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Call\Controls\FlatButton.xaml.cs">
       <DependentUpon>FlatButton.xaml</DependentUpon>
     </Compile>
     <Folder Include="lib\" />
   </ItemGroup>
   <ItemGroup>
+    <Content Include="res\Call ID\168x168\call_end_photo_id_default.png" />
     <Content Include="res\Call ID\348x348\call_photo_id.png" />
+    <Content Include="res\Call ID\348x348\call_photo_id_conference.png" />
+    <Content Include="res\Call ID\96x96\call_photo_id_conference.png" />
     <Content Include="res\call_active_ic_call.png" />
     <Content Include="res\call_btn_addcall.png" />
     <Content Include="res\call_btn_bluetooth.png" />
     <Content Include="res\call_btn_contacts.png" />
-    <Content Include="res\call_btn_ic_accept.png" />
     <Content Include="res\call_btn_ic_reject.png" />
     <Content Include="res\call_btn_keypad.png" />
     <Content Include="res\call_btn_mute.png" />
     <Content Include="res\call_btn_volume.png" />
     <Content Include="res\call_button_bg_accept_reject.png" />
-    <Content Include="res\call_end_ic_call.png" />
-    <Content Include="res\call_end_message.png" />
     <Content Include="res\call_inline_btn_close.png" />
     <Content Include="res\call_inline_btn_open.png" />
     <Content Include="res\call_lock_icon.png" />
-    <Content Include="res\core_button_add.png" />
+    <Content Include="res\call_multi_ic_arrow.png" />
     <Content Include="shared\res\icon.png" />
   </ItemGroup>
   <ItemGroup>
       <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
     </EmbeddedResource>
   </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Call\Controls\ContactInformationPanel.xaml">
+      <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+    </EmbeddedResource>
+  </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.
diff --git a/CallApp.Tizen/res/Call ID/348x348/call_photo_id_conference.png b/CallApp.Tizen/res/Call ID/348x348/call_photo_id_conference.png
new file mode 100644 (file)
index 0000000..87ca480
Binary files /dev/null and b/CallApp.Tizen/res/Call ID/348x348/call_photo_id_conference.png differ
diff --git a/CallApp.Tizen/res/Call ID/96x96/call_active_photo_id_bg.png b/CallApp.Tizen/res/Call ID/96x96/call_active_photo_id_bg.png
deleted file mode 100644 (file)
index 6651b40..0000000
Binary files a/CallApp.Tizen/res/Call ID/96x96/call_active_photo_id_bg.png and /dev/null differ
diff --git a/CallApp.Tizen/res/Call ID/96x96/call_active_photo_id_default.png b/CallApp.Tizen/res/Call ID/96x96/call_active_photo_id_default.png
deleted file mode 100644 (file)
index bfddf72..0000000
Binary files a/CallApp.Tizen/res/Call ID/96x96/call_active_photo_id_default.png and /dev/null differ
diff --git a/CallApp.Tizen/res/Call ID/96x96/call_photo_id_emergency.png b/CallApp.Tizen/res/Call ID/96x96/call_photo_id_emergency.png
deleted file mode 100644 (file)
index e7f4bcd..0000000
Binary files a/CallApp.Tizen/res/Call ID/96x96/call_photo_id_emergency.png and /dev/null differ
diff --git a/CallApp.Tizen/res/Call ID/96x96/call_photo_id_messageinfo.png b/CallApp.Tizen/res/Call ID/96x96/call_photo_id_messageinfo.png
deleted file mode 100644 (file)
index d85673e..0000000
Binary files a/CallApp.Tizen/res/Call ID/96x96/call_photo_id_messageinfo.png and /dev/null differ
diff --git a/CallApp.Tizen/res/call_btn_ic_accept.png b/CallApp.Tizen/res/call_btn_ic_accept.png
deleted file mode 100644 (file)
index 458a573..0000000
Binary files a/CallApp.Tizen/res/call_btn_ic_accept.png and /dev/null differ
diff --git a/CallApp.Tizen/res/call_end_ic_call.png b/CallApp.Tizen/res/call_end_ic_call.png
deleted file mode 100644 (file)
index 1d57113..0000000
Binary files a/CallApp.Tizen/res/call_end_ic_call.png and /dev/null differ
diff --git a/CallApp.Tizen/res/call_end_message.png b/CallApp.Tizen/res/call_end_message.png
deleted file mode 100644 (file)
index 01fe884..0000000
Binary files a/CallApp.Tizen/res/call_end_message.png and /dev/null differ
diff --git a/CallApp.Tizen/res/call_multi_ic_arrow.png b/CallApp.Tizen/res/call_multi_ic_arrow.png
new file mode 100644 (file)
index 0000000..79ae312
Binary files /dev/null and b/CallApp.Tizen/res/call_multi_ic_arrow.png differ
diff --git a/CallApp.Tizen/res/core_button_add.png b/CallApp.Tizen/res/core_button_add.png
deleted file mode 100644 (file)
index 6538855..0000000
Binary files a/CallApp.Tizen/res/core_button_add.png and /dev/null differ