TizenRefApp-9104 Refactor ContactInformationPanel 90/147190/3
authorRuslan Zakharov <r.zakharov@samsung.com>
Thu, 31 Aug 2017 13:54:06 +0000 (16:54 +0300)
committerRuslan Zakharov <r.zakharov@samsung.com>
Fri, 1 Sep 2017 13:22:16 +0000 (16:22 +0300)
Changed name of panel into ContactInfoPanel and sorted DataTemplates

Change-Id: I1908c37263a0bba5106bb5ae2d59a31b9426986e

CallApp.Tizen/Call/Controls/ContactInfoPanel.xaml [moved from CallApp.Tizen/Call/Controls/ContactInformationPanel.xaml with 99% similarity]
CallApp.Tizen/Call/Controls/ContactInfoPanel.xaml.cs [moved from CallApp.Tizen/Call/Controls/ContactInformationPanel.xaml.cs with 90% similarity]
CallApp.Tizen/Call/Controls/MergeSwapPanel.xaml
CallApp.Tizen/Call/Controls/MergeSwapPanel.xaml.cs
CallApp.Tizen/CallApp.Tizen.csproj

@@ -1,7 +1,7 @@
 <?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:Class="CallApp.Tizen.Call.Controls.ContactInfoPanel"
              x:Name="This"
              xmlns:callControls="clr-namespace:CallApp.Tizen.Call.Controls"
              xmlns:callThemes="clr-namespace:CallApp.Tizen.Call.Themes"
@@ -9,46 +9,6 @@
 
     <ContentView.Resources>
         <ResourceDictionary MergedWith="callThemes:CallTheme">
-            <ControlTemplate x:Key="TopPanel">
-                <commonControls:CustomGrid>
-                    <Grid.ColumnDefinitions>
-                        <ColumnDefinition Width="232" />
-                        <ColumnDefinition Width="*" />
-                        <ColumnDefinition Width="Auto" />
-                    </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>
-
-                    <callControls:FlatButton Grid.Column="2" Grid.Row="2" WidthRequest="80" HeightRequest="80"
-                                             Margin="32,74,0,0" Image="call_btn_addcall.png" IsVisible="False" />
-                </commonControls:CustomGrid>
-            </ControlTemplate>
-
             <ControlTemplate x:Key="ActivePanel">
                 <commonControls:CustomGrid HeightRequest="172">
                     <Grid.ColumnDefinitions>
                 </commonControls:CustomGrid>
             </ControlTemplate>
 
-            <ControlTemplate x:Key="SinglePanel">
+            <ControlTemplate x:Key="EmergencyPanel">
                 <commonControls:CustomGrid>
                     <Grid.ColumnDefinitions>
                         <ColumnDefinition Width="32" />
                         <RowDefinition Height="54" />
                         <RowDefinition Height="33" />
                         <RowDefinition Height="348" />
-                        <RowDefinition Height="42" />
+                        <RowDefinition Height="71" />
                         <RowDefinition Height="86" />
-                        <RowDefinition Height="8" />
-                        <RowDefinition Height="54" />
-                        <RowDefinition Height="63" />
+                        <RowDefinition Height="96" />
                     </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}" />
+                    <Image Grid.Column="1" Grid.Row="3" HorizontalOptions="Center" VerticalOptions="Center" Source="Call ID/348x348/call_photo_id_emergency.png" />
 
                     <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>
 
-            <ControlTemplate x:Key="EmergencyPanel">
+            <ControlTemplate x:Key="SinglePanel">
                 <commonControls:CustomGrid>
                     <Grid.ColumnDefinitions>
                         <ColumnDefinition Width="32" />
                         <RowDefinition Height="54" />
                         <RowDefinition Height="33" />
                         <RowDefinition Height="348" />
-                        <RowDefinition Height="71" />
+                        <RowDefinition Height="42" />
                         <RowDefinition Height="86" />
-                        <RowDefinition Height="96" />
+                        <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="Call ID/348x348/call_photo_id_emergency.png" />
+                    <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>
+
+            <ControlTemplate x:Key="TopPanel">
+                <commonControls:CustomGrid>
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="232" />
+                        <ColumnDefinition Width="*" />
+                        <ColumnDefinition Width="Auto" />
+                    </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>
+
+                    <callControls:FlatButton Grid.Column="2" Grid.Row="2" WidthRequest="80" HeightRequest="80"
+                                             Margin="32,74,0,0" Image="call_btn_addcall.png" IsVisible="False" />
                 </commonControls:CustomGrid>
             </ControlTemplate>
         </ResourceDictionary>
     </ContentView.Resources>
 
     <ContentView.Triggers>
-        <DataTrigger TargetType="ContentView" Binding="{Binding Source={x:Reference This}, Path=LayoutType}" Value="Top">
-            <Setter Property="ControlTemplate" Value="{StaticResource TopPanel}" />
-        </DataTrigger>
-
         <DataTrigger TargetType="ContentView" Binding="{Binding Source={x:Reference This}, Path=LayoutType}" Value="Active">
             <Setter Property="ControlTemplate" Value="{StaticResource ActivePanel}" />
         </DataTrigger>
             <Setter Property="ControlTemplate" Value="{StaticResource ConferencePanel}" />
         </DataTrigger>
 
+        <DataTrigger TargetType="ContentView" Binding="{Binding Source={x:Reference This}, Path=LayoutType}" Value="Emergency">
+            <Setter Property="ControlTemplate" Value="{StaticResource EmergencyPanel}" />
+        </DataTrigger>
+
         <DataTrigger TargetType="ContentView" Binding="{Binding Source={x:Reference This}, Path=LayoutType}" Value="Single">
             <Setter Property="ControlTemplate" Value="{StaticResource SinglePanel}" />
         </DataTrigger>
 
-        <DataTrigger TargetType="ContentView" Binding="{Binding Source={x:Reference This}, Path=LayoutType}" Value="Emergency">
-            <Setter Property="ControlTemplate" Value="{StaticResource EmergencyPanel}" />
+        <DataTrigger TargetType="ContentView" Binding="{Binding Source={x:Reference This}, Path=LayoutType}" Value="Top">
+            <Setter Property="ControlTemplate" Value="{StaticResource TopPanel}" />
         </DataTrigger>
     </ContentView.Triggers>
 </ContentView>
\ No newline at end of file
@@ -18,7 +18,10 @@ using Xamarin.Forms;
 
 namespace CallApp.Tizen.Call.Controls
 {
-    public partial class ContactInformationPanel : ContentView
+    /// <summary>
+    /// Partial class of ContactInfoPanel.xaml
+    /// </summary>
+    public partial class ContactInfoPanel : ContentView
     {
         /// <summary>
         /// Layout types
@@ -32,7 +35,7 @@ namespace CallApp.Tizen.Call.Controls
             Top
         }
 
-        public ContactInformationPanel()
+        public ContactInfoPanel()
         {
             InitializeComponent();
         }
@@ -43,7 +46,7 @@ namespace CallApp.Tizen.Call.Controls
         public static readonly BindableProperty LayoutTypeProperty = BindableProperty.Create(
             "LayoutType",
             typeof(LayoutTypes),
-            typeof(ContactInformationPanel),
+            typeof(ContactInfoPanel),
             LayoutTypes.Single);
 
         public LayoutTypes LayoutType
@@ -52,6 +55,7 @@ namespace CallApp.Tizen.Call.Controls
             {
                 return (LayoutTypes)GetValue(LayoutTypeProperty);
             }
+
             set
             {
                 SetValue(LayoutTypeProperty, value);
@@ -64,7 +68,7 @@ namespace CallApp.Tizen.Call.Controls
         public static readonly BindableProperty StatusTextProperty = BindableProperty.Create(
             "StatusText",
             typeof(string),
-            typeof(ContactInformationPanel),
+            typeof(ContactInfoPanel),
             string.Empty);
 
         public string StatusText
@@ -73,6 +77,7 @@ namespace CallApp.Tizen.Call.Controls
             {
                 return (string)GetValue(StatusTextProperty);
             }
+
             set
             {
                 SetValue(StatusTextProperty, value);
@@ -85,7 +90,7 @@ namespace CallApp.Tizen.Call.Controls
         public static readonly BindableProperty ImageProperty = BindableProperty.Create(
             "Image",
             typeof(ImageSource),
-            typeof(ContactInformationPanel),
+            typeof(ContactInfoPanel),
             null);
 
         public ImageSource Image
@@ -94,6 +99,7 @@ namespace CallApp.Tizen.Call.Controls
             {
                 return (ImageSource)GetValue(ImageProperty);
             }
+
             set
             {
                 SetValue(ImageProperty, value);
@@ -106,7 +112,7 @@ namespace CallApp.Tizen.Call.Controls
         public static readonly BindableProperty PrimaryTextProperty = BindableProperty.Create(
             "PrimaryText",
             typeof(string),
-            typeof(ContactInformationPanel),
+            typeof(ContactInfoPanel),
             string.Empty);
 
         public string PrimaryText
@@ -115,6 +121,7 @@ namespace CallApp.Tizen.Call.Controls
             {
                 return (string)GetValue(PrimaryTextProperty);
             }
+
             set
             {
                 SetValue(PrimaryTextProperty, value);
@@ -127,7 +134,7 @@ namespace CallApp.Tizen.Call.Controls
         public static readonly BindableProperty SecondaryTextProperty = BindableProperty.Create(
             "SecondaryText",
             typeof(string),
-            typeof(ContactInformationPanel),
+            typeof(ContactInfoPanel),
             string.Empty);
 
         public string SecondaryText
@@ -136,6 +143,7 @@ namespace CallApp.Tizen.Call.Controls
             {
                 return (string)GetValue(SecondaryTextProperty);
             }
+
             set
             {
                 SetValue(SecondaryTextProperty, value);
index 90c96ea..191accc 100644 (file)
@@ -6,8 +6,8 @@
              xmlns:loc="clr-namespace:CallApp.Tizen.loc">
 
     <StackLayout>
-        <callControls:ContactInformationPanel LayoutType="Top" StatusText="{x:Static loc:loc.OnHold}"
-                                              PrimaryText="Test" SecondaryText="Test" />
+        <callControls:ContactInfoPanel LayoutType="Top" StatusText="{x:Static loc:loc.OnHold}"
+                                       PrimaryText="Test" SecondaryText="Test" />
 
         <StackLayout HeightRequest="122" Orientation="Horizontal">
             <callControls:FlatButton HorizontalOptions="FillAndExpand" Image="call_multi_ic_merge.png" Text="{x:Static loc:loc.Merge}" />
index caca55f..dd97287 100644 (file)
@@ -18,6 +18,9 @@ using Xamarin.Forms;
 
 namespace CallApp.Tizen.Call.Controls
 {
+    /// <summary>
+    /// Partial class of MergeSwapPanel.xaml
+    /// </summary>
     public partial class MergeSwapPanel : ContentView
     {
         public MergeSwapPanel()
index 03589f1..3b8121e 100644 (file)
@@ -68,8 +68,8 @@
     <Compile Include="Call\Controls\ConferenceCallManageList.xaml.cs">
       <DependentUpon>ConferenceCallManageList.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Call\Controls\ContactInformationPanel.xaml.cs">
-      <DependentUpon>ContactInformationPanel.xaml</DependentUpon>
+    <Compile Include="Call\Controls\ContactInfoPanel.xaml.cs">
+      <DependentUpon>ContactInfoPanel.xaml</DependentUpon>
     </Compile>
     <Compile Include="Call\Controls\FlatButton.xaml.cs">
       <DependentUpon>FlatButton.xaml</DependentUpon>
     </EmbeddedResource>
   </ItemGroup>
   <ItemGroup>
-    <EmbeddedResource Include="Call\Controls\ContactInformationPanel.xaml">
+    <EmbeddedResource Include="Call\Controls\ContactInfoPanel.xaml">
       <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
     </EmbeddedResource>
   </ItemGroup>